> <cfif len(editUser.CreditCardNumber)>
> <cfparam name="form.decrypted" default="">
> <cfset theKey = GenerateSecretKey("AES", 256)>
> <cfset decrypted = decrypt(form.CreditCardNumber, theKey, "AES", "UU")>
> </cfif>

Since the only place where the "decrypted" variable is being set is
within the CFIF block, I'd check to ensure the
editUser.CreditCardNumber field wasn't blank as a first step.  If you
want it to default to a blank value if nothing is present in the
database, you'll need to move your CFPARAM tag above the CFIF block so
it's not contained within that logic and always gets a default value
to work with.

As an aside, you shouldn't be generating a new key just before you run
the decrypt() call.  You would need to use the same key that was used
with the encrypt() call when the number was first encrypted in order
to decrypt successfully.


-Justin

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
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:354577
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

Reply via email to