Hashing passwords through website? - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Hashing passwords through website? (
/showthread.php?tid=247052)
Hashing passwords through website? -
JRISETH - 07.04.2011
Hello users of SA-MP forum,
I'm currently doing User Control Panel that is in connection with phpBB forums, and I need to hash passwords with the same unique hash as phpBB does. Now, my friend told me, that I can hash through website (ex
http://website.com?tohash=pass). So the question is, can I really? But if I can't, how could I hash passwords with phpBB unique hash?
phpBB hash=
PHP код:
function phpbb_hash($password)
{
$itoa64 = './0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';
$random_state = unique_id();
$random = '';
$count = 6;
if (($fh = @fopen('/dev/urandom', 'rb')))
{
$random = fread($fh, $count);
fclose($fh);
}
if (strlen($random) < $count)
{
$random = '';
for ($i = 0; $i < $count; $i += 16)
{
$random_state = md5(unique_id() . $random_state);
$random .= pack('H*', md5($random_state));
}
$random = substr($random, 0, $count);
}
$hash = _hash_crypt_private($password, _hash_gensalt_private($random, $itoa64), $itoa64);
if (strlen($hash) == 34)
{
return $hash;
}
return md5($password);
}
Thanks,
JRISETH.
Re: Hashing passwords through website? -
Mike Garber - 07.04.2011
I guess use the functions in a_http.inc and make a php file doing this, so it returns the hash value:
http://wiki.phpbb.com/Function.phpbb_hash