Argon2 hash generator and checker
Runs in your browserCreate Argon2id, Argon2i or Argon2d password hashes with memory, iterations and parallelism you choose, and check a password against a hash.
- Argon2 hash
- Time on this device
Recommended parameters
| Source | Memory | Passes | Parallelism |
|---|---|---|---|
| OWASP Password Storage Cheat Sheet (minimum) | 19 MiB (19456 KiB) | 2 | 1 |
| RFC 9106, first recommendation | 2 GiB | 1 | 4 |
| RFC 9106, second recommendation | 64 MiB | 3 | 4 |
| PHP password_hash(PASSWORD_ARGON2ID) | 64 MiB | 4 | 1 |
More memory makes attacks with graphics cards and ASICs expensive. Pick the highest memory your servers can spare per login, then raise the passes until a check takes about half a second at most. Argon2id is the variant to use for passwords; Argon2i and Argon2d exist for special cases.
Argon2id in common languages
$hash = password_hash($password, PASSWORD_ARGON2ID, ['memory_cost' => 19456, 'time_cost' => 2, 'threads' => 1]); password_verify($password, $hash);
from argon2 import PasswordHasher # pip install argon2-cffi ph = PasswordHasher(time_cost=2, memory_cost=19456, parallelism=1) h = ph.hash(password) ph.verify(h, password)
import argon2 from "argon2";
const hash = await argon2.hash(password, { type: argon2.argon2id, memoryCost: 19456, timeCost: 2, parallelism: 1 });
await argon2.verify(hash, password);# argon2 package; salt must be at least 8 bytes echo -n 'password' | argon2 "$(openssl rand -hex 8)" -id -t 2 -k 19456 -p 1 -e
Questions about the argon2 generator
Argon2id or bcrypt?
For new systems Argon2id: it is memory-hard, which makes cracking on graphics cards much more expensive. bcrypt is still acceptable and better supported in old stacks.
Why is the 2 GiB setting so slow here?
Your browser has to allocate and fill 2 GiB of memory. On a phone that can fail. It shows why the setting is meant for servers with plenty of memory.
Can an Argon2 hash be decrypted?
No. It is a one-way function. You can only check a guessed password against it.