Bcrypt Generator & Hash Verifier Online
Last updated
Bcrypt is an adaptive password hash designed by Niels Provos and David Mazières (1999) based on Eksblowfish. It executes 2^cost iterations (4 to 16 rounds; default 12, executing 4,096 iterations) and uses only the first 72 bytes of a password. This client-side tool hashes and verifies credentials in-browser via Web Workers with zero network transmissions.
Generate cryptographically secure Bcrypt password hashes with custom salt rounds (cost 4–16) and verify hashes in real time. 100% private in-browser Web Workers.
Runs in your browser
Your files and text are processed locally in your browser and are not uploaded.
How Does Bcrypt Adaptive Password Hashing Protect Passwords?
Dual-Tab Generator & Verifier on One Screen: Our tool integrates hash generation and verification into a single tabbed interface. The Generate Hash tab computes 60-character bcrypt strings with configurable salt rounds and an interactive benchmark measuring device-calibrated execution times in milliseconds. The Verify Hash tab allows developers and DevOps engineers to test candidate passwords against existing hashes using constant-time string comparisons to eliminate timing-attack vulnerabilities.
Strict 72-Byte Key Limit Warning: Most bcrypt implementations, starting with OpenBSD's, use only the first 72 bytes of a password (the 1999 paper describes keys of up to 56 bytes). Characters beyond the 72nd byte are silently ignored by the algorithm. Our tool displays an active UTF-8 byte counter and warning banner when password length exceeds 72 bytes, helping developers prevent silent truncation bugs before deploying authentication code.
Hash Anatomy Breakdown: Every valid hash follows the 60-character modular crypt format:
- Version:
$2b$ prefix (the modern OpenBSD standard that resolved length-wraparound bugs present in early $2a$ implementations).- Cost: Two digits (e.g.,
12) setting 2^cost computation rounds (4,096 iterations).- Salt: Exactly 22 Base64 characters representing a cryptographically random 128-bit salt.
- Checksum: Exactly 31 Base64 characters containing the final 184-bit ciphertext.
Multi-Language Code Snippets: Dynamic copy-ready implementation code is provided for major production backends, reflecting your selected cost rounds:
- Node.js: Using
bcryptjs or native bcrypt (bcrypt.hash(password, 12)).- Python: Using
bcrypt (bcrypt.hashpw(password.encode('utf-8'), bcrypt.gensalt(rounds=12))).- PHP: Using native
password_hash($password, PASSWORD_BCRYPT, ['cost' => 12]).- Spring Security (Java): Using
new BCryptPasswordEncoder(12). By default, Spring's BCryptPasswordEncoder specifies strength 10 (1,024 rounds) per official Spring Security documentation.- Go: Using
golang.org/x/crypto/bcrypt (bcrypt.GenerateFromPassword([]byte(password), 12)).For in-depth analysis of salt generation, cost benchmarking, and authentication architecture, explore our Bcrypt Password Hashing Explained Guide or compare modern memory-hard alternatives in our Bcrypt vs Argon2 vs Scrypt Guide.
Worked Example & Test Vector:
- Password:
password (8 bytes)- Cost: 10 (1,024 rounds)
- Example hash (generated with cost 10):
$2b$10$C9B3tKbCqFIREnuBm0TYzu7B5g6cOWQfOogLEwGVCg/xYlpOowd/i- Verification: Pasting candidate password
password against this canonical hash returns a green "Match" indicator; an altered password returns "Does not match".A bcrypt generator creates secure, salted password hashes using the Blowfish key derivation algorithm. Each output follows the 60-character modular crypt format ($2b$12$...) containing the algorithm version, work factor cost, a 22-character salt, and a 31-character checksum. Running client-side via a Web Worker, it hashes passwords, reveals structural components, and verifies candidate strings without network transmissions.
Definition: Bcrypt Work Factor (Cost)
An exponential parameter (log2 rounds) defining the computational workload of the bcrypt hashing algorithm. A cost of 12 executes 2^12 (4,096) Blowfish key scheduling rounds, intentionally slowing down brute-force search attacks.
What Salt Rounds and Verification Outputs Are Provided?
Required Inputs
- Plain Text PasswordThe password to hash, with an active UTF-8 byte counter and 72-byte boundary check.
- Cost Factor SliderWork factor integer between 4 and 16 (default 12), setting iteration rounds from 16 to 65,536.
- Verification InputsCandidate plain text password and existing 60-character bcrypt hash to compare with constant-time matching.
Expected Outputs
- Bcrypt HashThe complete 60-character modular crypt format string ($2b$12$...).
- Hash Anatomy BreakdownParsed breakdown isolating the version prefix, cost factor, 22-character salt, and 31-character checksum.
- Execution Time & BenchmarkLive worker progress percentage and local execution duration measured in milliseconds.
- Verification Match BadgeInstant visual confirmation (Match or Does not match) indicating verification outcome.
Who Uses the Bcrypt Generator?
Database Seeding & Test Fixtures
Generate production-grade bcrypt hashes to seed default administrative accounts and mock user profiles during application development.
Authentication Troubleshooting
Isolate login bugs by manually checking candidate credentials against stored user hashes using the online bcrypt verifier.
Legacy Hash Structure Auditing
Inspect database hashes to verify version prefixes ($2a$, $2b$, $2y$) and confirm that stored credentials satisfy modern cost factor standards.
Cost Factor Performance Testing
Observe local client-side hashing latency across different cost factors (from 4 to 16) to evaluate processing trade-offs prior to server configuration.
How Do You Generate and Verify Bcrypt Hashes in the Browser?
- 1Type your password into the input field, or click 'Random' to generate a 16-character secure credential.
- 2Check the UTF-8 byte counter to ensure your password does not exceed the 72-byte bcrypt limit.
- 3Select your desired cost factor using the slider between 4 and 16 (default 12; Spring Security default 10).
- 4Click 'Generate Hash' to trigger the Web Worker, watching the progress indicator until the 60-character string appears.
- 5Review the hash anatomy breakdown showing version ($2b$), cost factor, salt, and checksum, then click copy.
- 6To verify an existing hash, switch to the 'Verify Hash' tab, paste candidate plain text and the stored hash, and view the match result.
Bcrypt Cost Factor Iterations and Work Factor Benchmarks
Privacy & Security Guarantee
All password hashing and verification runs strictly within your browser sandbox via a Web Worker. No credentials, salts, or hashes are transmitted across the internet or stored on external servers.
Frequently Asked Questions
Why does the bcrypt generator create a different hash each time for the identical password?
Bcrypt automatically generates a fresh, random 128-bit salt for every execution, appearing as the 22-character segment in the final hash. Even when the input password is identical, differing salts produce completely distinct 60-character strings, defeating pre-computed rainbow tables.
What does the $2b$ prefix signify in the generated bcrypt hash?
The $2b$ prefix identifies the specific revision of the bcrypt algorithm. The older $2a$ prefix is still widely accepted. In 2014 OpenBSD found that its $2a$ code wrapped the password length counter for passwords longer than 255 characters, and introduced $2b$ for the fixed version. ($2x$ and $2y$ come from a separate sign-extension bug in the crypt_blowfish library.) bcryptjs produces $2b$ hashes and can verify $2a$ and $2b$.
Why does bcrypt have a 72-byte password length limit?
As specified by Niels Provos and David Mazières (1999), Eksblowfish initializes its state by XORing key material into Blowfish's P-array of 18 32-bit words (72 bytes total). Any trailing characters beyond 72 bytes are silently truncated. Multi-byte UTF-8 characters consume 2 to 4 bytes each, meaning non-ASCII passwords may reach the limit in fewer characters.
What is the default Bcrypt strength in Spring Security?
According to official Spring Security documentation for org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder, the default strength parameter is 10 (BCrypt.GENSALT_DEFAULT_LOG2_ROUNDS = 10), which executes 2^10 = 1,024 key expansion rounds. You can customize the strength between 4 and 31 via the constructor.
What cost factor should I select for production systems?
OWASP suggests a work factor of 10 or more for bcrypt. A cost factor of 12 (4,096 rounds) is a standard modern baseline for server authentication. Every increment of 1 doubles computation time, so benchmark on your own server and pick the highest cost that keeps login latency under ~250–500ms.
Can a bcrypt hash be decrypted back into the original password?
No. Bcrypt is a one-way cryptographic key derivation function, not two-way encryption. There is no mathematical decryption key. Verification works by re-hashing candidate plain text with the salt extracted from the existing hash and checking if the resulting ciphertexts match.
How does the online bcrypt verifier safely test password matches?
The verifier extracts the salt and work factor embedded directly in your 60-character hash, hashes candidate plain text using those exact parameters inside a client-side Web Worker, and performs a constant-time comparison against the stored hash.