Password Security Best Practices: How to Create and Manage Strong Passwords
Passwords are the first line of defense for virtually every online account you have. Yet most people still use weak, reused passwords — and pay the price when one account breach cascades into many. In this guide, we cover exactly what makes a password strong, how attackers crack passwords, and the practical steps you can take to protect yourself.
How Attackers Crack Passwords
Understanding attack methods is the first step to defending against them.
- Dictionary attacks: Automated tools try every word in a dictionary, plus common substitutions (p@ssw0rd, l3eet speak, etc.). Any recognizable word — even with substitutions — will be cracked.
- Brute force: Try every possible combination of characters. Infeasible for long passwords, but trivially fast for anything under 8 characters.
- Credential stuffing: After a data breach, attackers try leaked username/password pairs on other services. If you reuse passwords, one breach unlocks many accounts.
- Rainbow table attacks: Precomputed lookup tables of hash → password mappings. Defeated by salting (which all modern password hashing algorithms use).
- Phishing: Trick you into typing your password into a fake site. No amount of password strength protects against this — use MFA instead.
What Makes a Password Strong
Password strength is measured in entropy — the number of bits required to represent all possible values. The higher the entropy, the longer a brute-force attack takes.
| Password | Entropy | Brute Force Time (GPU) | Rating |
|---|---|---|---|
| password | ~18 bits | Instant | Terrible |
| P@ssw0rd! | ~28 bits | Seconds | Weak |
| Tr0ub4dor&3 | ~44 bits | Hours to days | Fair |
| sJ#8mK!2vX | ~66 bits | Centuries | Good |
| correct-horse-battery-staple | ~44–55 bits | Centuries | Great (memorable) |
| Random 20-char mixed | ~132 bits | Longer than the universe | Excellent |
The key takeaways: length matters more than complexity, and recognizable words or patterns (even with substitutions) are weak regardless of how they look to a human.
The Modern Approach: Length Over Complexity
Old-school password rules said: use uppercase, lowercase, numbers, and symbols. NIST's 2017 guidelines (updated in SP 800-63B) reversed this advice:
- Prioritize length — minimum 8 characters, recommend 15+, allow up to 64 or more
- Drop mandatory complexity rules — they cause users to make predictable substitutions (P@ssword) that don't actually increase security
- Check against known-breached passwords — reject passwords that appear in data breach lists
- Drop mandatory periodic rotation — forced rotation leads to weaker passwords (Password1 → Password2) and no measurable security benefit
The Password Rule: Unique + Long + Random
Every account should have a password that is:
- Unique — not used anywhere else. One breach shouldn't expose all your accounts.
- Long — at least 16 characters. 20+ for important accounts.
- Random — not based on words, names, dates, or patterns you might choose yourself.
Following this rule for every account is humanly impossible — unless you use a password manager.
Password Managers: The Essential Tool
A password manager is software that generates, stores, and autofills passwords for every site. You remember one strong master password; the manager handles the rest.
Benefits:
- Every account gets a unique, random, 20+ character password
- Autofill detects phishing sites (if the URL doesn't match, it won't fill)
- Password breach monitoring — alerts you when a site you use is breached
- Syncs across all your devices
Reputable password managers: Bitwarden (open source, free tier), 1Password, Dashlane, Keeper. Built-in options like Apple Keychain and Google Password Manager are also significantly better than no manager at all.
Passphrases: For Passwords You Must Remember
There are a few passwords you must memorize — your password manager master password, your computer login, your email account. For these, use a passphrase: four or more random, unrelated words chosen from a large list.
correct-horse-battery-staple purple-suitcase-river-laptop-22 Monday-fog-ceramic-uphill
A 4-word passphrase from the Diceware word list (7776 words) has about 51 bits of entropy — stronger than most 8-character "complex" passwords and far more memorable. A 5-word passphrase is even better.
The key: the words must be truly random. Avoid phrases you'd naturally come up with, lyrics, quotes, or anything meaningful. Roll dice or use a generator to select words.
Two-Factor Authentication (2FA / MFA)
Even a perfect password can be stolen via phishing. Multi-factor authentication (MFA) requires a second factor — something you have, not just something you know — making stolen passwords useless without that second factor.
MFA methods, from weakest to strongest:
- SMS codes — convenient, but vulnerable to SIM-swapping attacks. Better than nothing.
- Authenticator apps (Google Authenticator, Authy, 1Password) — generate time-based one-time codes (TOTP). Much better than SMS.
- Hardware security keys (YubiKey, Google Titan) — physical device plugged in or tapped via NFC. Immune to phishing. Best option for high-value accounts.
- Passkeys — emerging standard replacing passwords entirely with public-key cryptography. Phishing-resistant, no password to steal.
Common Mistakes to Avoid
- Reusing passwords — the single most dangerous habit. One breach exposes everything.
- Predictable patterns — "Summer2024!", "CompanyName1", or anything with a known word plus numbers
- Sharing passwords — even with family or coworkers. Use shared vaults in password managers instead.
- Password hints — hint answers are often guessable or findable through social media
- Security questions — "mother's maiden name", "first school" — this information is public or guessable. Use random gibberish answers and store them in your password manager.
- Writing passwords on paper — physical security is real, but it's far better than reused digital passwords
- Changing only one character — Password1 → Password2. Attackers know this pattern.
Generating Cryptographically Secure Passwords in Code
When building systems that generate passwords or tokens, use a cryptographically secure random number generator:
// JavaScript — use crypto.getRandomValues, not Math.random()
function generatePassword(length = 20) {
const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*';
const array = new Uint32Array(length);
crypto.getRandomValues(array);
return Array.from(array, n => chars[n % chars.length]).join('');
}
// Python — use secrets, not random
import secrets, string
alphabet = string.ascii_letters + string.digits + string.punctuation
password = ''.join(secrets.choice(alphabet) for _ in range(20))
Math.random() and Python's random module are NOT cryptographically secure — they use predictable pseudo-random algorithms. Always use crypto.getRandomValues() or the secrets module for security-sensitive generation.
Password Hashing for Developers
If you're building a system that stores passwords, never store them in plain text or with reversible encryption. Hash them using a slow, memory-hard algorithm designed for passwords:
- Argon2id — OWASP's recommended choice in 2025. Winner of the Password Hashing Competition.
- bcrypt — widely supported, proven track record, easy to use in most frameworks
- scrypt — memory-hard, good alternative to bcrypt
Never use MD5, SHA-1, SHA-256, or SHA-512 for passwords — these are too fast. See our hash functions explainer for the full breakdown.
Frequently Asked Questions
How long should a strong password be?
At least 16 characters for most accounts, 20+ for important ones like email, banking, and your password manager. Length is the dominant factor in password strength — a 16-character random password is vastly more secure than an 8-character one with lots of special characters.
Should I use a password manager?
Yes, without question. A password manager is the single most impactful thing you can do for your password security. It lets you use a unique, random, long password for every account without memorizing any of them. Use a reputable manager like Bitwarden, 1Password, or Dashlane.
What is a passphrase and is it more secure than a password?
A passphrase is four or more random, unrelated words (e.g., "correct-horse-battery-staple"). A 4-word Diceware passphrase has about 51 bits of entropy — stronger than most 8-character "complex" passwords and far more memorable. Use passphrases for credentials you must memorize (master password, computer login).
How often should I change my password?
Only when there's a reason to: a suspected breach, if someone else may have seen it, or if the service has been compromised. NIST no longer recommends periodic rotation for its own sake — forced rotation leads users to make predictable, incremental changes (Password1 → Password2) that don't improve security.