decryptText static method

String decryptText(
  1. String encryptedText,
  2. String secretKey
)

Implementation

static String decryptText(String encryptedText, String secretKey) {
  final key = encrypt.Key.fromUtf8(secretKey.padRight(32).substring(0, 32));
  final iv = encrypt.IV.fromLength(16);
  final encrypter = encrypt.Encrypter(encrypt.AES(key));
  return encrypter.decrypt64(encryptedText, iv: iv);
}