Welcome Guest, Not a member yet? Register   Sign In
random salt
#1

[eluser]trevor2[/eluser]
What is the preferred way to create a random salt? I looked at the php.net site and there are hundred different viewpoints all claiming supremacy.

For the moment I'm using considering the username as a salt, which is not random, but it is unique.
Code:
<?php
    $password = $_POST['password'];
    $salt = $_POST['username'];
    
    function saltshaker($salt, $password)
        {    
            $salt = "";
            $password = "";
            $hash = sha1($salt.$password);
            return $hash;
        }
?>


Messages In This Thread
random salt - by El Forum - 08-06-2009, 03:43 PM
random salt - by El Forum - 08-06-2009, 04:37 PM



Theme © iAndrew 2016 - Forum software by © MyBB