encryptUsingAesWithoutIV static method

String encryptUsingAesWithoutIV({
  1. String key = r'Pi@aTom#$tech123',
  2. required String plainText,
})

Implementation

static String encryptUsingAesWithoutIV({
  String key = r'Pi@aTom#$tech123',
  required String plainText,
}) {
  final keyUtf = Key.fromUtf8(key);
  // final keyUtf = Key(Uint8List.fromList(utf8.encode(key)));

  final encrypter = Encrypter(AES(keyUtf, mode: AESMode.ecb));

  final encrypted = encrypter.encrypt(plainText, iv: IV.fromUtf8(''));

  return encrypted.base64;
}