4 ms·
> Every time a user creates an account or changes their password, the password should be hashed using a new random salt. Never reuse a salt. Why not? The salt
by crazygringo 14y ago
> Every time a user creates an account or changes their password, the password should be hashed using a new random salt. Never reuse a salt.
Why not? The salt is still unique to that user. What's the benefit to changing it?
- MichaelGG 14y agoThere's zero cost to changing it, and makes any previous work on computing hashes for that user useless.
- ars 14y agoI use the hashed password as input in order to create short lived hashes for other purposes. By changing the salt, you change the hashed password. So when the user changes their password it actually changes, and those other hashes change too. If you kept the salt the same then if the user changes the password back to what it was nothing actually changes.