Password Generator
Generate passwords and PINs from the browser's cryptographic randomness, see exactly how strong they are, and check a password you already use against common passwords, words and patterns.
Overview
A password is as strong as the number of guesses it takes to find it. For a password drawn at random that number follows from two figures, how many characters are drawn and from how large a set, and is written in bits of entropy: every bit doubles the guesses. A password a person made up is weaker than its characters suggest, because attackers try common passwords, words and patterns first. This tool makes random passwords and PINs, and rates typed ones with both facts in mind.
Web interface
Choose Password or PIN, set the length and the options, and press Generate, Ctrl/⌘ + Enter or the circular arrow in the field. The eye shows or hides the result, the copy icon copies it. Under it are the strength bar, the entropy, the time a brute-force attack would take and the size of the character set.
To check a password you already have, type or paste it into the field: it is masked, the options follow it, and a list says what weakens it. History, off by default, keeps the last 20 generated values in the page and forgets them on reload.
How passwords are drawn
| Option | Characters |
|---|---|
| Uppercase | A to Z, 26 |
| Lowercase | a to z, 26 |
| Numbers | 0 to 9, 10 |
| Symbols | !@#$%^&*()_+-=[]{}|;:,.<>?, 26 |
| Umlauts | äöüßÄÖÜ, 7 |
| Exclude ambiguous | removes 0, O, I, l and 1 |
| No repeated characters | draws each character at most once |
| Custom exclusions | removes any characters you list |
Every character is drawn with crypto.getRandomValues, the browser's cryptographic random source.
Random numbers that would favour some characters over others, as a plain modulo does, are thrown away and drawn
again, so every character of the set has exactly the same chance.
The entropy of a generated password is exact: the length times log2 of the set size. The default, 16 characters from the 88 of the four main sets, is 16 × log2 88 = 103 bits. Without repeated characters it is log2 88 + log2 87 + … instead. A password may be 4 to 128 characters long.
A PIN is drawn from the ten digits, 3 to 20 of them, and can leave out zero, repeated digits and runs such as
1234 or 4321. A four-digit PIN has 13 bits: it is meant for a device that locks after a
few wrong tries, not for anything that can be guessed offline.
How strength is rated
| Entropy | Rating |
|---|---|
| under 28 bits | Very Weak |
| 28 to 35 | Weak |
| 36 to 59 | Fair |
| 60 to 127 | Strong |
| 128 and more | Very Strong |
A generated password is rated by how it was drawn. A typed password is estimated in two steps. First from its characters: 26 for lowercase, 26 for uppercase, 10 for digits, 32 for other symbols and 7 for umlauts, reduced for identical characters, runs, repetitions and keyboard rows. Then it is read by zxcvbn, Dropbox's estimator, which knows common passwords, dictionary words, names, dates and keyboard patterns. When zxcvbn recognises any of those, its estimate counts and its warning is shown. When it recognises nothing, the estimate from the characters stays, because zxcvbn prices a stretch it cannot place at only 10 guesses per character.
| Typed | Rating |
|---|---|
Password123! | 15 bits, Very Weak: This is similar to a commonly used password |
Tr0ub4dor&3 | 0 bits, Very Weak: the bad example of xkcd 936, and so famous that every cracking list tries it first |
correct horse battery staple | 0 bits, Very Weak: the good example of the same comic, famous for the same reason |
correct horse battery clip | 66 bits, Strong: zxcvbn recognises the common words and counts them as words |
An estimator knows the patterns it knows: zxcvbn on its own does not recognise Tr0ub4dor&3
and would rate it by its characters. So a handful of famous passwords are known to the tool by name, the two
from xkcd 936, hunter2, swordfish and 12345, and each gets a line of its
own. The comic's advice stands: generate instead of inventing, and if you pick words, pick them at random.
zxcvbn is 800 KB and is fetched from this site the first time a password is typed, never for a generated
one.
Attack scenarios
The brute-force time is how long an attacker needs on average, half of all possibilities, at the rate of the selected scenario. The rates are the tool's assumptions for one current graphics card running Hashcat against a stolen hash, and for guessing online:
| Scenario | Guesses per second |
|---|---|
| MD5 | 221 billion |
| SHA-256, the default | 28.4 billion |
| bcrypt | 10,000 |
| Online | 100, a login form with rate limiting |
A click on a row selects it. The table shows the time for every scenario at once, which makes the point of a slow hash such as bcrypt visible: the same password lasts millions of times longer.
No API
There is no API for this tool, deliberately: a password generated on a server has been seen by that
server. On the command line, openssl rand -base64 24 makes a random password, and in Python
the secrets module does.
Privacy
Nothing leaves the browser. Passwords and PINs are drawn on the page, a typed password is rated on the page, and zxcvbn runs locally once it has loaded. History lives in the page only, and Copy writes to the clipboard only when you press it.