Passphrase generation

2011-09-12

A password generator inspired by XKCD #936.

Example:

~$ passphrase.lhs -h
Usage: passphrase.lhs [-v|--verbose] [word_count (default=4)]
~$ passphrase.lhs 3
verdant resolution's wicks
~$ passphrase.lhs 3 --verbose
Ultrasuede stalkings sealers
50 bits of entropy

To use with keepassx or similar password manager, just save it to clipboard:

 ~$ passphrase.lhs | xsel -ib

P.S. An even simpler method, which doesn't require anything, but coreutils:

$ shuf /usr/share/dict/words | head -4 | tr '\n' ' '; echo