Decrypt not working
I'm saving data to a specific field in the database using the following code:
[GoodLuck] = <cfqueryparam cfsqltype="cf_sql_varchar" value="#trim(encrypt(trim(Form.Secret),variables.encKey,variables.algorithm,variables.encoding))#">
This works fine, but when I try to decrypt it using this code:
<cfset attributes.secret=decrypt(trim(GoodLuck),variables.encKey,variables.algorithm,variables.encoding)>
It fails with this message:
An error occurred while trying to encrypt or decrypt your input string: com.rsa.jsafe.crypto.dr: Could not perform unpadding: invalid pad byte..
Why is the decryption failing if I'm using the same key, algorithm, and encoding type that I use to encrypt it successfully?
TIA
