Answer the question
In order to leave comments, you need to log in
Why store salt in a database and how to use it?
In the database, I store hashes created using bcrypt
(Node.js)
Hashing occurs using a specific value salt
.
I meet in code examples that people store in the database, in addition to the hash itself, the salt value. What for?
Well, let's say an attacker got a database with hashes, picked up a salt, and started cracking passwords (do I understand the process correctly?). How will storing the value and changing the salt help me? After all, if I change the salt, the hash will also become different, and my entire hash database will become invalid.
Answer the question
In order to leave comments, you need to log in
Depending on the format in which your function returns the hash, if it already contains a salt, then storing it separately does not make any sense. If we allow you to use this package to calculate and verify the hash, then the hash received there already contains a salt.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question