Search code examples
encryptioncoldfusionaesblowfish

Encryption Issues with ColdFusion


I'm trying to store some encrypted (short) information in a cookie. I'm generating a short string (around 64 chars), generating the key using generateSecretKey(), and attempting either AES or Blowfish encryption.

I've tried the default UUEncoding, Base64, and Hex using the parameters in the encode() and decode() functions.

With AES, I get the error

An error occurred while trying to encrypt or decrypt your input string: com.rsa.jsafe.crypto.dr: Could not perform unpadding: invalid pad byte..

With Blowfish, I get the error

An error occurred while trying to encrypt or decrypt your input string: Given final block not properly padded.

What am I doing wrong?


Solution

  • Due to time constraints, we ended up using cfmx_copat encryption.

    I apologize to both people who answered, as I never was able to experiment with their responses as fully as I would have liked.