#Need help with Compare Hash And Password error

12 messages Β· Page 1 of 1 (latest)

small epoch
#

Please help πŸ™

carmine leaf
#

your title alludes to you having an error, but you never discussed that error or what's happening at all

#

could you try to do so? πŸ™‚

small epoch
#

actually i am trying to compare my hashed password from the database with the parsed password from the user in the login handler but it fails for some reason even though both the hash and unhashed password from which the hash has been generated and saved are the same.

carmine leaf
#

could you give an example of a hash as printed out in the Login function and the password that you think matches?

small epoch
#

this is a hashed password for the word P@$$W0RD $2a$10$yqllVGoZJZ8nnEQqQmFJ3uop1VMZwJ7i25eiL66NzjIiAswqVFEyi

#

the former is from the user and the later is from the db

carmine leaf
#

ok, those do not match

#

that tells me the issue might be on the hash insertion side, or that you are simply mistaken on what you're trying

small epoch
#

alright thank you

carmine leaf
#

it looks like that hash is actually for the empty string

#

so yeah…it was calculated incorrectly when it was inserted into the database πŸ™‚