1

Does google's Crypto.JS AES encryption use PBKDF2 as default?

Some references, but I can't figure out the answer myself:

https://code.google.com/p/crypto-js/#The_Cipher_Algorithms

https://code.google.com/p/crypto-js/source/browse/tags/3.1.2/src/aes.js

e-sushi
  • 17,891
  • 12
  • 83
  • 229
pinhead
  • 245
  • 1
  • 7

2 Answers2

3

The documentation says it's OpenSSL, not PBKDF2:

When you use a CipherParams object in a string context, it's automatically converted to a string according to a format strategy. The default is an OpenSSL-compatible format

This can be verified in the source code. The implementation of the OpenSSL KDF is in evpkdf.js.

The key derivation function is usually referenced as EVP_BytesToKey which is the higher level function in the API that implements the KDF.

Maarten Bodewes
  • 92,551
  • 13
  • 161
  • 313
vcsjones
  • 146
  • 4
1

I assume you are invoking it like this:

CryptoJS.AES.encrypt("Message", "Secret Passphrase");

As of 3.1.2 the default key derivation function is OpenSSLKdf as configured here and implemented here and here.

wonce
  • 446
  • 3
  • 5