decryptToJson method
Decrypts a base64 string back to a JSON object.
Implementation
dynamic decryptToJson(String base64) {
try {
final encrypter = Encrypter(AES(key, mode: AESMode.cbc));
final decrypted = encrypter.decrypt64(base64, iv: iv);
return jsonDecode(decrypted);
} catch (e) {
throw Exception('Decryption failed: $e');
}
}