I have the following code with a userpassword contains a blow fish secret and the user password itself.
The hash is another (not the secret and the password!!) but i still got a true as result:
<?php
## password (secret + userpass)
$pass = 'PNvH5GFfUKktXWpydfAMXMYKayjEP3GzfJbaenmzuAHSTv7rQgW8t4ShEKpdcD5nek8eArGQyfz9XRx6ARBc897YVdetest';
## hash
$hash = '$2y$10$9VGEg7HamRVDILsFV5dvJu3l5.Psfk4g6N8.Jcn6/gMhoZIKDLAAm';
## verify
$check = password_verify($pass, $hash);
## check
if(true === $check) {
var_dump($check);
} else {
echo "false";
}
?>
I have read a lot and think it can be a problem of the length! The algo is limited to 72 chars. For more security, we have a login with a blow fish secret. While hashing, we chain blow fish + userpassword to one big password, then hash it. While login we chain blow fish and userpass again and verify. The result of this is a big password which is hashed in db.
password_hashwith thePASSWORD_BCRYPToption? As per php.net/manual/en/function.password-hash.php that will indeed truncate the password to 72 characters. Demo: 3v4l.org/Y2pTX . If you want very long passwords, I suggest using a different algorithm which doesn't have this issue.there is no info about the limit...there is - it's clearly mentioned in php.net/manual/en/…