Bcrypt Generator
Generation et verification de hash Bcrypt pour les mots de passe.
Generer un Hash Bcrypt
Temps estime: ~250ms
Iterations: 4096
Recommandations de Securite
Recommande
- Cost factor: 12+ pour production
- Utiliser $2b ou $2a
- Ne jamais stocker en clair
- Ajouter rate limiting
A eviter
- Cost < 10 en production
- MD5/SHA1 pour passwords
- Salt statique ou previsible
- Comparer en temps non-constant
Comparaison des Temps (Cost Factor)
| Cost | Iterations | Temps approx. | Usage |
|---|---|---|---|
| 4 | 16 | ~1ms | Tests uniquement |
| 10 | 1,024 | ~50ms | Dev/staging |
| 12 | 4,096 | ~250ms | Production (standard) |
| 14 | 16,384 | ~1s | Haute securite |
| 16 | 65,536 | ~4s | Tres haute securite |
CLI Usage
# Python
python -c "import bcrypt; print(bcrypt.hashpw(b'password', bcrypt.gensalt(12)).decode())"
# htpasswd (Apache)
htpasswd -nbBC 12 "" password | tr -d ':\n' | sed 's/$2y/$2a/'
# OpenSSL (non-bcrypt, SHA-512)
openssl passwd -6 -salt $(openssl rand -base64 8) password
# mkpasswd (Linux)
mkpasswd -m bcrypt -R 12 password
# Verifier avec Python
python -c "import bcrypt; print(bcrypt.checkpw(b'password', b'\$2a\$12\$...'))"