User Guide
592 Chapter 3: ColdFusion Functions
GenerateSecretKey
Description
Gets a secure key value for use in the Encrypt function.
Returns
A string containing the encryption key.
Category
Security functions, String functions
Function syntax
GenerateSecretKey(algorithm)
See also
Decrypt
, Encrypt
History
ColdFusion MX 7: Added this function.
Parameters
Usage
You cannot use the GenerateSecretKey function to generate a key for the ColdFusion default
encryption algorithm (CFMX_COMPAT) of the
Encrypt and Decrypt functions.
ColdFusion MX 7 uses the Java Cryptography Extension (JCE) and installs a Sun Java 1.4.2
runtime that includes the Sun JCE default security provider. This provider includes the
algorithms listed in the Parameters section. The JCE framework includes facilities for using other
provider implementations; however, Macromedia cannot provide technical support for third-
party security providers.
Parameter Description
algorithm The encryption algorithm for which to generate the key. ColdFusion MX
installs a cryptography library with the following algorithms:
• AES: the Advanced Encryption Standard specified by the National Institute
of Standards and Technology (NIST) FIPS-197.
• BLOWFISH: the Blowfish algorithm defined by Bruce Schneier.
• DES: the Data Encryption Standard algorithm defined by NIST FIPS-46-3.
DESEDE: the "Triple DES" algorithm defined by NIST FIPS-46-3.