AES Encrypt problem
Posted: Mon Jul 06, 2009 4:54 am
I am trying to select the AES encryption of a string from mysql
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
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'];
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