Search code examples
encryptioncryptographycryptojs

Are the default CryptoJS AES params secure?


The default params used for AES encryption with CryptoJS are:

  • Cypher: AES-256
  • Mode: cbc
  • Key Derivation: evpkdf (OpenSSL custom, MD5, 1 iteration)

Are these safe to use?

Related: What are the AES parameters used and steps performed internally by crypto-js while encrypting a message with a password?


Solution

  • Answering my own question; NO! ABSOLUTELY NOT!

    CryptoJS by default does only a single iteration of MD5 hashing over the password, which is extremely weak unless the password is extremely strong!

    Correct key derivation of arbitrary passwords should do key derivation with something along the 30k iterations!