I am trying to create a webpanel and a friend suggested that I encrypt the passwords of the users with BCRYPT for their security.
My problem when trying to login, the encrypted password that is saved in the database is different from the one that is sent in the SQL request.
For example, this is the main part of my code to validate the user's credentials:
14, ]; return password_hash ($ password, PASSWORD_BCRYPT, $ options); } ?>
In the event that the password stored in the database that was entered using the same function (passwordEncryptor) is "1234", that is "$ 2y $ 14 $ gyyo5OaMe4SeXIhRStbdjOnZZrb3IOdCoIOQlzPZj15MhGBHUjniq", because it is that at the time of authentication the query is:
SELECT * FROM pcd_users WHERE email = & # 39; firstname.lastname@example.org & # 39; AND password = & # 39; $ 2and $ 14 $ O6iOBsAyv0JqwGudQhKPB.f68nLthfoMlJUU8n8zRuXxFJubhe7CO & # 39;