Password Entropy – The Maths of a Strong Password
Picture a combination padlock with three wheels, each numbered 0 to 9. There are 1,000 possible combinations, and a patient thief can try them all in an afternoon. Add a fourth wheel and there are 10,000. Every wheel multiplies the work by ten. A password is the same kind of lock, only with far more wheels and far faster thieves, and the maths of how quickly those combinations pile up explains almost everything about what makes a password strong.
Measuring surprise in bits
Security people measure password strength in bits of entropy. The idea comes from information theory, where Claude Shannon used the word in 1948 to measure uncertainty: how hard something is to predict. It is a cousin of the thermodynamic entropy described in our article on entropy and the arrow of time, which also counts how many arrangements a system could be in.
One bit is a single coin toss: two equally likely possibilities. Each extra bit doubles the number of possibilities. Ten bits is 1,024 options, twenty bits is about a million, forty bits is about a trillion. To work out the entropy of a randomly chosen password, you multiply the number of characters by the bits each character contributes:
- A random digit (10 choices) is worth about 3.3 bits.
- A random lowercase letter (26 choices) is worth about 4.7 bits.
- A random character from all 95 printable keyboard symbols is worth about 6.6 bits.
So a truly random eight-character password drawn from the whole keyboard has about 52 bits of entropy, which is several quadrillion possibilities. That sounds enormous. Whether it is depends on how fast someone can guess.
How fast the guessing goes
Attackers rarely type guesses into a login page, which can slow them down or lock them out. The real danger comes when a database of stored passwords is stolen. Well-run systems store not passwords but hashes of them, as explained in our article on how hashing proves a file has not changed. An attacker cannot reverse a hash, but they can hash enormous numbers of candidate passwords and look for matches, entirely offline, with no lockout and no alarm.
Graphics cards are superb at this, because guessing passwords is the same small calculation repeated over and over. Against an old, fast hash function such as MD5, a single high-end gaming card can manage on the order of a hundred billion guesses per second. At that rate, every possible random eight-character password can be tried in less than a day. A password that is not random at all, such as a dictionary word with a capital letter and a number on the end, falls in seconds, because attackers try the most human patterns first.
Why length beats complexity
Here is the key insight. Adding a new kind of character, say symbols on top of letters and digits, raises the value of each character only a little, from about 6 bits to about 6.6. Adding one more character adds the full 6.6 bits again. Length multiplies; complexity only nudges. Every extra random character makes the attacker's job about 95 times harder.
Complexity rules also backfire in practice, because humans satisfy them predictably. Asked to include an uppercase letter, most people capitalise the first letter. Asked for a number and a symbol, many add "1!" at the end. Attackers know these habits and build their guessing lists around them, so "Password1!" ticks every box and has a real strength close to zero. Entropy only counts if the choice is genuinely random.
The case for passphrases
A neat way to get both randomness and memorability is to choose whole words at random. The Diceware method uses ordinary dice to pick words from a list of 7,776, which is six to the power of five, the number of ways five dice can land. Each randomly chosen word contributes about 12.9 bits.
- Four random words: about 52 bits, similar to a random eight-character password.
- Five random words: about 65 bits.
- Six random words: about 78 bits.
Six words sounds modest, but at a hundred billion guesses per second, working through 78 bits would take tens of thousands of years. And "lantern orbit cactus mild fever tiles" is far easier to remember than a string of symbols. The important word is random: a favourite song lyric or a famous quote has very little entropy, because attackers' lists include those too.
Salt and slowness: the defender's side
Users are only half of the equation. The other half is how a system stores what users type, and two techniques change the arithmetic dramatically.
Salting adds a unique random value to each password before hashing. Without it, two people with the same password have the same hash, and an attacker can crack huge numbers of accounts with one precomputed table. With it, every account has to be attacked separately.
Slow hashing uses functions such as bcrypt, scrypt or Argon2 that are deliberately expensive to compute, and some also demand large amounts of memory that graphics cards cannot supply cheaply. A login that takes a fraction of a second barely bothers a real user, but for an attacker it can cut the guessing rate from billions per second to thousands. A millionfold slowdown is worth about twenty extra bits of entropy, added to every password in the database for free.
From the maths to the workplace
The practical lessons follow straight from the numbers. Long beats complicated. Random beats clever. A password manager can generate and remember a different random password for every site, so that one breach does not unlock the rest. And multi-factor authentication means a cracked password alone is no longer enough to get in.
For a business, the harder question is whether these principles are actually applied across every account and system, including the ones nobody has looked at in years. A free online check of your password policies and other security controls shows how your settings compare with frameworks such as the ACSC Essential Eight, and where the weakest lock is.
Doubling is easy to underestimate. Each bit seems trivial, yet a few dozen of them build a wall that no computer on Earth can climb by brute force. The same exponential maths protects encrypted messages and the keys that secure the internet. For more stories about the mathematics hiding in everyday life, browse our episodes.