encryptString method
Encrypts a simple string.
Implementation
String encryptString(String plainText) {
try {
final encrypter = Encrypter(AES(key, mode: AESMode.cbc));
final encrypted = encrypter.encrypt(plainText, iv: iv);
return encrypted.base64;
} catch (e) {
throw Exception('String encryption failed: $e');
}
}