note 89563 added to function.hash

From: Date: Fri, 13 Mar 2009 17:39:04 +0000
Subject: note 89563 added to function.hash
Groups: php.notes 
Request: Send a blank email to php-notes+get-151844@lists.php.net to get a copy of this message
@Kevin. I tried your function, but I was able to get the same hash for different passwords. function doubleSalt($toHash,$username){ $password = str_split($toHash,strlen($toHash)/2); $hash = hash('whirlpool', $username.$password[0].'centerSalt'.$password[1]); return $hash; } One Example: echo doubleSalt('mypassword223','sunil'); echo "<br />"; echo doubleSalt('mypassword224','sunil'); OUTPUT: 96c29a984fb86e61c8cb8bf5584a5d7a79691f4 6361c079f38815abf180a9bc8e887dcefb556e1 bc8b3a771ff3da2a9841dea665bf2b7ad8f541 e09ed10e37a0 96c29a984fb86e61c8cb8bf5584a5d7a79691f4 6361c079f38815abf180a9bc8e887dcefb556e1 bc8b3a771ff3da2a9841dea665bf2b7ad8f541 e09ed10e37a0 ---- Server IP: 64.71.164.2 Probable Submitter: 64.131.231.51 ---- Manual Page -- http://www.php.net/manual/en/function.hash.php Edit -- https://master.php.net/note/edit/89563 Del: integrated -- https://master.php.net/note/delete/89563/integrated Del: useless -- https://master.php.net/note/delete/89563/useless Del: bad code -- https://master.php.net/note/delete/89563/bad+code Del: spam -- https://master.php.net/note/delete/89563/spam Del: non-english -- https://master.php.net/note/delete/89563/non-english Del: in docs -- https://master.php.net/note/delete/89563/in+docs Del: other reasons-- https://master.php.net/note/delete/89563 Reject -- https://master.php.net/note/reject/89563 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#151844) next »