How to compare php password to sql that was entered with PASSWORD

Asked

Viewed 69 times

0

Enter the password with the PASSWORD argument in my example query.

INSERT INTO table_name (column1, column2, column3, ...)
VALUES (value1, PASSWORD(value2), value3, ...);

I want to know if you have to take the value of an input to know if it is the same, I already have the password in a saved $_SESSION I want to know how to transform the password of the input in this type of encryption and compare.

  • You should inform which version of PHP you are using as well as which cryptographic library you actually stored in your database (hash’s, playn-text, etc...).

  • Usually when creating a user (registration) the password entered by the user is used to create a hash and this hash is stored in the database... at each login the user enters the password the application then creates a new hash and makes the comparison with the stored hash. Hashs are never the same but the cryptographic library can tell if they were generated from the same value (same password).

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.