Join our Newsletter — 33% off our NHI Course

bcrypt

bcrypt is a password hashing algorithm designed to be slow and computationally expensive. It uses a per-password salt and a configurable cost factor to increase the work required for each guess. That makes it more resistant to brute force attacks than fast general purpose hash functions.

What bcrypt Actually Does

bcrypt is a password hashing function, not a general-purpose cryptographic hash. Its core value is that it deliberately slows down verification, so each password guess costs more time and compute for an attacker. That design makes offline cracking far less efficient than with fast hashes like SHA-256 when passwords are stored incorrectly as raw hashes.

Two properties matter most: the built-in salt and the adjustable cost factor. The salt ensures identical passwords do not produce identical hashes, which blocks precomputed rainbow-table style attacks. The cost factor raises the work required to hash or verify a password, letting defenders increase resistance as hardware gets faster.

How bcrypt Protects Stored Passwords

bcrypt is mainly used for password storage, where the defender must assume the database, backup, or password file may eventually be exposed. In that setting, the algorithm’s purpose is to make stolen password hashes expensive to test at scale. The protection is strongest against bulk guessing after a breach, but it does not help if the password itself is weak or reused elsewhere.

The salt is essential because it makes each password hash unique even when users choose the same password. The cost factor is equally important because it changes the time-memory trade-off for attackers and gives security teams a way to tune the workload over time. The result is a password verifier that can be intentionally made slower without changing the password itself.

bcrypt Versus Faster Hashing Approaches

bcrypt is often discussed alongside modern password hashing schemes because many teams still confuse “hashing” with “secure hashing” in the password context. Fast hashes are excellent for integrity checks and data processing, but they are a poor choice for password storage because speed helps attackers far more than defenders once a hash is stolen. bcrypt was designed specifically to invert that advantage.

That said, bcrypt is not a universal answer for every secret. It is a password hashing algorithm, so it belongs where the input is a human-chosen password and the threat is offline guessing. For other secret-handling problems, different controls may be more appropriate, such as separate key management, secret storage, or stronger passwordless authentication patterns.

Choosing bcrypt in Practice

bcrypt is still a sound choice when you need a proven password hashing baseline and can manage its parameters correctly. The main operational decision is the cost factor: too low leaves hashes easier to crack, while too high can create unnecessary authentication latency and load. Teams also need to keep the implementation consistent so hashes are generated and verified correctly across systems.

Operationally, bcrypt should be treated as one layer in a broader authentication strategy, not as a substitute for good password policy, MFA, or breach response. If password storage is the problem, bcrypt helps reduce the damage from disclosure; if the problem is weak credentials, phishing, or account takeover, other controls matter just as much.

Standards & Framework Alignment

This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.

NIST SP 800-53 Rev 5, OWASP ASVS and CIS Controls v8 set the governance and control requirements practitioners need to meet.

Framework Control / Reference Relevance
NIST SP 800-53 Rev 5 IA-5 — Authenticator Management bcrypt is used to store and verify passwords as authenticators
IA-2 — Identification and Authentication (Organizational Users) bcrypt supports user authentication by protecting password verifiers
IA-8 — Identification and Authentication (Non-Organizational Users) bcrypt also protects passwords for external users and customer accounts
Recommendation — Use IA-5 to manage password hashing parameters, rotation, and verifier handling. Apply IA-2 to pair bcrypt with stronger user authentication controls. Use IA-8 to govern password-based access for external identities.
OWASP ASVS V6 — Authentication bcrypt is a password hashing mechanism used within application authentication
Recommendation — Require secure password storage under V6 and tune the hash cost appropriately.
CIS Controls v8 CIS-5 — Account Management bcrypt supports secure account credential storage in operational account controls
Recommendation — Implement CIS-5 to protect credential handling and account authentication flows.