Skip navigation
Currently Being Moderated

MySql AES_Encrypt values and Coldfusion Encrypt/Decrypt

Nov 18, 2013 6:16 PM

So, I'm having trouble figuring this out, and I haven't found an answer online.  Hoping someone here has tried something similar.


I'd like to figure out how to use the Coldfusion Encrypt function so that it generates the same binary value as MySql AES_ENCRYPT.  Similarly, how can I use Coldfusion Decrypt to decrypt values generated by AES_ENCRYPT?


I've tried:


Decrypt( QUERYCOLUMN, "AES", "hex")

Decrypt( toBase64(QUERYCOLUMN), thisKey.getKey(), "AES", "hex")

Decrypt( toString(toBase64(QUERYCOLUMN)), thisKey.getKey(), "AES", "hex")


Always returns empty string.



  • Currently Being Moderated
    Nov 19, 2013 11:59 AM   in reply to Digdug

    Since you are converting the binary value to base64 you should be specifying "base64" not "hex" as the last argument.  Also your key should be base64 encoded as well. Not promising it will work with those changes but I would start there.

    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points