Hash Generator (MD5, SHA-256)Specialized Version
#️⃣

Bcrypt Hash Generator

Generate bcrypt password hashes

128 bits (32 hex characters)
160 bits (40 hex characters)
256 bits (64 hex characters)
512 bits (128 hex characters)
Security Note: Never use MD5 or SHA-1 for passwords or security-critical applications. For password hashing, use specialized algorithms like bcrypt, scrypt, or Argon2. These hash functions are suitable for checksums and data integrity verification.

Bcrypt Hash Generator

Generate bcrypt hashes for secure password storage. Bcrypt is specifically designed for password hashing, with built-in salt and configurable work factor to resist brute-force attacks.

Why Bcrypt for Passwords

FeatureBcryptSHA-256
PurposePasswordsGeneral hashing
Built-in saltYesNo
Adjustable slownessYesNo
GPU resistanceGoodPoor
Industry standardYesNo (for passwords)

Bcrypt Hash Format

`` $2b$12$LQv3c1yqBWVHxkd0LHAkCOYz6TtxMQJqhN8/X4beUYqL1qXWvEwZW │ │ │ │ │ │ │ │ └─ Salt (22 chars) └─ Hash (31 chars) │ │ └─ Cost factor (2^12 = 4096 rounds) │ └─ Version (2b) └─ Algorithm identifier `

Bcrypt Implementation

`javascript // Node.js with bcrypt const bcrypt = require('bcrypt');

// Hash a password async function hashPassword(password) { const saltRounds = 12; return await bcrypt.hash(password, saltRounds); }

// Verify a password async function verifyPassword(password, hash) { return await bcrypt.compare(password, hash); }

// Usage const hash = await hashPassword('mySecretPassword'); // "$2b$12$LQv3c1yqBWVHxkd0LHAkCOYz6TtxMQJqhN8/X4beUYqL1qXWvEwZW"

const isValid = await verifyPassword('mySecretPassword', hash); // true ``

Cost Factor (Salt Rounds)

RoundsTime (~)Recommendation
10~100msDevelopment minimum
11~200msLight usage
12~400msRecommended default
13~800msHigh security
14~1.6sVery high security

Bcrypt Best Practices

1. Use cost factor 12+ for production 2. Never store plain passwords - always hash 3. Don't use pepper with bcrypt (controversial) 4. Increase cost factor as hardware improves 5. Use constant-time comparison (bcrypt.compare does this)

Bcrypt Limitations

LimitationDetail
Max password length72 bytes
No keyed hashingCan't use secret key
Single-threadedCan't parallelize
Consider Argon2 for new projects (memory-hard, more modern).

Frequently Asked Questions

What cost factor should I use for bcrypt?

Use cost factor 12 as a baseline for production. The cost should make hashing take 250-500ms on your server. Increase the cost factor as hardware improves. Test on your production hardware: if 12 takes <100ms, increase to 13 or 14. Never go below 10. Balance security (higher is better) against user experience (login latency).

Why is bcrypt better than SHA-256 for passwords?

Bcrypt is designed specifically for passwords with three key features: 1) Built-in salt prevents rainbow table attacks, 2) Configurable cost factor makes it intentionally slow, resistant to brute force, 3) GPU-resistant design. SHA-256 is too fast (billions/second on GPUs) and lacks built-in salt. Always use bcrypt, argon2, or scrypt for passwords.

What is bcrypt's 72-byte password limit?

Bcrypt only processes the first 72 bytes of a password. Longer passwords are truncated. This is rarely an issue since 72 characters is very long for a password. If you need longer passwords, pre-hash with SHA-256 before bcrypt (controversial) or use Argon2 which has no such limit.

Related Tools

Explore other tools you might find useful:

Related Calculators