A cryptographic salt is a unique, random value added to a password before it is hashed. The salt makes the stored hash different even when two people choose the same password. section 12.3.3
This matters if an attacker gets a password database. A rainbow table lets attackers look up precomputed hashes instead of hashing every guess. Those precomputed hashes do not match passwords hashed with unique salts, making that shortcut ineffective. section 12.3.3 section 14.2.4
The same salt must be available when the password is checked:
- At creation, generate a unique random salt, combine it with the password, and hash the combination. section 12.3.3
- Store the salt so it can be used again during password validation; do not store the original password. section 12.3.3
Same password, different hashes
Suppose two employees both choose “querty123.” With a different salt for each account, their stored hashes differ. An attacker looking at the hashes cannot use a matching hash to tell that the passwords are the same. section 12.3.3
|
User
|
Password
|
Salt
|
Hash
|
|
Alice
|
*******
|
3fA9Z!8b
|
b3c7e6a7f9f7d6dcb83662
|
|
Bob
|
*******
|
N@5l1p2Q
|
7a8d1fc24ce3aeb9daef12
|
|
Charlie
|
*******
|
R#e9X2*
|
ae92df11b91a49ed34fd9a
|
Compare the separate salt and hash columns for each account. The table illustrates what is stored without showing the passwords. section 12.3.3





