Complete Guide to Password Security & Generation
Passwords remain the primary authentication mechanism for billions of accounts worldwide, despite the emergence of biometrics, hardware keys, and passkeys. A weak password is the single most common entry point for cyberattacks โ responsible for over 80% of data breaches according to the 2023 Verizon DBIR report. This guide covers everything you need to know about password generation, strength, entropy, attacks, and best practices.
How This Password Generator Works
Our generator uses the Web Crypto API โ specifically crypto.getRandomValues() โ which provides cryptographically secure pseudo-random numbers (CSPRNG). This is the same randomness source used by your browser for TLS/SSL encryption when you visit HTTPS websites. It is fundamentally different from Math.random(), which uses a deterministic algorithm that can be predicted if an attacker knows the seed.
The process works as follows: (1) You select your desired character types (uppercase, lowercase, numbers, symbols), (2) The generator builds a character pool from your selections, (3) For each character position, it requests a random value from the CSPRNG, (4) The random value is mapped to an index in the character pool, (5) The resulting characters are assembled into your password. This process ensures that every character has an equal probability of being selected, and the output is unpredictable even to someone with access to the generator's source code.
Understanding Password Entropy
Entropy is the standard measure of password strength, expressed in bits. It quantifies how unpredictable a password is โ essentially, how many guesses an attacker would need in the worst case. The formula is straightforward:
Entropy = Length ร logโ(Pool Size)
Where Pool Size = number of possible characters
Examples:
8-char lowercase only: 8 ร logโ(26) = 8 ร 4.7 = 37.6 bits
12-char all types: 12 ร logโ(95) = 12 ร 6.57 = 78.8 bits
16-char all types: 16 ร logโ(95) = 16 ร 6.57 = 105.1 bits
32-char all types: 32 ร logโ(95) = 32 ร 6.57 = 210.2 bits
| Character Set | Pool Size | Bits/Char |
|---|---|---|
| Lowercase only (a-z) | 26 | 4.70 |
| + Uppercase (A-Z) | 52 | 5.70 |
| + Numbers (0-9) | 62 | 5.95 |
| + Symbols (!@#$...) | 95 | 6.57 |
| Full Unicode (dangerous) | 100,000+ | 16.6+ |
As a rule of thumb: below 40 bits is trivially crackable, 40-60 bits can be cracked with moderate resources, 60-80 bits requires significant investment, and above 80 bits is considered very strong for most practical purposes. The NSA recommends at least 80 bits for secret-level classification. For most personal accounts, 95+ bits (a 16-character password with all character types) provides excellent protection.
How Attackers Crack Passwords
1. Brute Force Attack
The attacker tries every possible combination of characters systematically: aaaa, aaab, aaac... This is the most naive approach but is guaranteed to eventually succeed. The time required depends on the password's entropy and the attacker's computational power. A modern GPU like the NVIDIA RTX 4090 can attempt about 164 billion MD5 hashes per second. Against slower, more secure algorithms like bcrypt or Argon2, this drops to perhaps 10,000-100,000 per second โ which is exactly why these algorithms exist.
2. Dictionary Attack
Instead of trying all combinations, the attacker uses a pre-compiled list of common passwords, words from dictionaries, leaked password databases, and common patterns (Password123!, Qwerty2024, etc.). This is devastatingly effective because humans are predictable: the most common password in 2023 was "123456", used by over 4.5 million people. Dictionary attacks can crack a huge percentage of passwords in minutes, even with billions of candidates.
3. Rule-Based Attack
This extends dictionary attacks by applying transformation rules: capitalizing the first letter, appending a number, replacing 'a' with '@', adding '!' at the end, etc. Tools like Hashcat support thousands of rules. So "password" becomes "Password", "Password1", "P@ssw0rd", "Password1!", and thousands more variations โ all tried automatically.
4. Rainbow Tables
A rainbow table is a massive pre-computed database of password hashes. Instead of cracking a hash on the fly, the attacker simply looks it up. This is why salting (adding random data before hashing) is essential โ it makes rainbow tables useless because the same password produces a different hash with each unique salt. Modern password systems all use salting, but legacy systems and some poorly-designed applications may not.
5. Credential Stuffing
Attackers take username/password pairs from data breaches and try them on other websites. This works because 65% of people reuse passwords across accounts. If your email and password were leaked in one breach, attackers will automatically try that combination on your banking, social media, and shopping accounts.
Crack Time Estimates by Password Type
| Password | Entropy |
|---|---|
| 123456 | ~0 bits |
| password1 | ~14 bits |
| Tr0ub4d&3 | ~52 bits |
| J4v4$cr1pt! | ~60 bits |
| 7xK#mP9$vL2nQw@ | ~95 bits |
| correct-horse-battery-staple | ~124 bits |
| 32-char random (all types) | ~210 bits |
The 100 Most Common Passwords (Avoid All of These)
According to leaked databases analyzed by security researchers, these are consistently the most used passwords year after year. If yours is on this list, change it immediately:
These 25 passwords account for over 2% of all passwords in use. Every single one can be cracked in under 1 second.
NIST SP 800-63B Password Guidelines (2024)
The National Institute of Standards and Technology (NIST) publishes the gold-standard guidelines for digital identity authentication. Their current guidelines (SP 800-63B Revision 3, with 2024 updates) include these key recommendations:
- Minimum 8 characters โ but encourage longer passwords (15+ characters recommended).
- Maximum 64 characters โ to prevent denial-of-service attacks from extremely long passwords.
- No composition rules โ don't force users to include uppercase, numbers, and symbols. This leads to predictable patterns like "Password1!".
- No password hints โ hints make it easier for attackers, not users.
- Check against breached password lists โ if a password appears in known breaches, reject it.
- No periodic forced changes โ forcing changes every 90 days makes users pick weaker passwords (Password1!, Password2!, etc.).
- Use rate limiting and lockouts โ slow down online guessing attacks.
- Store passwords using bcrypt, Argon2, or scrypt โ never use MD5 or SHA-1 for passwords.
Random Passwords vs Passphrases
Random Password
xK#9mP$vL2nQw@7jR!
High entropy per character. Short but very strong. Hard to type and remember. Best for passwords stored in a password manager.
Passphrase
correct-horse-battery-staple
Lower entropy per character but longer. Easy to type and remember. Can achieve high total entropy through length alone. Good for master passwords.
The famous XKCD comic #936 popularized the passphrase approach: four random words give about 44 bits of entropy each (from a 2048-word dictionary), totaling ~44 bits. But "correct-horse-battery-staple" is 28 characters from a pool of ~27 characters, giving ~124 bits โ actually much more than the comic's simplified calculation. For maximum security, use random passwords stored in a password manager, and use a strong passphrase as your master password that you actually memorize.
Password Hashing Algorithms Compared
| Algorithm | Security |
|---|---|
| MD5 | Broken |
| SHA-1 | Broken |
| SHA-256 | Weak for passwords |
| PBKDF2 | Adequate |
| bcrypt | Strong |
| scrypt | Very strong |
| Argon2 | Strongest |
Why You Need a Password Manager
The average person has 100+ online accounts. It is mathematically impossible for any human to remember 100 unique, strong passwords. People cope by reusing passwords (dangerous) or using weak, memorable ones (equally dangerous). A password manager solves this completely:
- Generates unique passwords for every account โ no reuse, ever.
- Auto-fills login forms โ saves time and prevents typos.
- Encrypts your vault with your master password โ even the service provider can't read your passwords.
- Detects breaches โ alerts you if your email or passwords appear in known data leaks.
- Syncs across devices โ your passwords are available on phone, tablet, and computer.
- Stores more than passwords โ credit cards, secure notes, IDs, Wi-Fi passwords.
Recommended password managers: Bitwarden (free, open-source), 1Password (excellent UX, paid), KeePassXC (free, offline, open-source). Avoid browser-built-in managers (Chrome, Firefox) as they provide weaker encryption and fewer features.
Two-Factor Authentication (2FA) โ Your Second Lock
Even the strongest password can be compromised through phishing, keylogging, or database breaches. 2FA adds a second verification factor that an attacker would also need. The three types of factors are:
Something You Know
Password, PIN, pattern
Something You Have
Phone, hardware key, SMS
Something You Are
Fingerprint, face, voice
2FA methods ranked by security:
- Hardware security keys (YubiKey, Titan) โ Phishing-resistant, strongest option. Uses FIDO2/WebAuthn protocol.
- Authenticator apps (Google Auth, Authy, Aegis) โ TOTP codes that change every 30 seconds. Not phishing-resistant but much better than SMS.
- SMS codes โ Better than nothing but vulnerable to SIM swapping and interception. Being phased out by major services.
- Email codes โ Similar to SMS but delivered via email. Vulnerable if your email is compromised.
Passkeys: The Future of Authentication
Passkeys (FIDO2/WebAuthn) are emerging as the passwordless replacement. They use public-key cryptography stored on your device (phone, computer, or hardware key) and biometric authentication (fingerprint, face). You never type a password โ your device proves your identity cryptographically. Passkeys are immune to phishing (the authentication is tied to the actual website domain), immune to credential stuffing (there's no password to leak), and immune to replay attacks. Google, Apple, Microsoft, and major services are rapidly adopting passkeys. While they won't eliminate passwords overnight, they represent the most significant improvement in authentication security in decades.
10 Rules for Bulletproof Password Security
Privacy: How This Tool Protects You
Our password generator is designed with a zero-trust privacy model:
- No server communication: The JavaScript runs entirely in your browser. No API calls, no form submissions, no telemetry.
- No cookies or local storage for passwords: Passwords are never written to localStorage, sessionStorage, or cookies. The session history exists only in JavaScript memory and vanishes when you close the tab.
- No analytics on passwords: We don't track which options you choose, what length you use, or what passwords are generated.
- Clipboard is auto-cleared: When you copy a password, the clipboard clears after 30 seconds (on supported browsers) to prevent other apps from reading it.
- Works offline: After the page loads, the generator works without internet. No data can be exfiltrated because there's no network activity.