Bcrypt Hash Generator

Generate secure bcrypt password hashes with configurable cost factors and salt generation for secure password storage.

The password you want to hash securely

2^10 = 1,024 iterations (~<100ms)

Cost Factor Recommendations

Development

  • 4-6 rounds: Fast for testing
  • 8 rounds: Good for development
  • Trade-off: Speed over security

Production

  • 10 rounds: Minimum recommended
  • 12 rounds: Good balance
  • 14-15 rounds: High security

Bcrypt security benefits

  • Adaptive cost: Can increase difficulty over time as hardware improves
  • Built-in salt: Each hash includes a unique salt to prevent rainbow table attacks
  • Time-tested: Industry standard for password hashing since 1999
  • Slow by design: Computationally expensive to discourage brute force attacks

Usage in Applications

Node.js (bcrypt library)

const bcrypt = require('bcrypt');
const saltRounds = 10;

// Hash password
const hash = await bcrypt.hash('mypassword123', saltRounds);

// Verify password
const match = await bcrypt.compare('mypassword123', hash);

Python (bcrypt library)

import bcrypt

# Hash password
password = b'mypassword123'
hash = bcrypt.hashpw(password, bcrypt.gensalt(rounds=10))

# Verify password
match = bcrypt.checkpw(password, hash)

Generate Bcrypt in Terminal

Apache htpasswd utility

$htpasswd -bnBC 10 "" "mypassword123" | tr -d ':\n'

Python bcrypt

$python3 -c "import bcrypt; print(bcrypt.hashpw(b'mypassword123', bcrypt.gensalt(rounds=10)).decode())"

Node.js bcrypt

$node -e "console.log(require('bcrypt').hashSync('mypassword123', 10))"