note 54335 added to function.md5

From: Date: Thu, 30 Jun 2005 18:29:06 +0000
Subject: note 54335 added to function.md5
Groups: php.notes 
Request: Send a blank email to php-notes+get-91217@lists.php.net to get a copy of this message
check out these functions to fake a sha1 entry using md5. Very, very secure if attackers get your password file... also, it encrypts differently for the same string, every time function pw_encode($password) { for ($i = 1; $i <= 8; $i++) $seed .= substr('0123456789abcdef', rand(0,15), 1); return md5($seed.$password).$seed; } function pw_check($password,$stored_value) { $stored_seed = substr($stored_value,32,8); if (md5($stored_seed.$password).$stored_seed == $stored_value) return TRUE; else return FALSE; } ---- Manual Page -- http://www.php.net/manual/en/function.md5.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+54335 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+54335&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+54335&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+54335&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+54335&report=yes&reason=useless Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+54335&report=yes&reason=non-english Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+54335&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+54335&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#91217) next »