So I've done a bunch of research on how to better secure my site through the use of a hashed password along with it being salted (random). I've created a salted-hash and added it to my user password database. I can create cookie, have the program read that cookie with the salted hash, compare to the database and give the appropriate access.
But my question is, how do I give access if I don't already have the salt key?
Normally, I'd have the user enter the password, hash it and do a basic "if hashedpassword = databasepassword" return true, else false. This way the hash is never returned.
With a salted hash, the first x characters stored is the salt. It seems like I'd have to call the database have it return the salt, then regenerate the password to do a compare. This way I have to return a password hash/salt from the DB. Is there a better way to do this?
I hope that makes sense.
Thanks.