Contents > CFML Reference > ColdFusion Functions > Decrypt PreviousNext

Decrypt

Decrypts a string that is encrypted with the Encrypt function.

String, unencrypted.

Other functions, String functions

Decrypt(encrypted_string, seed)

Duplicate, Encrypt

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.

<!--- 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>

Contents > CFML Reference > ColdFusion Functions > Decrypt PreviousNext

ColdFusion 9 | ColdFusion 8 | ColdFusion MX 7 | ColdFusion MX 6.1 | ColdFusion MX | Forums | Developer Center | Bug Reporting

Version 6.1

Comments are no longer accepted for ColdFusion MX 6.1. ColdFusion 8 is the current version.

 

Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/coldfusion/6.1/htmldocs/functi70.htm