Requirements
1. aes_encrypt(): encrypted data can be decrypted using mysql's aes_decrypt() function
2. aes_decrypt(): It can decrypt data encrypted using mysql's aes_encrypt() function.
3. Initialization vector not used.
4. The two functions should produce same results as corresponding mysql functions.
I copied and pasted the encrypted data to run a mysql query and it returned Null. I notice that the mysql encrypted data has "0x" prefix, so I tried it as well and both return Null. Could you kindly take a look to see what I was missing?
This execution which gives "Null" is normal because aes_encrypt returns a binary string (and aes_decrypt uses the binary string as a parameter).
It is probably just a display option in your MySQL environment that makes the display in hexadecimal and not in binary form
Also to decode a string written in hexdecimal you have to complete with a call to UNHEX which will transform the hexadecimal string into a binary string