0

I am converting a backdated script in JAVA. this script performs AES encrytion and decryption.

This is for AES. have tried various techniques.

This is in my Java file

    Cipher.getInstance("AES");

What do i insert here in Javascript as a equivalent?

    var algorithm = 'aes-128-cbc';

Expecting the javascript project to perform the exact same task as the java project.

  • Note: `Cipher.getInstance("AES");`== `Cipher.getInstance("AES/ECB/PKCS5Padding");` – Robert Sep 27 '19 at 11:41
  • @Robert Thank You! this makes things easier :D do add it as an answer , so i can upvote and accept it – Saloni Sikdar Sep 27 '19 at 12:05
  • 1
    @SaloniSikdar note that this isn't officially defined behaviour, hence it might depend on the version/implementation of Java you're using. see: https://stackoverflow.com/a/10084030/1358308 – Sam Mason Sep 27 '19 at 13:50
  • note that use of ECB for arbitrary data is [discouraged](https://crypto.stackexchange.com/a/20946/72896). I'd recommend moving to another mode if at all possible! – Sam Mason Sep 27 '19 at 13:58

0 Answers0