note 89563 deleted from function.hash by danbrown
| From: | danbrown@php.net | Date: | Sat, 14 Mar 2009 14:46:17 +0000 |
| Subject: | note 89563 deleted from function.hash by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-151888@lists.php.net to get a copy of this message | ||
Note Submitter: Sunil
----
@Kevin. I tried your function, but I was able to get the same hash for different passwords.
<?php
function doubleSalt($toHash,$username){
$password = str_split($toHash,strlen($toHash)/2);
$hash = hash('whirlpool', $username.$password[0].'centerSalt'.$password[1]);
return $hash;
}
?>
One Example:
<?php
echo doubleSalt('mypassword223','sunil');
echo "<br />";
echo doubleSalt('mypassword224','sunil');
?>
OUTPUT:
96c29a984fb86e61c8cb8bf5584a5d7a79691f4
6361c079f38815abf180a9bc8e887dcefb556e1
bc8b3a771ff3da2a9841dea665bf2b7ad8f541
e09ed10e37a0
96c29a984fb86e61c8cb8bf5584a5d7a79691f4
6361c079f38815abf180a9bc8e887dcefb556e1
bc8b3a771ff3da2a9841dea665bf2b7ad8f541
e09ed10e37a0