SHA-256 vs Argon2id for passwords

SHA-256 is fast, so a thief with the password table can test 10,000 guesses/s on one core. Argon2id with 19 MB and 25 ms per hash cuts that to under 100 guesses/s. Logins still finish under 500 ms on a 2 vCPU auth box.

Play the level

One data key seals many recordsTap or press Space to change how records get a key

Envelope keys · < 1 key service calls/s · limit 10,000/s

A token bucket on guessesDrag or use arrow keys to change the limit

Limit 1/s per account · all codes tried in 12 days

Case 1

Users sign in at 20 logins/s, then 60 logins/s from 0:10, on one 2 vCPU box. A thief has the password table. One attacker core may test at most 100 guesses/s.

Case 1
Measure Goal SHA-256 with a salt Argon2id, 19 MB, 25 ms
Throughput (Guesses) under 100 req/s 10,000 req/s Fail 41 req/s Pass
p99 latency (Logins) under 500 ms 71 ms Pass 192 ms Pass
Availability (Logins) at least 99.9% 100% Pass 100% Pass
Monthly cost 34 USD/mo 34 USD/mo
Error rate 0% 0%
HTTP/2HTTP/2SQLHTTP/2UsersUsersLoad balanc…0.25 vCPU · 0.5 GBAPI server2 vCPU · 4 GBWorker1 vCPU · 2 GBPostgres1 vCPU · 2 GB
HTTP/2HTTP/2SQLHTTP/2UsersUsersLoad bala…API serverWorkerPostgres
SHA-256 with a salt: misses a goal
HTTP/2HTTP/2SQLHTTP/2UsersUsersLoad balanc…0.25 vCPU · 0.5 GBAPI server2 vCPU · 4 GBWorker1 vCPU · 2 GBPostgres1 vCPU · 2 GB
HTTP/2HTTP/2SQLHTTP/2UsersUsersLoad bala…API serverWorkerPostgres
Argon2id, 19 MB, 25 ms: meets the goals