encrypt
encrypt copied to clipboard
AES/SIC equivalent in node.js
I'm trying the Crypto package from Node JS. But I didn't find anything equivalent to "AES/SIC" which is supported by this encrypt package.
So how to decrypt the data on Node JS which is encrypted from Dart using this package.
Hi. Any news about this topic? I need the opposite: I encrypt a string in NodeJS by using Crypto in AES and then I need to decrypt it in the Flutter App. This is what I tried:
const encryptedString = '########...';
final key = ECR.Key.fromUtf8('32 chars key');
final iv = ECR.IV.fromUtf8('the same 32 chars key (it is not required in CryptoJS, why?)');
final encrypter = ECR.Encrypter(ECR.AES(key));
final decrypted = encrypter.decrypt(ECR.Encrypted.fromUtf8(value), iv: iv);
print(decrypted);
Thanks.
I was able to get it working by using AESMode.cbc on the dart side. Then the node.js side could decrypt successfully:
final encrypter =Encrypter(AES(key, mode:AESMode.cbc));
I'll publish complete solution shortly so stay tuned on my profile. It includes end to end with AES CBC flutter and NodeJS side.
@markosole were you able to do what you said?