MySQL Encryption

A

Anonymous

Guest
hi there,


I found this on another site. I hope it helps


Code:
   $key = 'password';
   $string = ' string to be encrypted ';
   
   echo $encrypted = base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_256, md5($key), $string, MCRYPT_MODE_CBC, md5(md5($key))));
   
   echo $decrypted = rtrim(mcrypt_decrypt(MCRYPT_RIJNDAEL_256, md5($key), base64_decode($encrypted), MCRYPT_MODE_CBC, md5(md5($key))), "\0");
 
Back
Top