How can I compare my PHPASS-hashed stored password to my incoming POST data?
- by Ygam
Here's a better example, just a simple checking..stored value in database has password: fafa (hashed with phpass in registration) and username: fafa; i am using the phpass password hashing framework
public function demoHash($data) //$data is the post data named password
{
$hash =new PasswordHash(8, false);
$query = ORM::factory('user');
$result = $query
->select('username, password')
->where('username', 'fafa')
->find();
$hashed = $hash->HashPassword($data);
$check = $hash->CheckPassword($hashed, $result->password);
echo $result->username . "<br/>";
echo $result->password . "<br/>";
return $check;
}
check is returning false