MySQL Encryption

Security issues related to php and mysql usage. How to make your code secure? Security measures and configurations? It's all in here!

Moderators: egami, macek, gesf

Post Reply
User avatar
L33R
New php-forum User
New php-forum User
Posts: 143
Joined: Fri Dec 30, 2011 4:27 am
Location: Liverpool

Sat Jan 21, 2012 12:34 pm

hi there,


I found this on another site. I hope it helps

Code: Select all

   $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");


Post Reply
  • Information
  • Who is online

    Users browsing this forum: No registered users and 1 guest