encrypt256Str function

String encrypt256Str(
  1. String plainText
)

Implementation

String encrypt256Str(String plainText){

  var generatedIV = generate16DigitNumber();

  final key = encrypt.Key.fromUtf8("5PbpCqeioHQ3MWj6dJVeluXDE7UttN8P"); //32
  final iv = encrypt.IV.fromUtf8(generatedIV);
  final encrypter = encrypt.Encrypter(encrypt.AES(key,mode:encrypt.AESMode.cbc));

  final encrypted = encrypter.encrypt(plainText, iv: iv);
  //  final decrypted = encrypter.decrypt(encrypted, iv: iv);


  return generatedIV + encrypted.base64;
}