Password entropy \(H\) measures the unpredictability of a password in bits, defined as:
\[H = L \times \log_2(N)\]
where \(L\) = password length, \(N\) = character set size.
Brute Force Attack Time:
\[T = \frac{2^H}{R}\]
where \(R\) = attacker’s guess rate (guesses per second).
Working through an example:
Given: IoT dashboard requires password for 200 field technicians. Attacker uses GPU cluster: \(R = 10^{10}\) guesses/sec (bcrypt slows this to \(R = 5\) guesses/sec).
Scenario A: 8-character mixed case + symbols
- Character set: lowercase (26) + uppercase (26) + digits (10) + symbols (33) = \(N = 95\)
- Length: \(L = 8\)
Step 1: Calculate entropy \[H = 8 \times \log_2(95) = 8 \times 6.57 = 52.6 \text{ bits}\]
Step 2: Brute force time (plain SHA-256) \[T = \frac{2^{52.6}}{10^{10}} = \frac{6.9 \times 10^{15}}{10^{10}} = 690,000 \text{ seconds} \approx 8 \text{ days}\]
Step 3: Brute force time (bcrypt cost 12) \[T = \frac{2^{52.6}}{5} = 1.38 \times 10^{15} \text{ seconds} \approx 43.8 \text{ million years}\]
Scenario B: 4-word passphrase (Diceware)
- Dictionary size: \(N = 7{,}776\) words
- Length: \(L = 4\) words
\[H = 4 \times \log_2(7776) = 4 \times 12.9 = 51.7 \text{ bits}\]
\[T_{bcrypt} = \frac{2^{51.7}}{5} = 6.5 \times 10^{14} \text{ seconds} \approx 20.6 \text{ million years}\]
Result: Both 8-char complex and 4-word passphrase provide ~52 bits entropy. With bcrypt, both resist brute force for decades. Plain SHA-256 allows cracking in days.
In practice: The 2019 Ring breach used credential stuffing (reused passwords). Even with strong entropy, password reuse defeats protection. For IoT systems with human authentication, MFA is essential – password entropy alone is insufficient against modern attacks.