Why do two people with the same password need different salts?

A different salt changes what gets hashed, even when two people choose the same password.

The example below compares the same password under shared and distinct salts.

Same password, different inputs

A password hashing scheme takes the password and a salt, a separate value chosen for that record. Real systems can draw salts from a cryptographic random source. The shared-salt setting shows what happens when two records use the same value. The service stores the salt and the resulting password verifier. During sign-in, the service uses the same password hashing scheme, the stored salt, and the entered password. It compares the new result with the stored verifier.

The classroom table uses preset labels to show the relationship. Ava and Ben share a fictional password. With the same salt R7 and the same settings, the process is deterministic and gives both accounts V12. Change Ben’s salt to L4 and his verifier becomes V74 in this example. The labels stand in for stored results from a dedicated password hashing scheme.

Distinct salts keep the checks separate

If two records use the same salt and settings, a calculation for a proposed password can apply to both. With different salts, a result computed with R7 applies only to Ava. Checking the same proposed password for Ben uses L4 in a separate calculation. The salt can be stored in the clear with its verifier. It changes the calculation for each record, while the password itself may still be easy to guess.

As Lesson 4.2 showed, a short list of plausible inputs can be easy to check. General-purpose SHA-256 quickly computes a fingerprint. A password hashing scheme uses a salt and adds deliberate work to each verification. In the next lesson you’ll see what that costs. See NIST’s authentication guidelines.

Check your understanding

Does Ava’s salt need to be secret? Does it make her common password harder to guess on its own?

Show the answer

The salt can be public and does not change how common her password is. It gives Ava’s record a different input to check. The password hashing scheme’s cost settings determine the work of one check.