Created
February 27, 2020 04:40
-
-
Save tianhaoz95/aaac07ac6d2c4f648ee79c016dee56ea to your computer and use it in GitHub Desktop.
Decrypt message from the encrypted message string
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
crypto.Key key = crypto.Key.fromUtf8(padCryptionKey(token)); | |
crypto.IV iv = crypto.IV.fromLength(16); | |
crypto.Encrypter encrypter = crypto.Encrypter(crypto.AES(key)); | |
crypto.Encrypted encryptedMsg = crypto.Encrypted.fromBase64(msg); | |
msg = encrypter.decrypt(encryptedMsg, iv: iv); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment