SA-MP Forums Archive
Hash password on PHP - 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)
+--- Thread: Hash password on PHP (/showthread.php?tid=576037)



Hash password on PHP - Sensation - 31.05.2015

Hey guys I want to make a password hash on php page. How can I make this. Please help me..

Codes:

Hash Function
Код:
<php?
function udb_hash($buf) { 
    $length=strlen($buf); 
    $s1 = 1; 
    $s2 = 0; 
    for($n=0; $n<$length; $n++) 
    { 
       $s1 = ($s1 + ord($buf[$n])) % 65521; 
       $s2 = ($s2 + $s1) % 65521; 
    } 
    return ($s2 << 16) + $s1;
?>

index.php
Код:
<html>
<body>
<form action="hash.php" method="post">
Text for Hash: <input type="text" name="name"><br>
<input type="submit">
</form>

</body>
</html>

hash.php
Код:
<html>
<body>

Hash: <?php echo $_POST["name"]; ?>

</body>
</html>



Re: Hash password on PHP - Vince - 31.05.2015

udb_hash, despite the name given by DracoBlue, is NOT a hashing algorithm. This is a checksum algorithm better known as Adler32. It is incredibly insecure, can be cracked in seconds and is thus not suitable for passwords at all.

Use a proper algorithm like Whirlpool or Sha512 and add a salt. http://php.net/manual/en/function.hash.php


Re: Hash password on PHP - Sensation - 31.05.2015

Quote:
Originally Posted by Vince
Посмотреть сообщение
udb_hash, despite the name given by DracoBlue, is NOT a hashing algorithm. This is a checksum algorithm better known as Adler32. It is incredibly insecure, can be cracked in seconds and is thus not suitable for passwords at all.

Use a proper algorithm like Whirlpool or Sha512 and add a salt. http://php.net/manual/en/function.hash.php
My gamemode hashing by udb_hash so I want to hash the passwords by udb_hash on php page. So how can i make this php page with this codes for hash the passwords