Bcrypt Hash Generator & Verifier
Securely generate and verify bcrypt hashes client-side. Analyze cost factors, extract salts, and test password matches with this standalone cryptographic tool.
About
Bcrypt is an adaptive, computationally expensive cryptographic key derivation function (KDF) architected specifically for password hashing. Derived from the Blowfish block cipher, its primary defense mechanism is its inherent latency. Unlike rapid-digest algorithms such as MD5 or SHA-256, bcrypt intentionally limits execution speed via a configurable logarithmic work factor. This physical time constraint exponentially inflates the resource overhead for adversaries attempting offline dictionary or brute-force attacks utilizing parallel GPU pipelines.
Every generated hash autonomously embeds a 128-bit cryptographically secure pseudo-random salt. This protocol effectively eliminates the threat of pre-computed rainbow tables by ensuring identical plaintext inputs inevitably produce divergent ciphertext outputs. Proper deployment of bcrypt requires balancing the cost factor against infrastructure concurrency limitations; an optimal configuration typically mandates 200−500 milliseconds per verification operation to maximize security thresholds without degrading server response latency.
Formulas
The bcrypt algorithm outputs a 60-character modular string encompassing four critical cryptographic fields. This composite structure guarantees that the hash string inherently contains its own evaluation parameters, negating the requirement for external configuration databases.
Parameter specifications:
- Version: The core algorithm revision identifier (e.g., 2a, 2b, 2y). Modern implementations natively enforce 2b.
- Cost: A base-2 logarithmic work factor dictating the iterations of the Blowfish key schedule. Calculated as Iterations = 2Cost.
- Salt: 16 bytes of hardware-generated random data, encoded via a custom Base64 dictionary into exactly 22 characters.
- Checksum: 24 bytes of the resulting final hash output, Base64-encoded to exactly 31 characters.
Reference Data
| Cost Factor | Key Expansion Rounds | Relative Execution Latency (1 Core) | Security Classification |
|---|---|---|---|
| 04 | 16 | < 1 ms | Severely Vulnerable (Testing only) |
| 08 | 256 | ~ 2 ms | Insufficient for Production |
| 10 | 1,024 | ~ 10 ms | Legacy Minimum standard |
| 12 | 4,096 | ~ 150 ms | Standard Practice (Current Default) |
| 13 | 8,192 | ~ 300 ms | High Security baseline |
| 14 | 16,384 | ~ 600 ms | Enterprise Security limit |
| 15 | 32,768 | ~ 1.2 s | Extreme Security |
| 16 | 65,536 | ~ 2.5 s | Maximum Practical Web Limit |