Password Strength Analysis & Security Best Practices: From Entropy to Passkeys

The Attack Model Decides the Defence

Different scenarios demand completely different defences, so identify the adversary before discussing strength:

Scenario What the attacker can do Effective defence
Credential stuffing Replay username/password pairs leaked from other sites A unique password per site plus breach screening
Online brute force Guess directly against the login endpoint Rate limits, progressive delays, lockout policy
Offline cracking Holds the database hashes and grinds locally Slow hashing (Argon2id / bcrypt) with a per-user salt
Phishing Lure you into typing credentials on a fake site Passkeys / WebAuthn
SIM swap Take over your phone number Do not use SMS as a second factor

The most common entry point is not cracking but credential stuffing — reusing one password across sites. That is why "an independent random password per site" beats "one very strong universal password": the former removes the attack chain, the latter hardens a single point.

Entropy: The Formula, Its Failures, and a Better Estimate

The Ideal Formula

E = log₂(R^L), where R is the charset size and L the length. Plugging it in: eight digits give about 26.6 bit, eight alphanumeric characters about 47.6 bit, and twelve alphanumeric about 71.5 bit (runnable code at the end). The floor for random generation is 12 characters and 70 bit or more — a figure that does not apply to human-chosen passwords.

Where the Formula Breaks: Humans Are Not a Random Source

The formula assumes every character is independently and uniformly random. Humans are not, so real entropy falls far below the nominal figure:

Password Nominal entropy (95-char set) Realistic crackability
P@ssw0rd1 ~52 bit Dictionary plus common substitutions; hit within tens of thousands of tries
Qwerty123! ~52 bit Keyboard sequence plus digit suffix; extremely fast
Zhang1985! ~52 bit Common surname plus birth year; a targeted dictionary breaks it instantly
Tr0ub4dor&3 ~65 bit Still a "word + substitutions + suffix" structure

Length matters far more than character variety. Twelve random lowercase letters (about 56 bit) beat eight characters across four classes (nominally 52.6 bit, realistically under 30). "Must contain upper, lower, digits, and symbols" only pushes users toward predictable substitutions.

zxcvbn: Recognise Patterns First, Then Estimate Guesses

Modern strength estimators (zxcvbn and its derivatives) do not count charsets. They recognise patterns and estimate the guess count:

  • dictionary words, including common names, places, brands, and fictional characters;
  • common substitutions (a→@, o→0, i→1);
  • keyboard sequences (qwerty, 1qaz2wsx);
  • repeats, runs, and dates (aaaa, 12345, 1985);
  • structural splits (word + 123 + ! graded separately, then combined).

This also explains why correct-horse-battery-staple is strong: four random common words give a space equal to the wordlist size to the fourth power. Strength is the number of guesses those patterns require, not the number of character classes.

Three Old Rules NIST 800-63B Reversed

Many policies still follow NIST's 2003 Appendix A. SP 800-63B reversed it:

Old rule Current stance Why
Force a change every 90 days ❌ Not recommended Users make predictable edits (password1→password2) and security drops
Require upper + lower + digit + symbol ❌ Not recommended Pushes users toward patterns like P@ssw0rd1
Security questions ❌ Remove Answers are usually public, such as a surname or school
Minimum length ≥ 8 ✅ Keep (12+ preferred) Length is the only reliably effective complexity source
Screen breached passwords ✅ Strongly recommended Cuts off credential stuffing's ammunition
Allow pasting ✅ Recommended Blocking paste blocks password managers

The correct trigger for a password change is evidence: account anomalies, the password appearing in a breach corpus, or a security incident — not a calendar.

Breach Screening: k-Anonymity Without Sending Plaintext

"Check whether this password is in a breach corpus" sounds like it requires uploading the plaintext. It does not. HIBP's Range API uses k-anonymity:

  1. The client hashes the password with SHA-1, only for the query, never for storage;
  2. It sends only the first five characters of that hash;
  3. The server returns every suffix matching that prefix, usually a few hundred;
  4. The client compares locally to see whether the full hash appears.

The server never sees the password or even the complete hash. Screening must end in an action: reject at signup and ask for another password, and reject at password change. A warning with no enforcement is the same as not screening.

MFA and Passkeys, Ordered by Phishing Resistance

Factor Phishing-resistant SIM-swap resistant UX Verdict
Passkeys / WebAuthn ✅ Strong ✅ Best: one biometric tap First choice
Hardware security key ✅ Strong ✅ Good, but must be carried High-privilege accounts
TOTP app ❌ Relayable in real time ✅ Medium: type six digits Solid runner-up
SMS ❌ ❌ Good Fallback only
Email code ❌ ✅ Medium As strong as the mailbox

Why passkeys resist phishing by construction: the private key is bound to a specific domain, and the browser or OS only signs for a matching domain. A fake site can copy the interface pixel for pixel, but it cannot obtain a signature valid on the real domain. TOTP cannot do this: the user types six digits into the fake site and the attacker relays them immediately.

The main threat to SMS is not interception but SIM swap: an attacker uses fabricated identity to port the number, and every code lands on their phone — often unnoticed.

Server-Side Checklist

Storage: One Decision Matters

Use a KDF. Not reversible encryption, not a bare hash. Whether that is Argon2id (preferred) or bcrypt at cost ≥ 12, how to derive parameters, and how to migrate legacy hashes are all in the password hashing guide. Two things matter here:

  • a unique random salt per user, generated by the library — never hand-build salt + SHA; keep the algorithm and parameter identifiers so you can upgrade at the next login;
  • never store plaintext, and never switch to reversible encryption "for later display" — a leaked key leaks everything.

The Login Endpoint

  • Rate-limit by account: IP limits punish legitimate users behind NAT.
  • Escalate delays after failures. A 15-minute lock beats a permanent one, which is itself a denial-of-service hole.
  • Never distinguish "no such user" from "wrong password" in failure messages; that is an account-enumeration API.
  • Reset tokens: single-use, ≤ 30 minutes, burned on use; generate them with the token generator.

Transport and Logging

  • HTTPS everywhere; redirect the login page from HTTP with a 301.
  • Never log passwords, full tokens, or reset links.
  • Never put tokens in a URL query: they land in browser history, Referer headers, and proxy logs.

Monitoring

  • Watch for new devices, unusual locations, and bursts of failures.
  • Force a reset on any breach-screening hit.

Personal Checklist

  1. Use an independent random password for every important site, via a manager rather than memory.
  2. Make the master password a 4–6 word passphrase and enable MFA on it.
  3. Enable passkeys on your email and password manager first — if either falls, every other account can be reset through it.
  4. Choose passkeys over SMS wherever offered, and run key accounts through breach detection periodically.

Reproducible: Entropy Only Holds for Random Generation

import math
def entropy(length, pool): return length * math.log2(pool)
print(f"8 lowercase:       {entropy(8, 26):.1f} bits")   # -> 37.6
print(f"8 alnum:           {entropy(8, 62):.1f} bits")   # -> 47.6
print(f"12 alnum:          {entropy(12, 62):.1f} bits")  # -> 71.5
print(f"16 alnum:          {entropy(16, 62):.1f} bits")  # -> 95.3

The formula holds only for random generation: a human-chosen 8-character mixed password is nominally 47.6 bit and often below 30. Measure with the password strength analyser instead.

Frequently Asked Questions

I used uppercase, digits and symbols in an 8-character password. Why is it still rated weak?

Because the charset formula computes an ideal value for randomly generated passwords, and yours is not random. E = log₂(R^L) yields about 52.6 bit for 8 characters over a 95-character set, but only on the assumption that every character is independently and uniformly random. Human-chosen passwords almost always fall into patterns: in P@ssw0rd1, P@ssw0rd is a dictionary word with fixed substitutions and 1 is a common suffix — an attacker never needs 95^8 attempts, just a few tens of thousands of tries against a dictionary-plus-substitution rule list. That is why modern strength estimators such as zxcvbn do not count character sets; they recognise dictionary words, keyboard sequences, repeats, dates, and common substitutions, then estimate how many guesses those patterns require. The upshot: length beats character variety. Twelve random lowercase letters (about 56 bit) are far stronger than eight characters mixing four classes (nominally 52.6 bit, realistically under 30).

Are password managers safe? If the master password is cracked, is everything lost?

They are the best value option available, and the risk is far smaller than reusing one password everywhere. Their value is not merely remembering — it is letting every site have its own random long password, which eliminates credential stuffing (one breach compromising all your accounts). On the master password: 1. it must be a high-entropy passphrase (four to six random words, not a lyric you like); 2. MFA must be on, so even if the master password leaks, an attacker who obtains the cloud vault still cannot sign in; 3. pick a product with a modern KDF (Argon2id, or PBKDF2/scrypt at a high cost factor) — that determines what offline brute force against the vault file costs. Measure your master password's entropy with the [password strength checker](/password-strength.html) before deciding whether to change it.

Should I force users to change passwords every 90 days?

No. NIST SP 800-63B explicitly advises against mandatory periodic rotation, and the reasoning is empirical: users who are forced to change passwords tend to make small, predictable edits (password1 → password2 → password3) or write them on a sticky note, so overall security drops. NIST now recommends changing only on evidence: detected account anomalies, the password appearing in a breach corpus, or a security incident. Two other long-standing rules have been reversed as well: 1. mandatory uppercase-plus-symbol complexity rules — they push users toward predictable patterns like P@ssw0rd1; replace them with a minimum length (12 or more is a good bar) plus breach screening; 2. security questions — the answers are usually public (mother's maiden name, alma mater), so remove them entirely.

Why are SMS codes considered insecure, and what should I use instead?

The main threat to SMS codes is not interception but SIM swapping — an attacker convinces the carrier, with fabricated identity, to port your number onto their SIM, and every SMS code then lands on their phone, often without you noticing. SMS is also plaintext and lingers in the notification shade. Alternatives, ordered by strength: 1. Passkeys / WebAuthn (FIDO2) — public-key based, the private key never leaves the device, and phishing-resistant by construction (credentials are bound to a domain, so a fake site cannot obtain a signature); this is the best option today. 2. Hardware security keys (YubiKey and similar) — same mechanism, good for high-privilege accounts. 3. TOTP apps — far better than SMS, but still vulnerable to real-time phishing proxies where the attacker relays the genuine site to you. 4. SMS — a fallback only, never the sole factor. When prioritising your own accounts, enable passkeys on your email and your password manager first: if either falls, every other account can be reset through it.

← Back to Blog