Password Hashing Best Practices
Password Hashing Best Practices
• Brute-force Resistance:
• ✅ Strong due to slow hashing and adaptable
cost
• 🚫 CPU only — not memory-intensive
scrypt Overview
• - Designed for password-based key derivation
• - Memory-hard: uses large memory buffers
• - Adjustable CPU, memory, and parallelization
parameters
• Brute-force Resistance:
• ✅ High — costly for attackers due to memory
requirements
• ✅ Good against GPU/ASIC attacks
PBKDF2 Overview
• - Part of RSA’s PKCS #5 standard
• - Used in many legacy systems
• - Adjustable iteration count
• - Fast on standard CPUs
• Brute-force Resistance:
• ⚠️Moderate — no memory hardness
• ⚠️Easier for attackers using GPUs
Comparison Table
• Feature | bcrypt | scrypt |
PBKDF2
• -------------------|--------------|------------------|------
--------
• Year Introduced | 1999 | 2009 |
2000
• Salt Support | Yes | Yes | Yes
• Memory-Hard | No | Yes | No
• Adjustable Cost | Yes (2^n) | Yes (CPU,
mem) | Yes (iter.)
Recommendation
• - For modern systems: Use scrypt or bcrypt
• - If memory-hardness needed: Prefer scrypt
• - PBKDF2: Still acceptable but weaker against
modern attacks
Conclusion
• - Choose algorithms based on threat model
• - Always use salt and high cost factors
• - Regularly review and update hashing policies
Questions
• Any questions or thoughts?