Password Auth Edge Case: bcrypt Silently Truncates Passwords Longer Than 72 Bytes
Two long passphrases sharing the first 72 bytes produce identical bcrypt hashes.
Runs locally in browser
Free · No login
Independently Verified 2026-11-25
v4.1.0
Identifier: Password Auth Edge Case
Platform: Security
Common Root Causes:
- Two long passphrases sharing the first 72 bytes produce identical bcrypt hashes.
Interactive Diagnostic Checklist
Verified Solutions:
- Use Argon2id for new systems (no 72-byte cap) or pre-hash with HMAC-SHA256 before bcrypt.
Safe Diagnostic Command:
Verify password hashing algorithm configuration
Warning: Verify configuration changes in staging or with dry-run flags (e.g. nginx -t) before reloading production services.
Technical Explanation
Two long passphrases sharing the first 72 bytes produce identical bcrypt hashes. Recommended diagnostic: `Verify password hashing algorithm configuration`. Remediation: Use Argon2id for new systems (no 72-byte cap) or pre-hash with HMAC-SHA256 before bcrypt.
Worked Examples
- Run `Verify password hashing algorithm configuration` to verify root cause before applying the remediation.
Limitations & Assumptions
- Always verify configuration changes in staging or with dry-run flags (e.g. `nginx -t`) before reloading production services.
Source References & Verification
Resource ID: err-sec-bcrypt-72-byte-truncation · Independently verified: 2026-11-25