Here is the code I am using to encrypt it
and the code, which is on a separate web page, to decrypt it.Code:if(!define('SALT')) define('SALT','n7g7b8necefAs5ecrEv3M72ra'); $pwd=$_POST['pass']; $ins="INSERT INTO accounts (FirstName, LastName, School, Email, PASS) VALUES ('$_POST[fname]', '$_POST[lname]', '$_POST[school]', '$_POST[email]', AES_ENCRYPT('$pwd','.salt'))"; mysql_query($ins, $con);
I am trying to print out the decrypted string to see if it works.Code:if(!define('SALT')) define('SALT','n7g7b8necefAs5ecrEv3M72ra'); $result = mysql_query("SELECT * FROM accounts"); while($row = mysql_fetch_array($result)) { $pass = $row['PASS']; $une = AES_DECRYPT('$pass', '.salt'); echo $une; }




Reply With Quote