comparison Security & reliability
Password hashing salts and work factors
Salts determine whether a password-hash calculation can be reused across accounts. Work factors determine the resources each calculation requires. Neither makes a predictable password less predictable.
What it means
A unique salt makes the same password guess require a separate hash calculation for each distinct salt. A work factor changes how much each calculation costs. If someone obtains a copy of stored password hashes, the distinction matters: a calculation can be expensive yet reusable, or cheap but necessary for every salt.
A salt is an additional input to password hashing. To verify a password, the verifier uses the submitted password, the stored salt, and the relevant settings to derive a value to compare with the stored hash. This is a comparison, not decryption: the verifier does not recover the original password from the record.
Try it
Simulation. Start with 10 accounts, the same 100 candidate guesses for every account, a stipulated cost of 5 milliseconds (ms) per hash, and scenario evidence set to provided. No actual passwords or hashes are needed. Change only Salts from unique to shared. Look first at the number of salt groups, then at the number of hashes. Next, keep the shared salt and raise the cost from 5 to 10 ms. Which number stays the same this time?
Password hashing salts and work factors
Explain how unique salt and costly verification affect offline compromise economics
Distinct salt groups require separate candidate hash work; cost multiplies modeled attempts.
Grouping and work
- Account count used10
- Salt groupingunique
- Distinct salt groups10
- Guesses per group100
- Hash count1000
- Stipulated cost per hash5 ms
- Total serial cost5000 ms
All counts are abstract defensive arithmetic with synthetic inputs. Serial cost is not measured elapsed time, and the fixture does not estimate password strength.
Evaluated inputs
- Required scenario evidence
- provided
- Salts
- unique
- Accounts with same candidate password
- 10 count
- Candidate guesses
- 100 count
- Stipulated cost per hash
- 5 ms
Abstract defensive work counts only; no password recovery, wordlists, target hashes, algorithms, cracking code or real performance estimates.
About this model
The controls set only a local, bounded scenario. The computed branch is not a verdict about a live system. Inputs listed as not evaluated did not participate in this branch after validation.
Reset restores the original inputs. It does not change the open or closed state of help or FAQ answers.
| Salts across 10 accounts | Salt groups | Cost per hash | Hashes for 100 guesses | Total serial cost |
|---|---|---|---|---|
| Unique | 10 | 5 ms | 1,000 | 5,000 ms |
| Shared | 1 | 5 ms | 100 | 500 ms |
| Shared | 1 | 10 ms | 100 | 1,000 ms |
The first change reduces the number of calculations. The second makes each calculation cost more without adding a single hash. The milliseconds are added up as if the calculations happened one after another; they are not measured elapsed time. Reset restores the first row and the original inputs.
Why the salt group matters
Consider just one of the 100 guesses. With all other hashing settings held equal, a result calculated for that guess with one salt is not a calculation for another salt. Ten distinct salts therefore mean ten calculations for that one guess. Repeat that reasoning across all 100 guesses and the count is 10 × 100 = 1,000 hashes.
With a shared salt, there are still ten accounts. What changes is that a calculation for one guess can serve every record in the group. The simulation counts it once, not ten times. In this case the account count is still a required input, but the model does not use it as a multiplier. In either case, the result counts hash work, not successful guesses.
The model also distinguishes unknown work from zero work. Set Required scenario evidence to missing with otherwise valid inputs and there is no group count, hash count, or serial cost. An omitted or fractional account count is a different problem: the input is invalid. Neither case justifies displaying an earlier total as the current result.
With just one account, the shared and unique choices both produce one group and the same count of hashes in this model. The distinction matters when comparing work across multiple records; it does not make one verification costlier merely because the salt is called unique. Keep group count separate from the chosen cost per calculation.
In practice
When reviewing password storage, look for two separate pieces of information. First, how does the verifier choose salts? NIST SP 800-63B-4 calls for storing the salt with the hash and choosing salts to minimize collisions. That is not a promise that collisions are impossible. The simulation's unique setting assumes the salts in the example are all different.
Second, what resources does one verification require? For example, RFC 9106 distinguishes a memory setting, expressed in KiB, from an iteration count that specifies passes. Neither is a duration in milliseconds. The simulation takes a cost as an input; it does not calculate one from a verifier's settings. If the deployed version or settings are unknown, stop there rather than using the example to justify a change to a live service or its stored records.
Keep password predictability separate from both questions. A unique salt does not add uncertainty to the user's choice of password, and a higher work factor does not make a likely guess less likely to be right. Use salts to reason about which calculations can be reused and cost settings to reason about the work of one verification. Neither tells you how many guesses a particular password would withstand.
Frequently asked questions
Editorial questions based on the listed sources and explicitly labeled local examples.
Should salts be kept secret?
Salts are not secret keys. NIST requires storing the salt with the password hash and choosing salts to minimize collisions. A separately protected secret used in an additional keyed operation is a different mechanism, often called a pepper.
Does salt prevent guessing?
No. A salt changes the hash input so precomputed work is less reusable across distinct salts; it does not make an individual password impossible to guess.
Why use a work factor?
It determines the computational or memory resources required for a verification. NIST’s guidance discusses costly password hashing; the Argon2 specification defines distinct memory, iteration and parallelism parameters. Those parameters are not themselves a measured duration.
Is the timing a benchmark?
No. Per-guess costs are supplied synthetic parameters. Real costs depend on the exact algorithm parameters, implementation, hardware and measurement conditions.
Sources & model boundaries
Primary references used for this explanation. The interactive example is an educational model, not a live check.
- NIST SP 800-63B-4
Section 3.1.1.2 (password verifiers). Salted costly password hashing reduces offline-guessing risk. The salt is stored with the hash; a separately protected secret for an additional keyed operation is a different mechanism.
Checked .
- RFC 9106: Argon2 Memory-Hard Function for Password Hashing and Proof-of-Work Applications
3.1 (inputs and parameters). Argon2 defines memory, iteration and parallelism parameters; memory is in KiB and rounded to a multiple of 4p blocks.
Checked .