Password Security Explained: Why Length Beats Complexity (and How Entropy Works)
Most password advice is wrong — or at least, not based on what actually makes passwords hard to...
Full article excerpt tap to expand
try { if(localStorage) { let currentUser = localStorage.getItem('current_user'); if (currentUser) { currentUser = JSON.parse(currentUser); if (currentUser.id === 3863980) { document.getElementById('article-show-container').classList.add('current-user-is-article-author'); } } } } catch (e) { console.error(e); } Snappy Tools Posted on Apr 28 • Originally published at snappytools.app Password Security Explained: Why Length Beats Complexity (and How Entropy Works) #webdev #security #beginners #tools Most password advice is wrong — or at least, not based on what actually makes passwords hard to crack. Rules like "use a capital letter, a number, and a symbol" produce passwords like P@ssword1, which is trivially cracked. Here's what actually matters, and why. What makes a password hard to crack? Attackers don't guess passwords the way humans do. They use two main approaches: Dictionary attacks: A list of millions of common passwords, words, phrases, and patterns is hashed and compared against a stolen password database. password, 123456, P@ssword1, Tr0ub4dor&3 — all instantly cracked. Brute-force attacks: Every possible combination is tried systematically. The difficulty is determined by the size of the search space, which is measured in entropy. What is password entropy? Entropy (measured in bits) describes how many guesses an attacker would need, on average, to crack your password. The formula: Entropy = log₂(charset_size ^ password_length) = password_length × log₂(charset_size) Enter fullscreen mode Exit fullscreen mode For a password using only lowercase letters (26 characters), 8 characters long: Entropy = 8 × log₂(26) = 8 × 4.7 = 37.6 bits Enter fullscreen mode Exit fullscreen mode For a random 12-character password with lowercase, uppercase, digits, and symbols (95 characters total): Entropy = 12 × log₂(95) = 12 × 6.57 = 78.8 bits Enter fullscreen mode Exit fullscreen mode Each additional bit of entropy doubles the number of guesses needed. Going from 50 bits to 80 bits isn't a 60% improvement — it's 2³⁰ times harder (about a billion times harder). Character sets and their entropy Character set Pool size Bits per character Digits only (0–9) 10 3.3 Lowercase only (a–z) 26 4.7 Lower + upper (a–z, A–Z) 52 5.7 Lower + upper + digits 62 5.95 All printable ASCII (+ symbols) 95 6.57 Diceware wordlist (7,776 words) 7,776 12.9 per word The takeaway: Symbols and uppercase letters add entropy, but not as much as making the password longer. Adding one character always adds more entropy than adding one complexity rule. Length vs complexity Here's the comparison that changes how most developers think about passwords: Password Character set Length Entropy P@ssword1 95 9 59 bits (but dictionary-trivial) correcthorsebatterystaple 26 25 117 bits Random 12 chars (all ASCII) 95 12 78 bits Random 16 chars (all ASCII) 95 16 105 bits The passphrase correcthorsebatterystaple — four random common words — has more entropy than a 12-character mixed-complexity password, while being much easier to remember. This is the core insight behind XKCD 936. Why the "1 capital, 1 number, 1 symbol" rule fails The rule doesn't guarantee randomness. Humans apply it predictably: Capital letter at the start Number or symbol at the end Often substituting a→@, i→1, e→3, o→0 These patterns are in every attacker's dictionary. A 10-character password that follows this rule has far less effective entropy than the formula suggests, because the actual search space is much smaller than…
This excerpt is published under fair use for community discussion. Read the full article at DEV Community.