When you “salt” a password, it means you add random data to a password before hashing it.
How it works:
- A unique random salt is generated for each user.
- The salt is combined with the password (e.g.,
"password123" + "random_salt"
). - The result is hashed.
- The salt and the hash are stored in the database.
This way, even if two users choose "password123"
, their hashes will be different.