php - Single query for validating user with salt -
i have table 3 columns: email, pass, salt
when user logs in, email , pass - not salt. how can validate user single query?
this i'm trying (but flawed):
$query = "select users.salt users email='$email' , password='{hash_hmac('sha256', $password, users.salt)}'";
thank you!
you don't have users salt db @ point trying use create hash.
when using salt-based hash typically select user salt , password db (along other info might later need user id). , make hash comparison in application.
Comments
Post a Comment