generatePBKDFKey

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

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

generatePBKDFKey Argument Reference

algorithm
Required

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

passphrase
Required

Passphrase used for the key. KEEP THIS SECRET.

salt
Required

A random salt

iterations
Required

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

keysize
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