Argon2id for passwords: tune memory and time costs safely
Understand Argon2id, RFC 9106 profiles, resource trade-offs, and how to benchmark and roll out settings without treating examples as universal values.
Argon2id for passwords: tune memory and time costs safely
Argon2id is a memory-hard function for password hashing and key derivation. Its memory and time costs make large-scale offline guessing more expensive, but it does not rescue weak passwords. Use a unique salt and tune parameters for the actual verifier environment.
What the parameters control
Argon2 has Argon2d, Argon2i, and Argon2id variants. Argon2id combines data-independent and data-dependent memory access. RFC 9106 recommends it when the choice is uncertain or side-channel attacks are a concern, and specifies version 1.3. The main parameters are memory m (KiB), passes t, and parallelism p; memory and time must fit both security goals and server capacity.
RFC 9106 profiles are starting points
The RFC's first recommended profile is Argon2id t=1, p=4, memory 2 GiB, 128-bit salt, and 256-bit tag. Its memory-constrained profile is t=3, p=4, 64 MiB, with the same salt and tag lengths. RFC 9106 is an IRTF Informational RFC, not a universal production mandate. Measure on production-like hardware, including peak concurrent logins and resets, and choose settings the service can sustain.
Safe deployment
Use a maintained library's password-hashing API; do not implement the algorithm yourself. Store the variant/version, salt, m, t, p, and output with each verifier record. After successful verification, rehash with current settings when an old record needs upgrading. Bound login attempts and concurrency because Argon2 intentionally consumes resources. NIST SP 800-63B-4 requires a suitable salted scheme and cost factor for centrally verified passwords, but does not set one Argon2 profile for every service. Reassess settings as hardware and load change.
Sources
[RFC 9106: Argon2 Memory-Hard Function](https://www.rfc-editor.org/rfc/rfc9106.html)
[NIST SP 800-63B-4: Authenticator and Verifier Requirements](https://pages.nist.gov/800-63-4/sp800-63b/authenticators/)
[NIST SP 800-63B-4: Strength of Passwords](https://pages.nist.gov/800-63-4/sp800-63b/passwords/)