Course contentsShow
← Security
Lesson 690 of 3,05215. Web Security - Authentication and SessionsFree lesson

Argon2: Modern Password Hashing Standard

Discover Argon2's configurable memory, time, and parallelism parameters for optimal security.

Argon2: Modern Password Hashing Standard

What you'll learn: How Argon2 gives you three powerful tuning knobs—memory, time, and parallelism—to maximize password security against modern hardware attacks.

Why Argon2 Is Different

While bcrypt and scrypt improved password hashing by making it computationally expensive, Argon2 takes defense to the next level. Winner of the 2015 Password Hashing Competition, Argon2 lets you configure three independent parameters to resist attacks from everything from GPUs to specialized ASICs.

The Three Configuration Parameters

Memory Cost (m)

Controls how much RAM the hashing requires (measured in kilobytes). High memory usage makes GPU and ASIC attacks impractical, since these devices typically have limited memory per core. Think of this like forcing an attacker to rent an entire warehouse instead of just a small storage unit.

Time Cost (t)

Determines how many iterations or passes the algorithm performs. More iterations = slower hashing = harder to crack. This works like bcrypt's work factor but can be tuned independently from memory.

Parallelism (p)

Sets how many parallel threads can compute the hash simultaneously. This helps legitimate servers (which have multiple cores) hash passwords reasonably fast while limiting attackers' ability to massively parallelize cracking operations.

Balancing Security and Performance

Typical recommendations start around m=65536 (64 MB), t=3 iterations, p=4 threads. You increase these based on your server's capabilities and acceptable login delay. The beauty is flexibility: if attackers develop new hardware, you adjust parameters without changing algorithms.

Argon2 Variants

Argon2 comes in three flavors: Argon2d (data-dependent, faster but vulnerable to side-channel attacks), Argon2i (data-independent, safer against side-channels), and Argon2id (hybrid, recommended for password hashing).

Key Takeaway: Argon2's configurable memory, time, and parallelism parameters let you create a custom defense tailored to both your hardware capabilities and the evolving threat landscape—making it the gold standard for password storage today.