DecryptBinary()
Decrypts the given binary with the optional parameters
DecryptBinary( binaryData=any, key=string, algorithm=string, IVorSalt=any, iterations=number, precise=boolean );
Returns: any
| Argument | Description | Default |
|---|---|---|
|
binaryData
any,
required
|
edit
Binary data to decrypt. Alias: input |
|
|
key
string,
required
|
edit
Key or seed used to encrypt the string.
|
|
|
algorithm
string,
optional
|
edit
The algorithm to use to decrypt the string. Must be the same as the algorithm used to encrypt the string.
|
cfmx_compat |
|
IVorSalt
any,
optional
|
edit
Initialization Vector for algorithms with Feedback Mode that is not ECB, or Salt for Password Based Encryption algorithms Alias: IV, Salt, prefix |
|
|
iterations
number,
optional
|
edit
number of Iterations for Password Based Encryption algorithms (ignored for all other algorithms). NIST recommends a minimum value of 1000. |
|
|
precise
boolean,
optional
|
edit
if set to true the input must follow the rule for that encoding a 100%, the decryptor will not try to interpret inputs that are not a 100% correct. This should be used to avoid false positives. Introduced: 6.0.0.227 |
true |
Examples
edit // binary data
data = toBinary("abcd");
// generate the key
key = generateSecretKey("AES");
// encrypt string
encryptValue = encryptBinary(data, key);
writeDump(encryptValue);
// decrypt string
decryptValue = decryptBinary(encryptValue, key);
writeDump(decryptValue);
See also
- Binary data
- Cryptography
- EncryptBinary()
- Search Issue Tracker open_in_new
- Search Lucee Test Cases open_in_new (good for further, detailed examples)