bcrypt
bcrypt is a method for scrambling passwords before they are stored so that the original password cannot be easily recovered. It is deliberately slow to compute, which makes it harder for attackers to guess passwords by trying many combinations. It also mixes in random data, called a salt, so that identical passwords do not produce identical stored values.
bcrypt is a password-hashing function designed by Niels Provos and David Mazières, based on the Blowfish cipher and presented at USENIX in 1999. It is a one-way, deliberately computationally expensive function that incorporates a per-password salt and a configurable cost (work) factor, allowing the computational effort to be increased over time as hardware improves; this design raises the cost of brute-force and dictionary attacks. bcrypt addresses secure storage of password credentials rather than authentication protocol flows or authorization decisions, and it is a hashing scheme, not an encryption scheme, the stored output is not intended to be reversed. Specific implementation details such as maximum input length handling and output encoding vary by library and are out of scope for this entry.
Why it matters
Password databases remain one of the highest-value targets in any breach, and how credentials are stored determines whether a database compromise becomes a catastrophic account takeover event or a contained incident. Storing passwords in plaintext, or with fast general-purpose hashes, allows an attacker who exfiltrates a credential store to recover large numbers of passwords through offline brute-force and dictionary attacks. bcrypt was designed specifically to raise the cost of these offline attacks by being deliberately slow to compute and by incorporating a per-password salt, so that identical passwords do not produce identical stored values and precomputed lookup tables become ineffective.
A key property that keeps bcrypt relevant is its configurable cost (work) factor, which lets operators increase the computational effort required per hash as hardware improves over time. This means a deployment can be tuned to remain expensive for attackers even years after initial rollout, rather than being fixed at a speed that becomes trivially cheap to attack. For IAM engineers and security architects responsible for credential storage, choosing and maintaining an appropriately costed password-hashing scheme is a foundational control, and bcrypt is one of the widely recommended options for this purpose.
It is important to keep bcrypt's scope in perspective: it protects credentials at rest in a store, but it does not authenticate users, make authorization decisions, or protect credentials in transit. It is a defense-in-depth measure that reduces the damage of a database compromise; it does not prevent the compromise itself, and it should be paired with other controls such as MFA and monitoring.
Who it's relevant to
Inside bcrypt
Common questions
Answers to the questions practitioners most commonly ask about bcrypt.
