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

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -