Bcrypt Generator
Generate and verify bcrypt password hashes online. Adjustable cost factor, built-in salt, real-time hash preview. All processing runs locally in your browser — no data sent to any server.
What is bcrypt?
Bcrypt is a password hashing function designed by Niels Provos and David Mazières, based on the Blowfish cipher. It is specifically designed for secure password storage and is one of the most widely used password hashing algorithms in the world.
How does bcrypt work?
Bcrypt takes a password and a salt as input, then runs an expensive key setup process (Eksblowfish) that produces a fixed-length hash. The hash includes the algorithm identifier, cost factor, salt, and the actual hash value, making it self-contained and verifiable.
What is the cost factor in bcrypt?
The cost factor (also called work factor) is a number from 4 to 31 that determines how many iterations of the key setup are performed. Each increment doubles the computation time. A cost of 10 means 2^10 = 1024 iterations. Recommended values are 10-12 for most applications.
What is a salt and why is it important?
A salt is a random 128-bit value that is unique for each password hash. It prevents attackers from using precomputed rainbow tables and ensures that identical passwords produce different hashes. Bcrypt automatically generates and embeds the salt in the hash output.
Is bcrypt still secure in 2025?
Yes, bcrypt remains one of the recommended password hashing algorithms. While newer algorithms like Argon2 exist, bcrypt is still considered secure when used with an appropriate cost factor (12 or higher). Its simplicity and wide support make it a practical choice.
What is the maximum password length for bcrypt?
Bcrypt has a maximum input length of 72 bytes. Passwords longer than 72 bytes are silently truncated. Most implementations handle ASCII passwords up to 72 characters. For longer passwords, consider pre-hashing with SHA-256 before applying bcrypt.
How does bcrypt compare to MD5, SHA-256, and other hash functions?
Unlike MD5 and SHA-256 which are designed for speed, bcrypt is intentionally slow and computationally expensive. General-purpose hash functions can be computed billions of times per second, making them vulnerable to brute-force attacks. Bcrypt's adaptive cost factor makes it specifically suited for password security.
What is the bcrypt hash format?
A bcrypt hash follows the format: $2b$cost$salt+hash. For example: $2b$10$N9qo8uLOickgx2ZMRZoMyeIjZAgcfl7p92ldGxad68LJZdL17lhWy. The prefix $2b$ identifies the algorithm version, followed by the cost factor, 22-character salt, and 31-character hash.
What is the difference between $2a$, $2b$, and $2y$?
These are bcrypt version identifiers. $2a$ is the original version, $2b$ fixes a minor issue with password length handling in OpenBSD, and $2y$ is the PHP-specific variant. All three are compatible and produce the same output for passwords under 255 bytes.
Is it safe to use a bcrypt generator online?
When the processing runs entirely in your browser (client-side), it is completely safe. No password data is ever transmitted to any server. This tool processes everything locally using JavaScript, ensuring your passwords remain private.
How should I choose the right cost factor?
The cost factor should be as high as possible while keeping hash generation acceptably fast for your use case. A good rule of thumb: choose the cost where hashing takes about 250-500ms on your server. For most modern systems, cost 10-12 is appropriate. As hardware improves, increase the cost factor.
Can bcrypt be used for encrypting data?
No, bcrypt is a one-way hash function, not an encryption algorithm. It cannot be reversed to recover the original password. It is designed solely for password verification — you hash the password and compare hashes, never decrypt.
Why is bcrypt slow by design?
Bcrypt is intentionally slow to make brute-force and dictionary attacks computationally expensive. While a normal hash function can process millions of passwords per second, bcrypt processes only a few hundred, dramatically increasing the time and cost of an attack.
How do I verify a password against a bcrypt hash?
To verify a password, extract the salt and cost factor from the stored hash, run bcrypt with the same parameters on the input password, and compare the resulting hash with the stored hash. If they match, the password is correct. This tool handles verification automatically.