Why Do Modern Systems Use Bcrypt for Passwords?
Standard hashes like MD5 or SHA-256 are designed to be fast, enabling attackers to test billions of guesses per second on modern GPUs. Bcrypt is deliberately slow and includes an adaptive cost factor (rounds). Each increment doubles computation time, neutralizing rainbow table and brute-force attacks.
Bcrypt 60-Character Hash Structure
A standard Bcrypt string such as $2a$10$N9qo8uLOickgx2ZMRZoMyeIjZAgcfl7p92ldGxad68LJZdL17lhWy splits into four parts:
$2a$: Bcrypt algorithm specification identifier.10$: Cost factor (2¹⁰ = 1,024 key expansion rounds).N9qo8uLOickgx2ZMRZoMye: The first 22 characters encode the 128-bit random salt.IjZAgcfl7p92ldGxad68LJZdL17lhWy: The remaining 31 characters encode the 184-bit ciphertext checksum.
What happens in the page
The hashing library is loaded lazily: getBcrypt() looks for the CDN build only when you actually press the button, so the page stays light for visitors who never hash anything. doHash() generates a salt at the chosen cost factor and derives the digest, doVerify() re-runs the same derivation over the stored hash's own salt and compares, and breakDownHash() splits the result into its four parts — prefix, cost, 22-character salt, 31-character digest — so a mistyped parameter is visible rather than hidden.
Where it breaks down
The cost factor is the only strength knob, and each increment doubles the work: 10 finishes instantly, 14 takes seconds, and because the computation runs on the main thread the interface blocks while it works. Hashes live in memory only; reload and they are gone. The page cannot help if the CDN is unreachable. Version prefixes ($2a$, $2b$, $2y$) describe the same algorithm and verify against each other, but tools display them differently, which confuses comparisons.
Privacy: no data leaves this tab
The password stays in the field and in memory for one derivation. Nothing is stored, no request is made, and the library itself is the only thing fetched — from a pinned CDN version.
Frequently asked questions
Which cost factor should I use?
Start at 10–12. Pick the slowest value your login can tolerate — roughly 250 ms is comfortable, two seconds is not.
Can a hash be reversed?
No. bcrypt is one-way; the only attack is guessing a candidate and re-deriving. That is exactly why leaked hash databases are used for credential stuffing.
Why does the page pause?
The derivation runs in the main thread. Higher cost factors mean longer pauses — that is the algorithm working as designed.