Skip to content

Instantly share code, notes, and snippets.

@pinkeshdarji
Created June 25, 2021 06:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pinkeshdarji/4bebff30ded93e11670ff26defda26b2 to your computer and use it in GitHub Desktop.
Save pinkeshdarji/4bebff30ded93e11670ff26defda26b2 to your computer and use it in GitHub Desktop.
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