Input any plain text, it bcrypt encrypted hash
Input any plain text, it bcrypt encrypted hash
Your bcrypt hash will appear here
Input hash value and plain text, check it right or not
Your Google AdSense ad will appear here
Bcrypt is specifically designed for password hashing with built-in salt generation and resistance to rainbow table attacks.
Choose cost factor from 4-16 rounds. Higher rounds increase security but require more computation time.
Generate secure bcrypt hashes in seconds. Fast, reliable, and easy to integrate into your workflow.
Quickly verify if a plain text password matches an existing bcrypt hash for authentication testing.
In software engineering and application security, password storage is one of the most critical responsibilities a developer undertakes. A single database breach exposing poorly hashed credentials can compromise user accounts across thousands of web platforms due to password reuse. Bcrypt is the battle-tested, industry-standard adaptive password hashing function engineered specifically to protect credentials against specialized hardware and offline brute-force cracking.
This architectural guide explains why fast cryptographic hashes (like SHA-256 or MD5) are fundamentally unsafe for passwords, dissects the inner workings of Bcrypt's Eksblowfish key schedule, provides latency benchmarks for selecting optimal cost factors, demonstrates production implementations, and solves the well-known 72-byte truncation limitation.
A widespread security vulnerability in web applications stems from a basic misunderstanding: assuming that because SHA-256 is cryptographically secure for file integrity, it must be secure for passwords. This assumption is dangerously false.
General-purpose hash algorithms (MD5, SHA-1, SHA-256, SHA-512) were engineered for maximum throughput. Storage controllers, network routers, and digital signature validators require algorithms that can process hundreds of megabytes per second with minimal CPU overhead. However, when applied to human-generated passwords, extreme execution speed empowers the attacker:
| Algorithm / Function | Category | Modern GPU Throughput (Hashcat / RTX 4090) | Time to Crack 8-Char Alphanumeric Password |
|---|---|---|---|
| MD5 | General-Purpose Hash | ~164 Billion hashes / second | Under 2 seconds |
| SHA-256 | General-Purpose Hash | ~28 Billion hashes / second | Under 8 seconds |
| SHA-512 | General-Purpose Hash | ~9.5 Billion hashes / second | Under 25 seconds |
| Bcrypt (Cost 10) | Key Derivation Function (KDF) | ~6,200 hashes / second | Several Weeks |
| Bcrypt (Cost 12) | Key Derivation Function (KDF) | ~1,550 hashes / second | Multiple Years |
A cryptographic salt prevents precomputed Rainbow Table attacks by ensuring two identical passwords produce different digests. However, a salt does nothing to slow down modern GPU or ASIC brute-force attacks. When an attacker has access to your leaked database, they compute SHA256(password + salt) at billions of attempts per second. True password security requires computational slowness (Key Stretching).
Introduced at USENIX in 1999 by cryptographers Niels Provos and David Mazières for OpenBSD, Bcrypt is founded upon Bruce Schneier's Blowfish symmetric cipher. What distinguishes Bcrypt from standard encryption is its Eksblowfish (Expensive Key Schedule Blowfish) routine:
"OrpheanBeholderScryDoubt" 64 times using Electronic Codebook (ECB) mode.$2b$12$e8eYQ9F9cKzG7pXbY7eZ3uO2aZ4fB8dC0eE2gG4iI6kK8mM0oO2qS
$2b$ → Algorithm revision identifier (the modern, secure standard).12$ → Cost factor parameter ($2^{12} = 4,096$ key schedule iterations).e8eYQ9F9cKzG7pXbY7eZ3u → 22-character Radix-64 encoded 128-bit cryptographic salt.O2aZ4fB8dC0eE2gG4iI6kK8mM0oO2qS → 31-character Radix-64 encoded 184-bit ciphertext digest.The core advantage of Bcrypt is its adaptive cost factor. As computing power increases according to Moore's Law, developers do not need to rewrite their authentication architecture—they simply increment the cost parameter:
Because bcrypt intentionally consumes CPU cycles, an unauthenticated attacker could flood your login endpoint with thousands of bogus authentication requests, saturating all server CPU cores. Always pair Bcrypt with strict login rate limiting (e.g., maximum 5 attempts per minute per IP address, backed by Redis or an API gateway).
A critical architectural detail often overlooked by software engineers is that Bcrypt silently truncates passwords at 72 bytes. If a user inputs a 90-character passphrase, every character past byte 72 is ignored by the Blowfish key schedule: "password123...[72 bytes]...AAA" produces the exact same hash as "password123...[72 bytes]...ZZZ".
The Architectural Fix (Pre-Hashing Pattern): To safely support passphrases of arbitrary length without truncation risk, pre-hash the password with a fast cryptographic digest or keyed HMAC before passing it into Bcrypt:
Modern programming languages include native, audited implementations of Bcrypt. Never attempt to implement cryptographic algorithms manually from scratch.
MD5 and SHA-256 are general-purpose hashes engineered for maximum speed. Modern GPUs can calculate over 25 billion SHA-256 hashes per second, making offline brute-force attacks trivially cheap. Bcrypt is an adaptive Key Derivation Function that is deliberately slow and memory-intensive, forcing attackers to spend millions of times more hardware power per guessed password.
A cost factor of 12 (4,096 rounds) is currently recommended for standard web applications. It targets an authentication latency of roughly 250 to 350 milliseconds on modern server CPUs, ensuring strong resistance against brute-force attacks without causing server CPU exhaustion.
Yes, Bcrypt has a strict architectural limit of 72 bytes due to its underlying Blowfish key schedule. Any characters beyond 72 bytes are silently ignored by the algorithm. To safely support longer passphrases, developers can pre-hash passwords with SHA-256 or HMAC before passing them to Bcrypt.
Bcrypt embeds the algorithm identifier, cost factor, and the 128-bit salt directly into the resulting modular crypt formatted string (e.g. $2b$12$[22-character salt][31-character digest]). Verification functions extract the salt automatically from the stored hash.