> <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 encrypted 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?
>
Wrap the encrypted date with URLEncodedFormat().
changes spaces to + signs and non-alphanumeric to hex.
CFAS will automatically decode such an URL var.
- test before using ... does Encrypt() produce strings
using + and %hex chars? If so, then the decoding of the
URL var might get wrong - won't happen with an input tag.
Pan
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists