Page 1 of 1

AES Encrypt problem

Posted: Mon Jul 06, 2009 4:54 am
by susrisha
I am trying to select the AES encryption of a string from mysql

Code: Select all

 
$query= "SELECT AES_ENCRYPT(  'hello', SecretKey ) as mykey
FROM  `aorsdklicense` WHERE devid='developertestdevid'"; 
 
$result= mysql_query($query);
$row = mysql_fetch_assoc($result);
$encstring = $row['mykey'];
 
 
if i directly echo the $encstring, it is giving me unreadable values. So i tried bin2hex function to make them readable.

There is another application which is giving AES encrption of the same string wiht the same secret key. But its unable to produce the same result.
Here is the comparison:
0ce74a52dd982363b1bba19c8b67cca4 =>68936403402915e2f95ce9430640c268

The one on the left is the encryption from my system and the one on the right is from the other system.
Could not make out anything of it. If it triggers anything to anyone.. please let me know :)

Re: AES Encrypt problem

Posted: Wed Jul 08, 2009 12:12 am
by susrisha
:banghead: for a while now.. anyone??

Re: AES Encrypt problem

Posted: Wed Jul 08, 2009 12:45 am
by requinix
MySQL uses 128-bit encryption. What strength is the "other application" using?

(No, you can't pass an argument or something to AES_ENCRYPT to make it use another bit depth.)