Welcome Guest, Not a member yet? Register   Sign In
Ion Auth - Lightweight Auth System based on Redux Auth 2

[eluser]Sinclair[/eluser]
About the password generation...

Code:
public function salt()
    {
        return substr(md5(uniqid(rand(), true)), 0, 10);
    }


    public function hash_password($password, $salt=false)
    {
        if (empty($password))
        {
            return FALSE;
        }

        if (FALSE && $salt)
        {
            return  sha1($password . $salt);
        }
        else
        {
            $salt = $this->salt();
            return  $salt . substr(sha1($salt . $password), 0, -10);
        }
    }

By default, what part of the code run? "return sha1($password . $salt);" or "return $salt . substr(sha1($salt . $password), 0, -10);" ?

I'am struggling to get the password generation running in a Database procedure whitout success until now.

Best Regards,


Messages In This Thread
Ion Auth - Lightweight Auth System based on Redux Auth 2 - by El Forum - 06-13-2010, 07:54 AM



Theme © iAndrew 2016 - Forum software by © MyBB