レインボーテーブルの理解
レインボーテーブルがソルトなしハッシュをどう攻撃するか、そしてソルトがなぜそれを無効化するのかを学びます。
问题
レインボーテーブルが高速なパスワードクラックを可能にする仕組みと、防御方法を理解したい状況です。
前提条件
- ハッシュ関数の理解
- パスワード保管に関する知識
ステップ
-
1. Understand the precomputation attack
A rainbow table is a precomputed table of hash-to-password mappings. An attacker computes hashes for many possible passwords once, storing them in a time-memory trade-off table. To crack a stolen hash, they look it up in the table instead of brute-forcing.
入力stolen hash: 5f4dcc3b...输出lookup in table → 'password' -
2. Understand the role of chains
Rainbow tables use hash chains to compress the storage. Each chain starts from a password, alternates hashing and reduction functions, and stores only the start and end. This reduces storage at the cost of some recomputation during lookup, trading time for space.
入力chain: pw1 → hash → reduce → pw2 → ...输出store only start + end -
3. Defend with salting
A per-password random salt makes precomputation useless: the attacker would need a separate rainbow table for each salt, which requires more storage than brute-forcing. This is why all modern password hashing (bcrypt, PBKDF2, scrypt) uses salts. Always use a unique salt per password.
入力hash = H(password + salt)输出rainbow table defeated
期待される結果
レインボーテーブルの仕組みと、パスワードセキュリティにソルティングが不可欠な理由についての理解。
よくあるエラー
- Storing unsalted password hashes
- Always use a per-password random salt. bcrypt, PBKDF2, and scrypt handle this automatically.
- Using a shared salt for all passwords
- A shared salt still allows a single rainbow table to crack all passwords. Each password needs its own random salt.
トラブルシューティング指引
- If you discover unsalted hashes in a legacy system, migrate to bcrypt or scrypt immediately.
- Rainbow tables are effective against MD5 and SHA-1; they are less practical against slow KDFs like bcrypt.
セキュリティ上の制限
- Rainbow tables are a real threat for unsalted hashes. Salting is the standard defense.
- This is an educational explanation; no cracking is performed.