KDF work factors and migration
Cost is a policy choice
Password KDFs deliberately require computation and sometimes memory. Argon2id and scrypt use memory as well as computation; bcrypt has a cost setting and legacy input constraints; PBKDF2 repeatedly evaluates a pseudorandom function. Unlike the HKDF introduced previously, password KDFs are designed to handle low-entropy inputs at a deliberately higher cost.
Compare documented baselines
OWASP guidance observed on 2026-11-27 gives example minimums: Argon2id m=19456 KiB, t=2, p=1; scrypt N=131072, r=8, p=1; legacy bcrypt cost >=10 with attention to the usual 72-byte input limit; PBKDF2-HMAC-SHA256 >=600000 iterations for the specified FIPS-oriented context. These are source-specific starting points, not universal policy. The argon2-cffi 25.1.0 API defaults instead use 65536 KiB, 3 passes and 4 lanes. FIPS obligations require the appropriate validated implementation and policy, not merely an algorithm name.
Capacity example
If each verification reserves 64 MiB and 12 verifications run simultaneously, the KDF working memory alone is roughly 768 MiB. Add runtime and service overhead before choosing concurrency. Measure latency percentiles and memory on the actual deployment, including legitimate bursts and recovery flows; bound concurrency and input size. Do not lower cost silently under load.
Upgrade after successful authentication
Keep a bounded list of approved stored schemes and cost profiles. Verify using the existing recognized profile; only after success may the application derive a new verifier from the supplied password. For Argon2 records, check_needs_rehash(record) reports whether the configured parameters differ. Use an atomic replacement conditioned on the old record version so a concurrent reset cannot be overwritten. For inactive accounts use an approved reset campaign with a deadline. Never rehash a failed login or treat a stored digest as the original password.
Practice: migration review
Review the lab migration cases. A recognized old record, successful verification and unchanged record revision are necessary for the toy upgrade. A current profile needs no upgrade; an unknown scheme or invalid parameter range requires rejection and review. Document who approves profiles, the measured resource budget, rollout checkpoints, and how recovery avoids reinstating retired records.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
KDF work factors and migration — knowledge check
Apply password, certificate and key lifecycle principles to fictional scenarios.
What does Argon2id memory cost describe?
Twelve concurrent operations at 64 MiB require roughly what working memory?
When should a recognized old verifier be upgraded?
Which scheme needs attention to a common 72-byte legacy input limit?
Does the algorithm name PBKDF2 prove FIPS compliance?