Quickly generate strong passwords
Inspired once again by XKCD's comic strip on safe and easy-to-remember password, I present you with a one-liner for bash, to obtain a 4-word password with words from the system dictionary.
pool="/dev/urandom"; dict="/usr/share/dict/words"; l=$(wc -l "$dict" | awk '{ print $1; }'); while true;\ do for n in $(seq 1 5); do echo -n "$n) "; for i in $(seq 1 4); do r=$(($(od -N2 -An -i $pool)%$l));\ w=$(cat "$dict" | head -n $r | tail -n 1); echo -n "$w "; done; echo; done; read; done;
Usage: you'll be presented with 4 password possibilities. If you find one interesting then learn it; otherwise press enter, and a new set will be shown. Ctrl+c
to terminate.
Example output:
1) compatibles literates bemused chevron 2) motel compels mineralogist's maddest 3) mnemonic monograms Vasquez bayoneting 4) Hellenize evidence's impressionistic cooling 5) DeGeneres's captions inadvisable Latvian
About safeness
Why words instead of a "classic" gibberish password? Here's the XKCD comic I was talking about:
As for a non computer-based way of selecting a passphrase, you may be interested in the diceware generation method. But then again, you'll still probably need to type it somewhere, so it's not going to be much more safe.