Password hashing parameters: Argon2id, bcrypt, scrypt & PBKDF2
The current OWASP-recommended settings for storing passwords, quoted from the source — plus a calculator that measures your own device to find the right PBKDF2 iteration count. If you run a service, this is the one decision that turns a breach from a catastrophe into a shrug.
OWASP's priority order: Argon2id → scrypt → bcrypt → PBKDF2. Use the strongest your platform supports; bcrypt and PBKDF2 are for legacy or FIPS-constrained systems.
Argon2id (first choice)
Any one row is acceptable — pick by how much memory your server can spare. Use the id variant.
| Memory (m) | Iterations (t) | Parallelism (p) |
|---|---|---|
| 47104 KiB (46 MiB) | 1 | 1 |
| 19456 KiB (19 MiB) | 2 | 1 |
| 12288 KiB (12 MiB) | 3 | 1 |
| 9216 KiB (9 MiB) | 4 | 1 |
| 7168 KiB (7 MiB) | 5 | 1 |
scrypt (second choice)
| N (cost) | r (block) | p (parallelism) |
|---|---|---|
| 2^17 (128 MiB) | 8 | 1 |
| 2^16 (64 MiB) | 8 | 2 |
| 2^15 (32 MiB) | 8 | 3 |
| 2^14 (16 MiB) | 8 | 5 |
| 2^13 (8 MiB) | 8 | 10 |
bcrypt (legacy)
Work factor (cost) of at least 10, as high as your login-latency budget allows. Maximum input length is 72 bytes in most implementations — pre-hash longer inputs. Use only where Argon2id and scrypt are unavailable.
PBKDF2 (FIPS / legacy)
| PRF | Iterations | Note |
|---|---|---|
| PBKDF2-HMAC-SHA256 | 600,000 | OWASP recommended |
| PBKDF2-HMAC-SHA512 | 220,000 | recommended |
| PBKDF2-HMAC-SHA1 | 1,400,000 | legacy only |
Calibrate PBKDF2 for your device
Runs PBKDF2-HMAC-SHA256 in your browser to find the iteration count that hits a target time on this hardware. Compare it against the 600,000 floor — never go lower. Runs entirely locally.