generatePBKDFKey

CFML implementation of Password-Based Key-Derivation Function (PBKDF).

generatePBKDFKey(Algorithm, Passphrase, Salt, Iterations, KeySize) → returns String

Argument Reference for the generatePBKDFKey function

algorithm

Required: Yes
Hashing algorithm used for generating key Values:
  • PBKDF2WithHmacSHA1
  • PBKDF2WithSHA1
  • PBKDF2WithSHA224
  • PBKDF2WithSHA256
  • PBKDF2WithSHA384
  • PBKDF2WithSHA512

passphrase

Required: Yes
Passphrase used for the key. KEEP THIS SECRET.

salt

Required: Yes
A random salt

iterations

Required: Yes
The number of PBKDEF iterations to perform. A minimum recommended value is 1000 Values:
  • 1000

keysize

Required: No
Default: Length of hashing algorithm output
The length in bytes of the key to generate

Links more information about generatePBKDFKey

Examples sample code invoking the generatePBKDFKey function


Example PBKDF2 With HMAC SHA1

generatePBKDFKey("PBKDF2WithHmacSHA1", "secret", "salty", 5000, 128)

Expected Result: Y0MCpCe3zb0CNJvyXNUWEQ==


Fork me on GitHub