Devil089
Devil089

Reputation: 65

MySQL AES_DECRYPT returns NULL

I have a MySQL issue.

I want to decrypt a blob with AES_DECRYPT and try it in phpMyAdmin with a query

SELECT key_value ,AES_DECRYPT(key_value,'crypt_key')FROM `ps_keymanager` WHERE `id_keymanager`=1497

the query works, but it returned me NULL and not the decrypted value :(

Upvotes: 0

Views: 3028

Answers (1)

Seda
Seda

Reputation: 243

Try casting

   SELECT key_value , CAST (AES_DECRYPT(key_value,'crypt_key')AS CHAR(50))
FROM `ps_keymanager` WHERE `id_keymanager`=1497

Upvotes: 1

Related Questions