Function session_salted_sha1
Make a salted SHA1 string, given a string and (possibly) a salt. PHP5 only (although it could be made to work on PHP4 (@see http://www.openldap.org/faq/data/cache/347.html). The algorithm used here is compatible with OpenLDAP so passwords generated through this function should be able to be migrated to OpenLDAP by using the part following the second '*', i.e. the '{SSHA}....' part.
If no salt is supplied we will generate a random one.
Package: awl\Utilities
Copyright: Catalyst IT Ltd, Morphoss Ltd http://www.morphoss.com/
License: GNU LGPL version 3 or later
Author: Andrew McMillan andrew@mcmillan.net.nz
Located at AWLUtilities.php
Copyright: Catalyst IT Ltd, Morphoss Ltd http://www.morphoss.com/
License: GNU LGPL version 3 or later
Author: Andrew McMillan andrew@mcmillan.net.nz
Located at AWLUtilities.php
string |
$instr |
The string to be salted and SHA1'd |
string |
$salt = "" |
Some salt to sprinkle into the string to be SHA1'd so we don't get the same PW always hashing to the same value. |
string
|
A *, the salt, a * and the SHA1 of the salted string, as in SALTSALTEDHASH |