note 66235 added to function.md5
| From: | coryostrudel at godcomplex dot com | Date: | Wed, 17 May 2006 12:45:52 +0000 |
| Subject: | note 66235 added to function.md5 | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-111492@lists.php.net to get a copy of this message | ||
If you are storing your passwords with and MD5 hash and are worried about collisions, an approach I
have used was to store two passwords for the user.
credentials
----------
userName
password
passwordChk
Where:
$input - users input password
$key - a site based key stored out of public folders
password = MD5($key.strrev($input))
passwordChk = MD5($input{0}.substr($input,(floor(strlen($input))/2),strlen))
This will stored the users password in the database as an MD5 hash of the string reversed plus a
site based key stored out of public folders.
It also stores a check value to check that the input is the true input and not a colliding value.
The check takes the first character appends a substring of the input taking the last half of the
input string and creates and MD5.
I think this is pretty secure. It takes a modified salt & pepper approach, and follows up with
a check on the original input to make sure it is not a colliding value, while also not storing the
original password in plain text.
----
Server IP: 64.71.164.2
Probable Submitter: 170.12.49.20
----
X-Spam-Status: No, hits=3.1 required=5.0 tests=DATE_MISSING,FROM_NO_LOWER
autolearn=no version=2.64
----
Manual Page -- http://www.php.net/manual/en/function.md5.php
Edit -- http://master.php.net/note/edit/66235
Del: integrated -- http://master.php.net/note/delete/66235/integrated
Del: useless -- http://master.php.net/note/delete/66235/useless
Del: bad code -- http://master.php.net/note/delete/66235/bad+code
Del: spam -- http://master.php.net/note/delete/66235/spam
Del: non-english -- http://master.php.net/note/delete/66235/non-english
Del: in docs -- http://master.php.net/note/delete/66235/in+docs
Del: other reasons-- http://master.php.net/note/delete/66235
Reject -- http://master.php.net/note/reject/66235
Search -- http://master.php.net/manage/user-notes.php