>From the CFStudio help files:

Encrypt
Encrypts a string. The Encrypt function uses a symmetric key-based algorithm
in which the key used to encrypt a string is the same key as the one used to
decrypt the string. The security of the encrypted string hinges on
maintaining the secrecy of the key. In particular, Encrypt uses an XOR-based
algorithm that utilizes a pseudo-random 32-bit key based on a seed passed by
the user as a parameter to the function. The resultant data is UUencoded and
may be as much as three times the original size.

See also Decrypt.

Syntax
Encrypt(string, seed)

string
String to be encrypted.

seed
String specifying the seed to be used to generate the 32-bit key needed to
encrypt the string.

Examples
<!--- This example shows the use of Encrypt and Decrypt --->
<HTML>
<HEAD>
<TITLE>Encrypt Example</TITLE>
</HEAD>

<BODY BGCOLOR=silver>
<H3>Encrypt Example</H3>

<P>This function allows for the encryption and decryption of a
string. Try it out by entering your own string and a key of your
own choosing and seeing the results.
<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" METHOD="post">
<P>Input your key:
<P><INPUT TYPE="Text" NAME="myKey" VALUE="foobar">
<P>Input your string to be encrypted:
<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>
</BODY>
</HTML>

Todd

----- Original Message -----
From: "Pooh Bear" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Tuesday, April 17, 2001 6:49 PM
Subject: RE: ENcoding URL


> how do I encrypt the string?!!!!! :(
>
>
> >From: "Dylan Bromby" <[EMAIL PROTECTED]>
> >Reply-To: [EMAIL PROTECTED]
> >To: CF-Talk <[EMAIL PROTECTED]>
> >Subject: RE: ENcoding URL
> >Date: Tue, 17 Apr 2001 14:11:29 -0700
> >
> >sure there is.
> >
> >encrypt the strings. i do it all the time. i also make the key for
> >encryption dynamic so the URLs can't be copied & pasted.
> >
> >on top of which, in some cases i URLEncodedFormat() the already encrypted
> >strings. which further makes them undecipherable.



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to