Closed zikezhang closed 2 years ago
Hey @zikezhang, This is normal since it's using a salt that's randomized, If you take one of the examples you've provided and put them into the checkHash function they'll return true.
$hash = '$2y$10$AKxccUPJ8lWWqOfBlNpma.J3IXkQmsVs2WIdKBTCuUlEOhKVGmfk.';
echo $this->security->checkHash('Phalcon', $hash)
You can get more information about it here: https://docs.phalcon.io/5.0/en/encryption-security
If you're trying to put it into the database and then read it later you'll want to encrypt it and not hash it :) https://docs.phalcon.io/5.0/en/encryption-crypt
@LlamaDuckGoose Yes. Thank you. I have found that the PHP native function password_hash() also return result dynamically. https://www.php.net/manual/en/function.password-hash.php
Code:
Result is changed on every request :
I wanna save the hashed password in DB. But found that the hashed password is changed on every request.
Details
php --ri phalcon
) 5.0.0RC2php -v
) 8.1