encrypt method
Implementation
String encrypt({
required String data,
String? newKey,
String? iv,
}) {
iv ??= this.iv;
newKey ??= key;
final encrypter = Encrypter(
AES(
Key.fromUtf8(newKey),
mode: AESMode.ctr,
),
);
return encrypter.encrypt(data, iv: IV.fromBase64(iv)).base64;
}