Created
June 25, 2021 06:59
-
-
Save pinkeshdarji/4bebff30ded93e11670ff26defda26b2 to your computer and use it in GitHub Desktop.
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
Future<String> decrypt(String encryptedMessage) async { | |
// 1. | |
aesGcmSecretKey = await AesGcmSecretKey. | |
(derivedBits); | |
// 2. | |
List<int> message = Uint8List.fromList(encryptedMessage.codeUnits); | |
// 3. | |
Uint8List decryptdBytes = await aesGcmSecretKey.decryptBytes(message, iv); | |
// 4. | |
String decryptdString = String.fromCharCodes(decryptdBytes); | |
print('decryptdString $decryptdString'); | |
return decryptdString; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment