Wil, >>>Which encryption method are you using? The stronger ones require that you also install the Java Cryptography Extension.
Yes, I was reading up on that in the Adobe documentation. OK, I will proceed to do that. I had read that an encryption method was optional, but I understand that I should include it. Assuming I use the encryption method, I am guessing my insert statement would look something like: CreditCardNumber = <cfqueryparam cfsqltype="cf_sql_varchar" value="#encrypt(form.CreditCardNumber,request.encryptionkey,"AES","UU")#">, And then the decrypt would look like: Display Decrypted Credit Card Number: <cfoutput>#decrypt(form.CreditCardNumber,request.encryptionkey,"AES","UU")#" </cfoutput> Look ok? Thank you for your advice. =) Eric Wil Genovese Sr. Web Application Developer/ Systems Administrator CF Webtools www.cfwebtools.com wilg...@trunkful.com www.trunkful.com On Nov 4, 2012, at 7:32 PM, "Eric Bourland" <e...@ebwebwork.com> wrote: > > Greetings. I have what is probably a very basic question, about which > I have done a lot of reading - I still need some help. > > > > I am trying to use the encrypt function to encrypt a credit card number. > > > > I am placing the key as a variable in application.cfc, thus: > > > > <cfset request.encryptionKey = "128-bit character string"> > > > > To encrypt the credit card number, I use this line in my insert statement: > > > > CreditCardNumber = <cfqueryparam cfsqltype="cf_sql_varchar" > value="#encrypt(form.CreditCardNumber,request.encryptionkey,"AES")#">, > > > > ColdFusion returns this error: An error occurred while trying to > encrypt or decrypt your input string: '' Can not decode string "(encryption key)".. > > > > How would you handle this? I simply want to: > > > > 1) Encrypt the credit card number that is placed in the database - so > that even if someone compromises the database, the data is encrypted > > 2) Decrypt the credit card number when it is displayed on a secure > administration page > > > > Should I not place the 128-bit key in application.cfc - but instead > use the generatesecretkey function? > > > > Thank you for any advice. > > > Eric > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:353052 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm