MySQL Forums
Forum List  »  Newbie

Re: Using AES_DECRYPT displays NULL
Posted by: Rick James
Date: July 31, 2014 11:02PM

You were missing an UNHEX():
mysql> SELECT CAST(AES_DECRYPT(UNHEX('e570ca3c339299069727ba6d33fec255'), 'y') AS CHAR);
+---------------------------------------------------------------------------+
| CAST(AES_DECRYPT(UNHEX('e570ca3c339299069727ba6d33fec255'), 'y') AS CHAR) |
+---------------------------------------------------------------------------+
| x                                                                         |
+---------------------------------------------------------------------------+
1 row in set (0.00 sec)

And I don't know why you added the CAST():
mysql> SELECT AES_DECRYPT(UNHEX('e570ca3c339299069727ba6d33fec255'), 'y');
+-------------------------------------------------------------+
| AES_DECRYPT(UNHEX('e570ca3c339299069727ba6d33fec255'), 'y') |
+-------------------------------------------------------------+
| x                                                           |
+-------------------------------------------------------------+
1 row in set (0.00 sec)

Options: ReplyQuote


Subject
Written By
Posted
Re: Using AES_DECRYPT displays NULL
July 31, 2014 11:02PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.