encrypt icon indicating copy to clipboard operation
encrypt copied to clipboard

AES/SIC equivalent in node.js

Open deepak786 opened this issue 3 years ago • 4 comments

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.

deepak786 avatar Apr 27 '22 11:04 deepak786

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.

FabrizioBilleciUNICT avatar Jun 08 '22 20:06 FabrizioBilleciUNICT

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));

jonbhanson avatar Jul 30 '22 03:07 jonbhanson

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 avatar Jan 21 '23 03:01 markosole

@markosole were you able to do what you said?

abdimussa87 avatar Jun 07 '23 17:06 abdimussa87