2

Is it possible in javascript to use AES in ECB mode with the Pkcs5 padding scheme?

The reason why i want to use the ECB mode is because it is desired by the client.

user1987623
  • 21
  • 1
  • 2
  • AFAIR JavaScript does not include any AES functionality by default, therefore if you can use AES/ECB/PKCS5 depends on the JavaScript cryptography library you use. – Robert Jan 17 '13 at 15:55
  • I've already searched the web for encryption libraries, but I didn't find one that supports this combination. To be honest i don't know much about encryption, so any information would be helpful. – user1987623 Jan 17 '13 at 16:00
  • @user1987623 I am looking for exactly same thing have you found anything on this? – 2intor Nov 28 '16 at 04:53

1 Answers1

4

http://code.google.com/p/crypto-js looks like it has AES, ECB mode, and PKCS5 padding.

See http://code.google.com/p/crypto-js/source/browse/branches/3.x/src/cipher-core.js line 369, and http://code.google.com/p/crypto-js/source/browse/branches/3.x/src/mode-ecb.js.

Disclaimer: I know absolutely nothing about how well tested, audited, or maintained this library is, so you should do your own research on it before using it for anything important.

Emily
  • 5,869
  • 1
  • 22
  • 15
  • 4
    Note that PKCS#5 padding is identical to PKCS#7 padding, so do not worry about not seeing "PKCS#5" in crypto-js. – Rob Napier Jan 17 '13 at 16:22
  • Thanks for the advice on "PKCS#5 being identical to PKCS#7". I've already explored the CryptoJS Library but I didn't see the PKCS#5 padding scheme anywhere. – user1987623 Jan 17 '13 at 16:30
  • Officially you cannot use PKCS#5 because it has only been specified for 8 byte block ciphers. But in practice they are identical. – Maarten Bodewes Jan 18 '13 at 23:21