If I encrypt from windows, browser or native, app doesn't decrypt on android.
If I encrypt from linux, app does decrypt succesfully on android.
Do you know how to create functions, encrypt and decrypt, platform independent?
Here the code:
String encryptAES(String originalText, Key secretKey) {
final encrypter = Encrypter(AES(secretKey, mode: AESMode.cbc));
final encrypted = encrypter.encrypt(originalText, iv: IV.fromLength(16));
return encrypted.base64;
}
String decryptAES(String encryptedText, Key secretKey) {
final encrypter = Encrypter(AES(secretKey, mode: AESMode.cbc));
final encrypted = Encrypted.fromBase64(encryptedText);
final decrypted = encrypter.decrypt(encrypted, iv: IV.fromLength(16));
return decrypted;
}
If I encrypt from windows, browser or native, app doesn't decrypt on android. If I encrypt from linux, app does decrypt succesfully on android. Do you know how to create functions, encrypt and decrypt, platform independent?
Here the code: