Argon2
What Is Argon2?
Argon2 is a password-hashing algorithm that turns a password into a one-way value for safe storage and later verification. It uses memory as well as processing time, making large-scale password guessing more costly. It won the Password Hashing Competition in 2015 and is specified in RFC 9106. Hashing differs from encryption because an application verifies a password without decrypting the stored value.
How Argon2 Password Hashing Works
A login system stores a verifier, not the original password.
- The application receives the password over a protected connection.
- It creates a unique random salt for that password.
- Argon2 runs using chosen memory, time, and parallelism settings.
- The app stores the encoded hash, salt, version, and settings.
- On login, it reruns verification rather than decrypting a password.
Argon2id vs Argon2i vs Argon2d
Argon2id is generally the preferred choice for new password storage.
| Variant | Memory access | Best use |
|---|---|---|
| Argon2id | Hybrid approach | Password hashing, with balanced attack resistance |
| Argon2i | Data-independent | Cases needing stronger side-channel resistance |
| Argon2d | Data-dependent | Specialized uses, not typical web logins |
Why Argon2 Is Used for Password Storage
Its design gives developers useful defenses against offline password cracking.
- Memory-hard work makes highly parallel cracking hardware less efficient.
- Unique salts prevent one precomputed hash list from serving every account.
- Cost settings can increase as infrastructure improves.
- Encoded parameters support gradual rehashing after a successful login.
- It suits consumer logins, administrator accounts, and password-derived keys.
Practical Limits of Argon2
Strong hashing is only one part of authentication security.
- Higher memory settings consume server resources and add login delay.
- Unbounded concurrent hashing can create denial-of-service risk.
- It cannot make weak passwords strong before a breach.
- It does not replace MFA, rate limiting, TLS, or secure sessions.
Argon2 vs bcrypt, PBKDF2, and SHA-256
Argon2id is usually better for new password storage because it is deliberately memory-hard.
| Option | Memory-hard | Use for new passwords |
|---|---|---|
| Argon2id | Yes | Preferred |
| bcrypt | No | Acceptable legacy choice |
| PBKDF2 | No | Often retained for compatibility |
| SHA-256 | No | Not suitable alone |
Safe Argon2 Implementation Practices
Use established libraries and test settings under realistic load.
- Choose Argon2id and library-generated unique salts.
- Benchmark memory and time costs on production-like systems.
- Cap concurrent hash operations.
- Store versioned encoded hashes and rehash after successful login when settings change.
- Never create a custom cryptographic implementation.
Using Argon2 in Apps Built With Emergent
Teams using an AI web app builder should state credential security requirements early, including a maintained Argon2 library, protected secrets, and login tests. Argon2 belongs in the wider process of app design and development for any authenticated web or mobile product. Build safer login systems with Emergent.
on Emergent today

