Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

One time salts and server password comparison

I've read that one of the more secure ways to authenticate a user is to use one time salts when hashing the password. What I don't get is:

If the client generates a new salt every session, won't the resulting salt+password hash be different every session? If so, how will the server be able to compare the sent password with it's stored password? Is there a way for servers to compare different hashes and still be able to discern that the same password was used?

(Disclaimer: I'm not trying to reinvent the wheel/write a login protocol (I know, I know: use SSL/TLS). I'm just curious as to the high level functioning of login protocols)

like image 380
Gorkamorka Avatar asked Jan 19 '26 14:01

Gorkamorka


1 Answers

You only need to generate the salt only once and may every time the password been changed.

The client needs not to store the salt anywhere or even been aware of that. The salt will be stored by the server - along with the hash.

Its recommended that you store the hash and the salt in two different databases..

like image 120
Prabath Siriwardena Avatar answered Jan 21 '26 08:01

Prabath Siriwardena



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!