Guessing every possibility
Suppose an attacker has stolen a hashed password and wants the original. If nothing cleverer works, there is always one method left: try every possible password, hash each one, and see which matches. This is a brute-force attack.
It always succeeds eventually. The only question is how long "eventually" is. And that depends on one thing above all: how many possibilities there are.
Count the combinations
Take passwords made of lowercase letters, capitals and digits. That is 26 + 26 + 10 = 62 characters to choose from.
- 1 character: 62 possibilities.
- 2 characters: 62 × 62 = 3,844.
- 3 characters: 62 × 62 × 62 = 238,328.
Every extra character multiplies the total by 62.
Now give the attacker serious hardware: 10 billion guesses every second.
Start. A password made of letters and digits has 62 choices for each position. An attacker with a stolen hash tries every combination, at 10 billion guesses a second.
| Length | Time to try every combination |
|---|---|
| 6 | 6 seconds |
| 8 | 6 hours |
| 10 | 2.7 years |
| 12 | about 10,000 years |
From 4 characters to 12, the search goes from "instant" to "longer than recorded history". The computer is the same throughout. Only the password grew.
One more character, 62 times longer
That is the whole lesson in one line. Each added character does not add to the work. It multiplies it.
Example
Length beats hardware
Suppose the attacker buys a machine 1,000 times faster. That sounds decisive.
It is cancelled out by adding two characters to the password, because 62 × 62 = 3,844, which is more than 1,000.
Hardware improves by adding. Length improves by multiplying. Length wins.
Longer, or more symbols?
Sites often demand a symbol and a capital letter. That widens the set of characters: adding about 30 symbols takes it from 62 to roughly 94. How much does that help, compared with simply adding length?
| Change | Combinations multiplied by |
|---|---|
| Allow symbols, at length 8 (62 → 94 characters) | about 28 |
| Add one more character (8 → 9) | 62 |
| Add four more characters (8 → 12) | about 15 million |
One extra character beats the whole symbol requirement. A long password of plain words is stronger than a short one full of punctuation, and far easier to remember and type.
The catch: people are not random
All of the numbers above assume every combination is equally likely. That is true for a password a computer generated. It is not true for one a person made up.
Attackers do not start at aaaaaaaa. They start with:
- The most common passwords:
123456,password,qwerty. - Every password found in earlier leaks. There are billions on file.
- Dictionary words, names, dates and keyboard patterns.
- Predictable tweaks of those: a capital first letter,
a→@,!or1on the end.
Summer2024! has 11 characters, a capital, digits and a symbol. By the table it should take over a century. In practice it falls in seconds, because it is a common word, a year and a !, exactly what the list of tweaks is built to try.
The table is the best case. It only applies if the password is genuinely random.
What actually works
Use a password manager
It generates a long random password for every site and remembers them. You remember one.
For the few you must memorise, use a passphrase
Four or five words picked at random (by dice or a generator, not by you), such as
copper-lantern-thirsty-orbit. Long, random and typeable.Never reuse a password
If a site leaks it, attackers try it everywhere else within hours. Reuse is how one breach becomes ten.
Turn on two-factor authentication
Then a guessed or stolen password is not enough by itself.
Key takeaways
- Brute force tries every possible password, so its cost is the number of combinations.
- Each extra character multiplies the combinations: by 62 for letters and digits.
- Adding length helps far more than adding symbol requirements.
- The numbers only hold for random passwords. Human-chosen ones are guessed from lists long before brute force is needed.
- Use a password manager, unique passwords and two-factor authentication.