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