Password generation one-liners

Sometimes you need to generate a password using only commonly available tools. These commands generate passwords given a required strength in bits. For comparison, an 8-character alphanumeric password has a strength of log₂ 36⁸ ≈ 41 bits.

Generate an 12 × 8 = 96 bit password with the Base32 alphabet (using coreutils' base32 command):

Generate an 16 × 8 = 128 bit password with the Base64 alphabet (using python:

Generate a 32 × 8 = 256 bit passphrase using the Electrum wordlist:

On the web

Diceware secure passphrase generator

Entropy level recommendations

See Lenstra Updated Equations. This reckons 96 bits protects you until 2040, 112 bits until 2066 and 128 bits until 2090.

The Diceware Passphrase FAQ says 6 use at least 6 words for a password manager application (i.e., offline attacks). But that's only 6 * log2(7776) = ~77 bits...

Word lists


CategoryTechnote

robots.org.uk: PasswordGeneration (last edited 2020-05-09 12:52:50 by sam)

© Sam Morris <sam@robots.org.uk>.
Content may be distributed and modified providing this notice is preserved.