So I encrypted a value using crypto-js on my backend like this :
const encryptedValue = CryptoJS.AES.encrypt(
JSON.stringify(data),
process.env.ENCRYPTION_KEY
);
Then I try to decrypt it using this in my flutter app:
class CustomEncryption {
static final encryptionKey = Key.fromUtf8('quZ2z5Fe42vci3teZmMIxtPxtdPtTSMQ');
static final iv = IV.fromLength(16);
static String decrypt(String data) {
final encrypter = Encrypter(AES(
encryptionKey,
mode: AESMode.cbc,
padding: null,
));
final decrypted = encrypter.decrypt64(data, iv: iv);
return decrypted;
}
}
But this is returned g��ԩ�����R\��{�+�ziN