Welcome Guest, Not a member yet? Register   Sign In
Password hashing
#5

I've read the password_verify(). i can see the example there like this:
Code:
$hash = '$2y$07$BCryptRequires22Chrcte/VlQH0piJtjXl.0t1XkA8pw9dMXTpOq';

if (password_verify('rasmuslerdorf', $hash)) {
   echo 'Password is valid!';
} else {
   echo 'Invalid password.';
}

now I'm trying to login like this code: (but i don't know whats my problem that its not working!)
Code:
$username = $this->input->post('username');
$password = $this->input->post('password');
$password_h = password_hash($this->input->post('password'), PASSWORD_BCRYPT);

$access = $this->user->login_access(array(
    'USER_NAME'     =>    $username,
    'PASSWORD'         =>    password_verify($password, $password_h)
));

and my login_access() is:
Code:
function login_access($cond = array())
{
    return $this->db->get_where($this->tablename, $cond)->result();
}
Reply


Messages In This Thread
Password hashing - by ardavan - 08-12-2015, 07:35 AM
RE: Password hashing - by CroNiX - 08-12-2015, 07:51 AM
RE: Password hashing - by mariek - 08-12-2015, 08:25 AM
RE: Password hashing - by Narf - 08-12-2015, 09:26 AM
RE: Password hashing - by ardavan - 08-13-2015, 04:28 AM
RE: Password hashing - by pdthinh - 08-13-2015, 05:48 AM
RE: Password hashing - by ivantcholakov - 08-13-2015, 06:04 AM
RE: Password hashing - by ardavan - 08-13-2015, 07:11 AM
RE: Password hashing - by Narf - 08-13-2015, 07:15 AM
RE: Password hashing - by ardavan - 08-13-2015, 07:46 AM
RE: Password hashing - by Narf - 08-13-2015, 08:02 AM
RE: Password hashing - by ardavan - 08-22-2015, 09:56 PM
RE: Password hashing - by mwhitney - 08-24-2015, 07:28 AM



Theme © iAndrew 2016 - Forum software by © MyBB