Decrypt |
Description
Decrypts a string that is encrypted with the Encrypt function.
Returns
String, unencrypted.
Category
Other functions, String functions
Function syntax

    Decrypt(encrypted_string, seed)

See also
Duplicate, Encrypt
Parameters

Parameter | Description
encrypted_string | String or a variable that contains one. String to decrypt
seed | String. The 32-bit key that was used to encrypt the string.

Example

    <!--- This example shows the use of Encrypt and Decrypt --->
    <h3>Decrypt Example</h3>
    <p>This function encrypts/decrypts a string. Enter a string and a key.
    <cfif IsDefined("FORM.myString")>
       <cfset string = FORM.myString>
       <cfset key = FORM.myKey>
       <cfset encrypted = encrypt(string, key)>
       <cfset decrypted = decrypt(encrypted, key)>
       <cfoutput>
          <h4><B>The string:</B></h4> #string# <br>
          <h4><B>The key:</B></h4> #key#<br>
          <h4><B>Encrypted:</B></h4> #encrypted#<br>
          <h4><B>Decrypted:</B></h4> #decrypted#<br>
       </cfoutput>
    </cfif>
    <form action = "encrypt.cfm">
    <p>Input your key:
    <p><input type = "Text" name = "myKey" value = "foobar">
    <p>Enter string to encrypt:
    <p><textArea name = "myString" cols = "40" rows = "5" WRAP = "VIRTUAL">
    This string will be encrypted (try typing some more)</textArea>
    <input type = "Submit" value = "Encrypt my String">
    </form>

encrypted_string |
String or a variable that contains one. String to decrypt

seed |
String. The 32-bit key that was used to encrypt the string.