RE: Hash Issues

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Try doing the hash code after the password is posted

From: "Erbacher Karl" <erbacher@xxxxxxxxxxxx>
To: php-general@xxxxxxxxxxxxx
Subject: Hash Issues
Date: Thu, 24 Feb 2005 08:26:35 -0800
Received: from lists.php.net ([216.92.131.4]) by mc5-f20.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Fri, 25 Feb 2005 09:30:44 -0800
Received: from ([216.92.131.4:11652] helo=lists.php.net)by pb1.pair.com (ecelerity HEAD r(5124)) with SMTPid 8D/AB-51537-5C06F124 for <dbnm@xxxxxxxxxxx>; Fri, 25 Feb 2005 12:30:45 -0500
Received: (qmail 66774 invoked by uid 1010); 25 Feb 2005 16:28:10 -0000
Received: (qmail 48782 invoked by uid 1010); 25 Feb 2005 15:54:21 -0000
X-Message-Info: 6sSXyD95QpWP6+shjfuSKTd7f5bTEYxLS2AOsK0Gtko=
Return-Path: <php-general-return-209357-dbnm=hotmail.com@xxxxxxxxxxxxx>
X-Host-Fingerprint: 216.92.131.4 lists.php.net Mailing-List: contact php-general-help@xxxxxxxxxxxxx; run by ezmlm
Precedence: bulk
list-help: <mailto:php-general-help@xxxxxxxxxxxxx>
list-unsubscribe: <mailto:php-general-unsubscribe@xxxxxxxxxxxxx>
list-post: <mailto:php-general@xxxxxxxxxxxxx>
Delivered-To: mailing list php-general@xxxxxxxxxxxxx
Delivered-To: ezmlm-scan-php-general@xxxxxxxxxxxxx
Delivered-To: ezmlm-php-general@xxxxxxxxxxxxx
Lines: 22
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
X-RFC2646: Format=Flowed; Original
X-Posted-By: 68.234.190.142
X-OriginalArrivalTime: 25 Feb 2005 17:30:45.0014 (UTC) FILETIME=[BC9C7360:01C51B5F]


Hello,

I'm trying to hash passwords before saving them to a mySQL database but I am
having a problem. I created three seperate sample users with three different
passwords (password1, password2, password3). When I go back to look at the
table info in the database, it has saved the exact same hash value for all
three users. Any ideas why this might be happening?


The script is very straight forward.
        The form that collects the data:
        <input type='password' name='password'>
        $pass=bin2hex(mhash(MHASH_SHA1, $password));
        <input type='hidden' name='pass' value='$pass'>

The file that verifies the data and stores it to the database:
$pass=$_POST['pass'];
INSERT INTO table (username, password) VALUES ('$logname', '$pass');


Thanks,
Cat

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux