How passwords get cracked

Most advice about passwords makes more sense once you know how attackers actually work. Here’s what happens to a password after a breach, and why length matters so much.

How websites store your password

A well-run website doesn’t store your actual password. It stores a hash: the output of a one-way function that turns sunshine1 into something like b4f2…9e1c. When you log in, the site hashes what you typed and compares the two. The hash can’t simply be reversed back into the password.

That sounds safe, and it’s why attackers have to guess. They take a candidate password, hash it the same way and check whether it matches. Cracking is just guessing, very fast and in a clever order.

Two details make a big difference:

  • Salting. Good sites add a random value (a salt) to each password before hashing it. Then two people with the same password get different hashes, and every account has to be cracked separately.
  • Slow hashing. Algorithms such as bcrypt and Argon2 are deliberately slow, so each guess costs the attacker more. Older or careless systems use fast hashes like MD5, which a single graphics card can test billions of times a second.

You can’t see how a site stores your password, so it’s safest to assume the worst.

Online and offline attacks

An online attack means typing guesses into the real login page. It’s slow: sites limit attempts, lock accounts and ask for CAPTCHAs. Only very common passwords fall to this.

An offline attack happens after a breach, when the attacker has a copy of the hash database on their own hardware. There are no limits and no lockouts, just as many guesses per second as their graphics cards can manage. This is the scenario strong passwords are designed to survive.

How long would it take?

Choose an attack below to see how long each kind of password would last. Times are the average: an attacker would expect to succeed after trying about half the possibilities.

 

Type of password Example Guesses needed Time to crack
A common password sunshine1 Within the top 10,000
Word + year + symbol Monkey2024! About 10 billion
8 random characters k#9Tq!2x 6 × 1015
4 random words cider-orbit-ample-trowel 4 × 1015
6 random words dusk-grain-tidy-vault-oasis-plank 2 × 1023
12 random characters p7#Kd!q2Wz@m 5 × 1023
20 random characters Vb8$wq2!Lr#9zT@k4mXe 3 × 1039

Random characters use all 94 printable keyboard characters. Words come from a 7,776-word list. The first two rows assume the attacker tries common passwords and common patterns first, which every cracking tool does.

The attacker’s toolkit

Dictionary attacks and rules

Attackers start with lists of real passwords leaked in earlier breaches, which run to billions of entries. Then they apply rules: capitalise the first letter, add a year, swap a for @, put ! on the end. This is why Monkey2024! falls in seconds even though it looks complex. It follows exactly the pattern the rules are written for.

Brute force

When the clever guesses run out, attackers try every possible combination. This is the only thing that works against a truly random password, and the table shows why length beats it: each extra random character multiplies the work by up to 94.

Credential stuffing

Why crack anything when people reuse passwords? Attackers take email and password pairs from one breach and try them on hundreds of other sites automatically. This is one of the most common ways accounts are taken over, and no amount of password strength helps if the same password is used everywhere.

Password spraying

The reverse of brute force: try a handful of the most common passwords against thousands of different accounts. It stays under lockout limits and works because, in any large group of people, someone is using Password1.

Phishing and malware

The easiest password to get is one you hand over. A convincing fake login page or a keylogger collects the password exactly as typed, however strong it is. This is why two-factor authentication, and especially phishing-resistant security keys and passkeys, matter so much.

What this means for you

  • Make passwords random. Anything a human invents follows patterns that cracking rules already cover. Let a generator choose.
  • Make them long. 16+ random characters or 6+ random words are safe even against a fast-hash offline attack.
  • Never reuse them. Then a breach at one site stays at that site.
  • Add a second factor. It protects you from the attacks that strength can’t, like phishing.

See how your own password measures up with the strength checker, or find out whether it has already leaked with the breach check.

Read next