Dave-

Last fall I was convinced that I needed to dynamically create encrypted "Buy Now" buttons for paypal processing. The documents are a little scattered, but I was able to generate them on the fly. As I recall ( I realized that for my purposes, I wouldn't need to do this after all), I left it with a hitch still unresolved: paypal's server threw errors saying that I was using an unrecognized profile. It's been some time, but I probably would need to examine my account profile at paypal to make sure that I had all the options set correctly.

It sounds like you are set up already and testing.

Here is the operative block I used to call the encryption:

<!--- encrypt the hidden field values and generate the button form code --->
<cfoutput>
<cfset buttonCode = buttonManager.encryptButton(buttonSource.getBytes("UTF-8")) />
</cfoutput>


Where buttonSource is a string containing name/value pairs that could be be sent as "hidden" form fields, and buttonCode will be the encrypted value of the input corresponding to the button. Coldfusion strings are of type java.lang.string, so you need to make a call to the java _string.getBytes()_ to send the BouncyCastle encrypt() the info in a format it can work with.

Hope that helps,
Tom

Dave Shuck wrote:
I am trying to demonstrate to my boss that data encrypted using the ColdFusion encrypt() using AES encryption can be decrypted by other systems/languages using the same key. (At least I hope I can demonstrate this)
For my test, I generated a key like this:
myKey = generateSecretKey("aes");

Then I encrypted a string using:
encrypt(myString,myKey,"aes","hex"); // tried other encoding as well

To match this result using another technology, I am trying to use the Java Bouncy Castle API for JCE from within ColdFusion. Here is where I am having a big stumbling block. It appears that the key it uses is an object rather than a simple string. Is there anyway to encrypt/decrypt using Bouncy Castle with the string key I generated within ColdFusion?


--
~Dave Shuck
[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
www.daveshuck.com <http://www.daveshuck.com>
www.worldwildweb.biz <http://www.worldwildweb.biz> ---------------------------------------------------------- You are subscribed to cfcdev. To unsubscribe, send an email to [email protected] with the words 'unsubscribe cfcdev' as the subject of the email.

CFCDev is run by CFCZone (www.cfczone.org) and supported by CFXHosting (www.cfxhosting.com).

An archive of the CFCDev list is available at www.mail-archive.com/[email protected]


----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email to 
[email protected] with the words 'unsubscribe cfcdev' as the subject of the 
email.

CFCDev is run by CFCZone (www.cfczone.org) and supported by CFXHosting 
(www.cfxhosting.com).

An archive of the CFCDev list is available at 
www.mail-archive.com/[email protected]


Reply via email to