Sorcerer's IsleDocs cfPassphraseOverviewCode

PassphraseHash

Description

Performs a one-way salted hash on the provided passphrase, using a slow key derivation function, specified by the algorithm and algorithmparams arguments (or the default values).

The resulting hash can then be stored for future authentication using the PassphraseCheck function, or by any other tool which supports the algorithm used.

Returns

A string. A salted hash, either base64 or hex encoded (depending on the algorithm used).

Function syntax

PassphraseHash( Passphrase [, Algorithm [, AlgorithmParams ]])

Arguments

Name Type Default Description
Passphrase String Required The text to be hashed.
Algorithm String bcrypt The algorithm to use. bcrypt, pbkdf2, scrypt. See Algorithms for details.
AlgorithmParams Struct Optional Params to provide to the algorithm. See Tuning Algorithm Params for details.

Example

<cfset User.create( Form.Username , PassphraseHash( Form.Passphrase ) ) />