Generate and Verify Bcrypt Hashes

Hash passwords and verify bcrypt hashes securely in your browser.

The Bcrypt Hash Generator lets you create secure bcrypt password hashes and verify existing hashes against plaintext passwords; all processing happens locally in your browser with no data sent to any server.

Your data stays in your browser
Tutorial

How to Use

1
1

Enter a Password

Type or paste the plaintext password you want to hash into the password field.

2
2

Configure and Generate

Adjust the cost factor slider (4-16) to control hash strength, then click Generate Hash to produce the bcrypt hash.

3
3

Verify a Hash

Switch to the Verify tab, enter a password and an existing bcrypt hash, then click Verify to check if they match.

Guide

Complete Guide to Bcrypt Password Hashing

What Is Bcrypt and Why Use It?

Bcrypt is a password-hashing algorithm created in 1999 by Niels Provos and David Mazieres. Unlike fast hash functions such as MD5 or SHA-256, bcrypt is deliberately slow, making brute-force attacks computationally expensive. It automatically generates and embeds a random salt into the hash output, protecting against precomputed rainbow table attacks. The resulting hash string contains the algorithm version, cost factor, salt, and hash in a single portable format.

Understanding the Cost Factor

The cost factor is an integer between 4 and 31 that controls the number of key expansion rounds as a power of 2. A cost of 10 performs 1024 rounds, while a cost of 12 performs 4096 rounds. As computing power increases over time, you can raise the cost factor to maintain security without changing your hashing infrastructure. The OWASP Foundation recommends a minimum cost factor of 10, with 12 being a good balance between security and user experience for most web applications.

Bcrypt Hash Format Explained

A bcrypt hash string looks like $2a$10$N9qo8uLOickgx2ZMRZoMyeIjZAgcfl7p92ldGxad68LJZdL17lhWy. The first segment ($2a$) identifies the bcrypt version. The second segment ($10$) is the cost factor. The next 22 characters are the base64-encoded salt, and the remaining 31 characters are the base64-encoded hash. This self-contained format means you never need to store the salt separately; it is embedded directly in the hash string.

Best Practices for Password Hashing

Always hash passwords on the server side in production systems, never on the client. Use a cost factor of at least 10, and benchmark your server to find the highest cost factor that keeps login time under one second. Never store plaintext passwords, even temporarily. When users change their password, generate a completely new hash rather than updating the existing one. Consider migrating to Argon2id for new projects if your platform supports it, as it adds memory-hardness resistance.

Examples

Worked Examples

Example: Hashing a Password with Cost Factor 10

Given: password = "MySecureP@ss123", cost factor = 10

1

Step 1: Generate a random 16-byte salt and encode it in base64 (22 characters).

2

Step 2: Run the Blowfish key schedule 2^10 = 1024 times using the password and salt.

3

Step 3: Encrypt the magic string "OrpheanBeholderScryDoubt" 64 times with the resulting key to produce the hash.

Result: $2a$10$<22-char-salt><31-char-hash> (60 characters total)

Example: Verifying a Password Against a Stored Hash

Given: password = "MySecureP@ss123", stored hash = "$2a$10$N9qo8uLOickgx2ZMRZoMyeIjZAgcfl7p92ldGxad68LJZdL17lhWy"

1

Step 1: Extract the cost factor (10) and salt from the stored hash string.

2

Step 2: Hash the provided password using the extracted salt and cost factor.

3

Step 3: Compare the newly generated hash with the stored hash byte by byte using constant-time comparison.

Result: Match = true (the password is correct)

Use Cases

Use Cases

Secure Password Storage

Before storing user passwords in a database, hash them with bcrypt to ensure that even if the database is compromised, attackers cannot recover the original plaintext passwords. The adaptive cost factor lets you increase difficulty as hardware improves.

Password Migration Testing

When migrating authentication systems, use this tool to verify that existing bcrypt hashes still match user passwords after the migration, ensuring no credentials are lost during the transition process.

Security Audit and Verification

During penetration testing or security audits, verify that passwords are properly hashed with bcrypt and that the cost factor meets your organization's minimum security standards for resistance against brute-force attacks.

Frequently Asked Questions

?What is bcrypt?

Bcrypt is a password-hashing function designed by Niels Provos and David Mazieres based on the Blowfish cipher. It incorporates a salt to protect against rainbow table attacks and an adaptive cost factor that makes it intentionally slow, increasing resistance to brute-force attacks.

?What is the cost factor?

The cost factor (also called work factor or rounds) determines how computationally expensive the hashing operation is. It is expressed as a power of 2; a cost of 10 means 2^10 (1024) iterations. Higher values produce stronger hashes but take longer to compute. A value of 10-12 is recommended for most applications.

?Why can't I decrypt a bcrypt hash?

Bcrypt is a one-way hashing function, meaning it is mathematically infeasible to reverse. You can only verify whether a given password matches a hash by running the same hashing process and comparing the results. This is by design for security.

?How long does hashing take?

Hashing time depends on the cost factor. At cost 10, it typically takes around 100ms. Each increment roughly doubles the time, so cost 12 takes about 400ms and cost 16 can take several seconds. The tool runs in your browser, so performance depends on your device.

?Is bcrypt still secure in 2024?

Yes. Bcrypt remains widely recommended for password hashing. While newer algorithms like Argon2 offer additional protections (memory-hardness), bcrypt with a cost factor of 12 or higher is still considered secure against brute-force and GPU-based attacks for password storage.

?Is my data private when using this tool?

Yes. All hashing and verification operations run entirely in your browser using JavaScript. No passwords or hashes are transmitted to any server, stored, or logged. Your data never leaves your device.

?Is this bcrypt tool free to use?

Yes. This tool is completely free to use with no limits, no sign-up required, and no advertisements. You can generate and verify as many hashes as you need.

Related Tools

Help us improve

How do you like this tool?

Every tool on Kitmul is built from real user requests. Your rating and suggestions help us fix bugs, add missing features and build the tools you actually need.

Rate this tool

Tap a star to tell us how useful this tool was for you.

Suggest an improvement or report a bug

Missing a feature? Found a bug? Have an idea? Tell us and we'll look into it.

Recommended Reading

Recommended Books on Cryptography & Security

As an Amazon Associate we earn from qualifying purchases.

Boost Your Capabilities

Security Tools and Hardware

As an Amazon Associate we earn from qualifying purchases.

Newsletter

Get Free Productivity Tips & New Tools First

Join makers and developers who care about privacy. Every issue: new tool drops, productivity hacks, and insider updates — no spam, ever.

Priority access to new tools
Unsubscribe anytime, no questions asked