brsy
nah mang
- May 12, 2011
- 1,530
- 272
tHash is an md5 and sha1 alternative that can be used to take your users' security one step further. Here it is, just simply add it to your global.php.
How it works.
First, the user inputs what ever you want to secure, specifically a password. The $tHashr function MD5's whatever the user inputs, and $tDecoy is a random string that I suggest you change, which is a main factor in this hash. Then, $tSalt SHA1's both the $tDecoy and the $tHashr inputs. Finally, the "return substr($tSalt, 0, 17);" limits the string to 17 characters, which can be altered to your liking.
How it works.
First, the user inputs what ever you want to secure, specifically a password. The $tHashr function MD5's whatever the user inputs, and $tDecoy is a random string that I suggest you change, which is a main factor in this hash. Then, $tSalt SHA1's both the $tDecoy and the $tHashr inputs. Finally, the "return substr($tSalt, 0, 17);" limits the string to 17 characters, which can be altered to your liking.
PHP:
class tCore {
public function tHash($input) {
$tHashr = md5($input);
$tDecoy = md5('sD87scPq');
$tSalt = sha1($tHashr + $tDecoy);
return substr($tSalt, 0, 17);
}
}