-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Salt to user table #5
base: master
Are you sure you want to change the base?
Conversation
… and mask it with the env variable.
iirc, Argon2i already 'salts' the input, it is the first part of the string |
It does not seem so. If I look at the login handler, then it just hashes user input and compares it to the hash in database. If salt would be stored in the password hash, then it would have to extract it before hashing the user input. |
yes, but the hash function is from rust-actix-example/src/auth.rs Line 50 in 4b7c224
and https://bryant.github.io/argon2rs/argon2rs/fn.argon2i_simple.html (I didn't check how it works internally, so I might be wrong) |
Ahaa, yes argon2i_simple is the hashing function, but the salt there is only the server side secret salt (that is shared for all the passwords). Server side secret salt
Cons
Per password salt
Cons
Using server side secret salt and per password salt together gives best of both worlds. One con that will remain is that when database is compromised and server side secret is known, then it is relatively simple to crack easy passwords. |
Add salt column to user table and generate a random salt on user add. For password hashing combine the generated salt and env variable salt.
This adds extra protection against cases when database might be comprised. If salt is unique, then guessing one password does not give good hints for other passwords.