This function will return the passed password, extended with a salt in front and onto the end of the password. This function uses md5 for both the salts and sha256 for the password. It will return a 83 characters long string.
<?php
/**
* PassSalt()
* Will return a password using salt
* Front Salt. Hashed Password . End Salt
* Returns a string, 83 characters long
* @param mixed $Fhash
* @param mixed $Ehash
* @param mixed $pass
* @return string
*/
function PassSalt($FSalt, $ESalt, $pass)
{
return sprintf('%s', substr(hash('md5', $FSalt), 0, 9).hash('sha256', trim($pass, ' ')).substr(hash('md5', $ESalt), 0, 10));
}
// Assign to a variable
$DB_PassWord = PassSalt('&*^jhu5i&$*^$%4', 'J5%*(#@jkd$bsajkh7', 'My_Secret_PassWord');
?>
Mail this!
- Comments (0)
- PingBacks (0)
- TrackBacks (0)


» Latest comments