How about the URLEncodedFormat function?

Bob

-----Original Message-----
From: Phill Gibson [mailto:[EMAIL PROTECTED]]
Sent: December 5, 2000 1:46 PM
To: CF-Talk
Subject: Encryption problem when passed in URL?


Hi Everyone,

Try this:

<html><head></head><body><cfoutput>

<cfset date= "27-FEB-02:28:07:18">
<cfset key = "aabbcc">
Before encryption, date is #date#<br>

<cfset date2=Encrypt(date, #key#)>
Encrypted, date2 is #date2#<br>

<cfset date=Decrypt(date2, #key#)>
 After encryption, date is #date#<br>

</cfoutput></body></html>

With that given key and string, it gives the following output:
Before encryption, date is 27-FEB-02:28:07:18
Encrypted, date2 is 2#1 276*NP/W/WWV.Y\,1]4OG
After decryption, date is 27-FEB-02:28:07:18

Notice there is a space in the encryped string in position 4!   If I pass
this using, say, <cfmail> as an encrypted variable in the URL it bombs out
as in:

<a href="www.domain.com/process.cfm?var1=2#1 276*NP/W/WWV.Y\,1]4OG>click
here to proceed</a>
See that space still there?

Some dates do this, but by far, most don't. I came up with a second one with
a white space in it by tweaking the date after about 20 random tries.

Does anyone have any suggestions?

(I suppose I could just apologize to every ~20th customer for choosing the
wrong time of day! ;-)


Phill Gibson
Velawebs Web Designs
www.Velawebs.com
[EMAIL PROTECTED]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        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