Encryption for safety
Posted: Wed Oct 22, 2003 4:42 pm
At the start of every page I have this...
It continues todo a few more things...
I wondered what the best way of encryption would be and how would I slot it into that. Can I encrypt the username and password after the database check and then decrypt just before the query?
Code: Select all
//IF COOKIES PRESENT CHECK THE DB TO SEE IF THE USERNAME AND PASS ARE LEGIT
if(isset($_COOKIE['username']) && isset($_COOKIE['password']))
{$auth = mysql_fetch_object(mysql_query("SELECT uid, username, password, status FROM $UserDB.unz_users WHERE username = '" . $_COOKIE['username'] . "' AND password = '" . $_COOKIE['password'] . "'"));
//SET USER VARIABLES
$user_properties['username'] = $auth->username;
$user_properties['uid'] = $auth->uid;
$user_properties['status_id'] = $auth->status;}
$user_properties['last_visit'] = $_COOKIE['last_visit'];
//SET LAST VISIT
setcookie ("last_visit", "$time", time()+60*60*24*30,'/','.wuggawoo.co.uk', 0);I wondered what the best way of encryption would be and how would I slot it into that. Can I encrypt the username and password after the database check and then decrypt just before the query?