GenerateSecretKey()
Gets a secure key value for use in the encrypt function.
GenerateSecretKey( algorithm=string, keySize=number );
Returns: String
Argument | Description |
---|---|
algorithm
string,
required
|
The encryption algorithm for which to generate the key. |
keySize
number,
optional
|
Number of bits requested in the key for the specified algorithm. |
Examples
ex={};
ex.algo="RC4";
ex.value="554122";
ex.key=GenerateSecretKey(ex.algo);
ex.enc=Encrypt(ex.value, ex.key, ex.algo);
ex.dec=Decrypt(ex.enc, ex.key, ex.algo);
dump(ex);
See also
- Cryptography
- Encrypt()
- Search Issue Tracker
- Search Lucee Test Cases (good for further, detailed examples)