/ Published in: PHP
An attempt for a semi-random salt in a stored password. It's not stored in the database so I believe it would be harder to discover. Samples should be changed.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
/* the salt, in this case is determined by the second letter of the password. the string position can be changed in $strPass[x] and of course the salts can be changed to different values. standard disclaimers apply. not promised to work. take the code as-is. if you like, find errors, or use please let me know at luckygreentiger at gmail */ function hashPassword($strPass) { $value = $strPass[1]; $salt = "!"; } else { $salt = "#"; } $salt = "@"; } $salt = "$"; } $salt = "%"; } $strPass .= $salt; return $hash; }