# Password strength checker and generator

> Check a password's entropy in bits and its average brute-force crack time at a chosen guess rate, or generate a password from a reproducible seed.

Interactive version: https://www.calcopenly.com/programming/password-strength-generator
Subject: Programming and tech calculators

Entropy counts how many guesses a randomly chosen password could take: H = L × log2 N bits, where L is the length and N the size of the character pool (26 lowercase, 26 uppercase, 10 digits and 33 symbols including space). A brute-force search finds the password after N^L ÷ 2 guesses on average, so the crack time is that number divided by the attacker's guesses per second.

The default, Tr0ub4dor&3 from the xkcd comic 936, draws on all 95 printable ASCII characters across 11 positions, which gives 72.3 bits; at 10 billion guesses per second an exhaustive search would average 9,010 years.

That figure is an upper bound, because it assumes every character was picked at random. Tr0ub4dor&3 is a dictionary word with common substitutions, which the comic puts at about 28 bits. Generated passwords come from xoshiro256** and a 64-bit seed, so they hold at most 64 bits whatever their length.

## Inputs

- **I want to** (options: Check a password, Generate a password)
- **Password**: Checked on this device only; nothing is stored.
- **Length**
- **Lowercase a–z**
- **Uppercase A–Z**
- **Digits 0–9**
- **Symbols such as ! # % &**
- **Leave out look-alikes (I l 1 O 0 o)**
- **Seed**: A whole number from 0 to 2^64 − 1. The same seed and settings always give the same password.
- **Attacker's guesses per second**

## Results

- Entropy (bits) — main result
- Generated password
- Length (characters)
- Character pool (symbols)
- Average guesses to find it
- Average time to crack in seconds (s)
- Average time to crack

## Formula

$$
\begin{aligned} H &= L \log_2 N \\ t &= \frac{2^{H-1}}{R} = \frac{N^L}{2R} \\ R &= \text{guesses per second}\end{aligned}
$$

## Worked examples

### Tr0ub4dor&3

- I want to: Check a password
- Password: Tr0ub4dor&3
- Attacker's guesses per second: 1e10
- **Character pool: 95 symbols**
- **Length: 11 characters**
- **Entropy: 72.3 bits**
- **Average time to crack in seconds: 284,400,000,000 s**
- Checked against: Python 3.8: 11 * math.log2(95) = 72.2684…; Decimal(95)**11 / 2 / Decimal('1e10') = 284400046138.22998… s

### password

- I want to: Check a password
- Password: password
- Attacker's guesses per second: 1e10
- **Character pool: 26 symbols**
- **Entropy: 37.6 bits**
- **Average guesses to find it: 104,400,000,000**
- **Average time to crack in seconds: 10.44 s**
- Checked against: Python 3.8: 8 * math.log2(26) = 37.6035…; 26**8 // 2 = 104413532288; / 1e10 = 10.4414 s

### Single character (edge)

- I want to: Check a password
- Password: a
- Attacker's guesses per second: 10
- **Character pool: 26 symbols**
- **Length: 1 character**
- **Entropy: 4.7 bits**
- **Average guesses to find it: 13**
- **Average time to crack in seconds: 1.3 s**
- Checked against: Python 3.8: math.log2(26) = 4.7004; 26 / 2 = 13 guesses; 13 / 10 = 1.3 s

### Seeded 16-character password

- I want to: Generate a password
- Length: 16
- Seed: 2026
- Attacker's guesses per second: 1e10
- **Generated password: Ro_y2y-Z^~5cQiBL**
- **Character pool: 94 symbols**
- **Entropy: 104.9 bits**
- Checked against: Independent Python 3.8 port of splitmix64.c and xoshiro256starstar.c with the same rejection rule; 16 * math.log2(94) = 104.87

### Six-digit PIN from seed 0

- I want to: Generate a password
- Length: 6
- Lowercase a–z: no
- Uppercase A–Z: no
- Symbols such as ! # % &: no
- Seed: 0
- Attacker's guesses per second: 1e10
- **Generated password: 028278**
- **Character pool: 10 symbols**
- **Entropy: 19.9 bits**
- Checked against: Independent Python 3.8 xoshiro256** port; 6 * math.log2(10) = 19.93

### Largest seed, no look-alikes (edge)

- I want to: Generate a password
- Length: 12
- Leave out look-alikes (I l 1 O 0 o): yes
- Seed: 18446744073709551615
- Attacker's guesses per second: 1e10
- **Generated password: SP}R=Pykuu3K**
- **Character pool: 88 symbols**
- Checked against: Independent Python 3.8 xoshiro256** port with 'Il1O0o' removed from the 94-character alphabet

## Questions

### How long should a password be according to NIST?

NIST SP 800-63B-4 (2025) requires at least 15 characters for a password used on its own and at least 8 when it is one factor of a multi-factor login, and services should accept passwords of at least 64 characters. It forbids composition rules such as forced symbols and periodic forced changes, and instead requires checking each new password against a blocklist of common and breached passwords.

### How long would it take to crack my password?

It depends on the pool, the length and the attacker's speed. A random 8-letter lowercase password has 26^8 ≈ 2.1 × 10^11 combinations and falls in about 10 seconds on average at 10 billion guesses per second, a fast offline attack on a leaked hash. A random 16-character password from 94 printable symbols would take about 5.9 × 10^13 years at the same speed.

### What is password entropy?

Password entropy is the base-2 logarithm of the number of equally likely passwords the choosing method could produce, in bits; each extra bit doubles the guesses needed. A random password of length L from N symbols has L × log2 N bits, so 8 lowercase letters give 37.6 bits. It rates how the password was chosen, not how it looks, which is why human-picked words score far lower.

### Is a passphrase better than a complex password?

Usually, if the words are chosen at random. Four words drawn from the EFF's 7,776-word dice list give 4 × log2 7,776 ≈ 51.7 bits, and six give 77.5 bits, more than a random 11-character password from all 95 printable characters (72.3 bits), while being easier to type and remember. Words a person picks, or a known quote, are far weaker.

### Is this password generator safe for real accounts?

Only with a secret, random seed. The generator is reproducible by design: xoshiro256** seeded with a 64-bit number, so anyone who knows the seed and settings gets the same password, and it never holds more than 64 bits of entropy. For everyday accounts, a password manager's generator is the better choice because it draws from the operating system's cryptographic random source.

### How accurate is the password strength checker and generator?

Accuracy depends on your inputs and the method's assumptions. Decimal arithmetic uses 50 significant digits, but estimates, numerical methods and source data can be less precise; the displayed rounding does not remove those limits. It is checked against 6 worked examples whose answers come from independent sources; for example, “Tr0ub4dor&3” is checked against Python 3.8: 11 * math.log2(95) = 72.2684…; Decimal(95)**11 / 2 / Decimal('1e10') = 284400046138.22998… s.

### Where does the method come from?

NIST SP 800-63B, Digital Identity Guidelines: Authentication — memorized secrets and rate limiting; Blackman & Vigna, Scrambled linear pseudorandom number generators, ACM TOMS 47(4), 2021 — xoshiro256** reference code.

## Sources

- [NIST SP 800-63B, Digital Identity Guidelines: Authentication — memorized secrets and rate limiting](https://pages.nist.gov/800-63-4/sp800-63b.html)
- [Blackman & Vigna, Scrambled linear pseudorandom number generators, ACM TOMS 47(4), 2021 — xoshiro256** reference code](https://prng.di.unimi.it/)
