password_verify () PHP 5.5.12 Not working

1

I'm having problems with password_verify (). A few days ago, the same password and hash worked perfectly. Today, password_verify returns false, but I know the password is correct.

$senhaC = '$2y$10$15rGMwy5CEHaLrNzEEwaZ.G2.VbhumhXtcORad0cC7W6SkjuZ.XJG';
$senha  = 'tgipassword';

var_dump(password_get_info($senhaC));

if (password_verify($senha, $senhaC)) {
    echo 'Ok';
}
else {
    echo 'No Ok';
}

var_dump returns:

array (size=3)
  'algo' => int 1
  'algoName' => string 'bcrypt' (length=6)
  'options' => 
    array (size=1)
      'cost' => int 10

When it was created and saved in the database it was used:

$options = [
    'cost' => 10
]; 
$senhaC = password_hash('tgipassword', PASSWORD_DEFAULT, $options); 

I do a search in the bank it returns me this hash but in the verification with the correct password returns false, the strange thing is that I used this password a few days ago verifying how true and I know that the password was not changed. >     

asked by anonymous 15.01.2018 / 19:49

0 answers