Toolypet
セキュリティツール/Bcryptハッシュ生成器

Bcryptハッシュ生成器

bcryptアルゴリズムでパスワードをハッシュ化・検証

ハッシュ生成

パスワード検証

Bcrypt Hash Guide

Learn about secure password hashing with bcrypt

What is Bcrypt?

Bcrypt is a password hashing function designed to be slow and computationally expensive, making it resistant to brute-force attacks. It automatically handles salting (adding random data) and allows adjustable work factors (cost rounds) to increase security over time as hardware improves.

How to Use

  1. Enter the password you want to hash
  2. Adjust the cost rounds (higher = more secure but slower)
  3. Click 'Generate Hash' to create the bcrypt hash
  4. To verify, enter both the password and hash, then click 'Verify'

Best Practices

  • Use cost rounds of 10-12 for a good balance of security and performance
  • Never store plain passwords - always hash them with bcrypt
  • Increase cost rounds periodically as hardware becomes faster

Security Note

Bcrypt is the recommended algorithm for password hashing. Each hash includes a unique salt, so the same password will produce different hashes. The cost factor makes bcrypt resistant to GPU-based attacks, unlike SHA or MD5.

よくある質問

適切なコストラウンド(cost factor)はいくつですか?

現在10~12が一般的に推奨されます。コストラウンドが1増えるごとに計算時間が2倍になります。10は約100ms、12は約400msです。セキュリティとユーザー体験のバランスを考慮してください。サーバー性能が向上したらコストを徐々に上げてください。

bcryptとArgon2のどちらを使うべきですか?

両方とも優れた選択肢です。Argon2は2015年のPassword Hashing Competition優勝者で最新のアルゴリズムです。メモリ使用量も調整可能です。bcryptはより古いですが検証されており、ライブラリサポートが広いです。新規プロジェクトにはArgon2idを、既存システムにはbcryptを推奨します。

bcryptハッシュに含まれる情報は何ですか?

bcryptハッシュ文字列には:アルゴリズム識別子($2a$、$2b$)、コストラウンド(例:$10$)、22文字のソルト、31文字のハッシュが含まれます。ソルトがハッシュに含まれているため別途保存する必要がなく、検証時に自動的に抽出されます。

パスワードが変更されたらハッシュをアップグレードすべきですか?

ユーザーがログインする時に現在のハッシュ設定が最新かどうか確認してください。コストラウンドが低いかアルゴリズムが古い場合は新しいハッシュにアップグレードしてください。多くのフレームワークがこの機能を自動的に提供します。パスワード変更時にも常に最新の設定でハッシュしてください。

bcryptの72文字制限とは何ですか?

bcryptは入力を72バイトで切り捨てます。長いパスワード(72文字超)を使用すると超過部分が無視されます。ほとんどのパスワードは72文字未満なので問題になりません。長いパスフレーズが必要な場合は、まずSHA-256でハッシュしてからbcryptを適用するか、Argon2を使用してください。