I know this isn't really fusebox but I though maybe someone out there might
know what to do. I'm trying to encrypt long lists of URLs, but for some
reason when I pass the string from the encrpt() function via a URL (
i.e.index.cfm?fuseaction=decrypt&URL=#attributes.encryptedURL#) things start
to go wrong. Here is a bit of code that I've been playing with. Iff anyone
can help, please do.
<!--- This page should be saved as encrypt.cfm --->
<!--- STEP 3 --->
<cfif isDefined("url.encrypted")>
<cfset string = URLDecode(url.encrypted)>
<CFSET key = url.Key>
<cfoutput>#string#<br>#key#</cfoutput>
<CFSET decrypted = decrypt(string, key)>
<cfoutput> <br>#decrypted#</cfoutput><cfabort>
<cflocation url="#decrypted#">
</cfif>
<!--- STEP 2 --->
<CFIF IsDefined("FORM.aUrl")>
<CFSET url = FORM.aUrl>
<CFSET key = FORM.aKey>
<CFSET encrypted = encrypt(url, key)>
<CFSET decrypted = decrypt(encrypted, key)>
<!--- <cfset fred = decrypt(decrypted, key)> --->
<!--- <cflocation url="#decrypted#" addtoken="No"> --->
<!--- <CFOUTPUT> --->
<H4><B>The string:</B></H4><CFOUTPUT> #url#</CFOUTPUT> <BR>
<H4><B>The key:</B></H4><CFOUTPUT> #key#</CFOUTPUT><BR>
<H4><B>Encrypted:</B></H4> <a
href="encrypt.cfm?key=<CFOUTPUT>#key#</CFOUTPUT>&encrypted=<CFOUTPUT>#encryp
ted#</CFOUTPUT>"><CFOUTPUT>#encrypted#</CFOUTPUT></a><BR>
<H4><B>Decrypted:</B></H4> <a
href="<CFOUTPUT>#decrypted#</CFOUTPUT>"><CFOUTPUT>#URLEncodedFormat(decrypte
d)#</CFOUTPUT></a><BR>
<!--- </CFOUTPUT> --->
</CFIF>
<!--- STEP 1 --->
<FORM ACTION="encrypt.cfm" METHOD="post">
<P>Input your key:
<P><INPUT TYPE="Text" NAME="aKey" VALUE="foobar">
<P>Input the URL to be encrypted:
<P><textArea NAME="aurl" cols="40" rows="5" WRAP="VIRTUAL">
URL goes here....
</textArea>
<INPUT TYPE="Submit" VALUE="Encrypt the URL">
</FORM>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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