static String encKey = 'oasterw4567ncdsagfhswtoslfiessgv';
static final key = encrypt.Key.fromUtf8(encKey);
static final iv = encrypt.IV.fromLength(16);
static final encrypter = encrypt.Encrypter(
encrypt.AES(key, mode: encrypt.AESMode.cbc, padding: 'PKCS7'));
static encryptAES(text) {
final encrypted = encrypter.encrypt(text, iv: iv);
print("Encrypted " + encrypted.base64);
decryptAES(encrypted.base64);
return encrypted.base64;
}
static decryptAES(encText) {
String original =
encrypter.decrypt(encrypt.Encrypted.from64(encText), iv: iv);
print("Decrypt " + original);
}
this is simple AES algo but now client required aes/cbc/pkcs5padding so how can i convert this ?