Hash password on PHP
#1

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>
Reply
#2

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
Reply
#3

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)