AES constructor
Implementation
AES({required this.secretKey, required this.iv, this.padding = "0"}) {
try {
String secretKey32Bytes = secretKey
.padRight(32, padding)
.substring(0, 32);
String iv16Bytes = iv.padRight(16, padding).substring(0, 16);
_secretKey = aes.Key.fromUtf8(secretKey32Bytes);
_iv = aes.IV.fromUtf8(iv16Bytes);
} catch (e) {
log(e.toString());
}
}