home *** CD-ROM | disk | FTP | other *** search
/ Chip 2002 February / CHIPCD_02_2002.iso / Internet / Macromedia ColdFusion Server 5 / coldfusion-50-win-us.exe / data1.cab / Examples / CFDOCS / snippets / encrypt.cfm < prev    next >
Encoding:
Text File  |  2001-06-13  |  1.3 KB  |  40 lines

  1. <!--- This example shows the use of encrypt and decrypt --->
  2. <HTML>
  3. <HEAD>
  4. <TITLE>Encrypt Example</TITLE>
  5. </HEAD>
  6.  
  7. <BASEFONT FACE="Arial, Helvetica" SIZE=2>
  8. <BODY  bgcolor="#FFFFD5">
  9.  
  10. <H3>Encrypt Example</H3>
  11.  
  12. <P>This file has been disabled for online viewing. Please use your copy of ColdFusion to view this example. 
  13. <!--- <P>This function allows for the encryption and decryption of a 
  14. string. Try it out by entering your own string and a key of your 
  15. own choosing and seeing the results.
  16. <CFIF IsDefined("form.myString")>
  17.    <CFSET string = form.myString>
  18.    <CFSET key = form.myKey>
  19.    <CFSET encrypted = encrypt(string, key)>
  20.    <CFSET decrypted = decrypt(encrypted, key)>
  21.    <CFOUTPUT>
  22.      <H4><B>The string:</B></H4> #string# <BR>
  23.      <H4><B>The key:</B></H4> #key#<BR>
  24.      <H4><B>Encrypted:</B></H4> #encrypted#<BR>
  25.      <H4><B>Decrypted:</B></H4> #decrypted#<BR>
  26.     </CFOUTPUT>
  27. </CFIF>
  28. <FORM action="encrypt.cfm" method="post">
  29. <P>Input your key:
  30. <P><INPUT TYPE="Text" NAME="myKey" VALUE="foobar">
  31. <P>Input your string to be encrypted:
  32. <P><TEXTAREA NAME="myString" COLS="40" ROWS="5" WRAP="VIRTUAL">
  33. This string will be encrypted (try typing some more)
  34. </TEXTAREA>
  35. <INPUT TYPE="Submit" VALUE="Encrypt my String">
  36. </FORM> --->
  37.  
  38. </BODY>
  39. </HTML>       
  40.