This is how bcrypt should work. See wikipidea .
Bcrypt generates a random 128-bit salt during hashing. This salt becomes part of the hash, so we always get a different hash value for the same input string. Random salt is actually used to prevent brute force attacks.
The password matching process will not end due to different hash values. Try the following in tinker
$hash1 = bcrypt('secret') $hash2 = bcrypt('secret') Hash::check('secret', $hash1) Hash::check('secret', $hash2)
You should get true in both cases Hash::check .
Thus, even if the hash values ββare different, the password match will not be completed.
source share