Yet another xkcd-style password generator.
Word list is taken from hermitdave/FrequencyWords.
Note: At the moment all sample commands below assume you are executing from the base directory of a clone of this repository.
This is just a wrapper around shuf
. Given input on stdin, it outputs 5 lines at random. Repeats are allowed.
$ cat word_list.txt | ./generate.sh
touch
farmers
costs
armies
caused
It optionally takes a count as an argument, to specify the number of lines to output
$ cat word_list.txt | ./generate.sh 10
execution
flour
extended
forbidden
foundation
muscles
benefits
cake
worst
fuel
generate.sh
requires shuf
or gshuf
on your system. On OS X, you can get gshuf
as part of the coreutils
package, through Homebrew.
brew install coreutils
Alternately, I provide a set of convenience targets for make
:
$ make password # or just `make`. The default target invokes `password`.
pot
wax
steam
hurt
cape
Again, the default length is 5, but can be adjusted
$ PICK=3 make password
flowing
magazine
grandson
Here you can also adjust the size of the word list we generate from by specifying POOL
. This defaults to 8192, which I've chosen because it seems a nice balance between memorability and password length. Being a power of 2, it also simplifies back of the envelope estimates of password entropy.
$ POOL=20 PICK=10 make password
we
and
have
of
it
that
the
what
to
to
There are additional targets for longer outputs or space-separated outputs.
$ make long_password
greece
mia
purchase
normal
interest
cab
rig
relationships
ross
corridor
$ make flat_password
injury aim assigned naive deserved
The Makefile
also contains targets for rebuilding the word list.
$ make clean word_list
will wipe out the existing copy, and rebuild it from a fresh copy of the English word list in hermitdave/FrequencyWords.