DecryptBinary()
Decrypts the given binary with the optional parameters
DecryptBinary( binaryData=any, key=string, algorithm=string, IVorSalt=any, iterations=number, precise=boolean );
Returns: any
Examples
// binary data
data = toBinary("abcd");
<span class="c">// generate the key</span>
<span class="nv">key</span> <span class="o">=</span> <span class="nf">generateSecretKey</span><span class="p">(</span><span class="s2">"AES"</span><span class="p">);</span>
<span class="c">// encrypt string</span>
<span class="nv">encryptValue</span> <span class="o">=</span> <span class="nf">encryptBinary</span><span class="p">(</span><span class="nv">data</span><span class="p">,</span> <span class="nv">key</span><span class="p">);</span>
<span class="nf">writeDump</span><span class="p">(</span><span class="nv">encryptValue</span><span class="p">);</span>
<span class="c">// decrypt string</span>
<span class="nv">decryptValue</span> <span class="o">=</span> <span class="nf">decryptBinary</span><span class="p">(</span><span class="nv">encryptValue</span><span class="p">,</span> <span class="nv">key</span><span class="p">);</span>
<span class="nf">writeDump</span><span class="p">(</span><span class="nv">decryptValue</span><span class="p">);</span>
See also
- Binary data
- Cryptography
- EncryptBinary()
- Search Issue Tracker
- Search Lucee Test Cases (good for further, detailed examples)