About argon2 hash generator
Argon2id is a modern password-hashing function designed to resist cracking by GPUs. It lets you set how much memory, how many iterations and how much parallelism it uses.
The settings
- Memory: more memory makes parallel guessing more expensive.
- Iterations: how many passes are made over that memory.
- Parallelism: how many threads are used.
Picking values
Tune the numbers so a login takes a fraction of a second on your server. Follow the current recommendations from OWASP or your library as a starting point.
A worked example
A commonly recommended minimum for Argon2id is 19 MiB of memory, 2 iterations and 1 degree of parallelism. The result looks like $argon2id$v=19$m=19456,t=2,p=1$<salt>$<hash>, which stores the settings so it can be verified later.
Choosing between Argon2 and bcrypt
- Argon2id is the modern default and resists GPU attacks better.
- bcrypt is well supported everywhere and still acceptable.
- Whichever you choose, use a unique salt for each password, which both do automatically.
