Forum Moderators: open

Message Too Old, No Replies

Connecting to Password (MD5 and SALT)

         

matthewamzn

3:49 pm on Mar 15, 2006 (gmt 0)

10+ Year Member



I'm trying to integrate a script I'm using into a forum site. The problem is my forum uses md5 with salt to protect the passwords.

For the new script to get the user information I'm using this query:

$query = mysql_query("SELECT * FROM forums_users WHERE email='$email'");
$user = mysql_fetch_assoc($query);
$input_pw = md5(md5($password).md5($user['salt']));
if($input_pw == $user['password'])
{ $user_info = $user;}

But I get stuck with this statement. I think there's something I'm doing wrong here:

if(mysql_num_rows(mysql_query("SELECT * FROM forums_users WHERE email='$email' AND password='$input_pw'")) == 0) {
$is_error = "yes";
$error = "The login information you have provided is invalid.";}

jatar_k

10:19 pm on Mar 23, 2006 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



$input_pw = md5(md5($password).md5($user['salt']));

are you sure that is the same way the software is creating the md5 of the password?