NEW
A password hashing function based on Blowfish with salt and adaptive cost to slow brute-force attacks.
DESCRIPTION
bcrypt securely hashes passwords using a salt and a configurable cost factor to make hashing deliberately slow. Its adaptive nature allows raising the work factor as hardware improves, maintaining resistance to brute-force attacks. bcrypt outputs include the algorithm identifier, cost, salt, and hash, simplifying verification. While still widely used, modern guidance often prefers memory-hard alternatives like Argon2 for enhanced GPU/ASIC resistance. Proper implementation includes unique per-password salts and strong cost settings.
ALTERNATIVE DEFINITIONS
Wikipedia
bcrypt is a password hashing function designed by Niels Provos and David Mazières, based on the Blowfish cipher, and includes a work factor to make it adaptable.
Notes origin, Blowfish basis, and adaptive cost feature.
OpenBSD
The bcrypt password hashing algorithm incorporates a salt to protect against rainbow table attacks and a work factor to make brute-force attacks more difficult.
Focuses on salt and work factor rationale in system man page.
OWASP
Use a password hashing function like Argon2, PBKDF2, scrypt, or bcrypt with a work factor and a unique salt for each stored password.
Places bcrypt among recommended algorithms with implementation guidance.
RELATED TERMS
Password Hashing Salt Key Stretching Blowfish Work Factor Credential Storage Brute-Force Attack
COMPETING TERMS
Argon2 scrypt Password-Based Key Derivation Function 2
KNOWLEDGE AREAS
Data Security Data Privacy & Compliance Software Engineering
TARGET AUDIENCE
Software Developer Cybersecurity Engineer Security Architect Chief Information Security Officer Application Administrator
EXTERNAL SOURCES
- Wikipedia - Bcrypt
- IETF - Argon2 password hashing standard
- PyPI - Python bcrypt package docs
- Okta - Overview of password hashing
TOP QUESTIONS
Why use bcrypt for password storage?
bcrypt’s salt and adaptive cost make offline brute-force attacks slower and less feasible compared to simple hashes.
Category: Relevancy
How do I choose the bcrypt cost parameter?
Benchmark on your infrastructure to meet login latency budgets (e.g., 100–250 ms per hash) and revisit periodically as hardware improves.
Category: Requirements
Is bcrypt still recommended compared to Argon2?
bcrypt remains acceptable, but many standards prefer memory-hard Argon2 for stronger resistance to GPUs and ASICs.
Category: Opinion
What common mistakes occur with bcrypt?
Reusing salts, using too-low cost factors, and hashing passwords without a site-wide secret pepper are common mistakes.
Category: Mistakes
Can bcrypt prevent credential stuffing?
No. bcrypt protects at-rest passwords; credential stuffing exploits reused credentials. Use MFA, risk-based controls, and rate limiting.
Category: Misunderstanding
How should I migrate from PBKDF2 to bcrypt or Argon2?
Use rolling rehash: verify existing hashes, then rehash with the new algorithm on successful login, or perform a background migration where possible.
Category: Management
What is included in a bcrypt hash string?
It includes the identifier, cost, salt, and derived hash, enabling verification without external metadata.
Category: Example
Does bcrypt need a unique salt per user?
Yes. A unique salt per password prevents rainbow table attacks and reduces collision risk.
Category: Requirements
What is a hot topic around bcrypt today?
Raising cost factors responsibly and evaluating transitions to Argon2 are ongoing operational considerations.
Category: Topic