Select N random words from a dictionary, such as for use in passwords.


The script uses python's os.urandom which we believe provides adequate high-entropy randomness.

The security of the result is estimated by the number of words in the dictionary file.

Warning: If the user runs this script repeatedly and filters the results with any bias (such as phrases which seem more memorable), they are reducing the security of the result.


The dictionary file format is simply newline separated words.

This format and the default dictionary path of /usr/share/dict/words both match the Debian standard for dictionaries. To see a list of available dictionaries on Debian, run:

$ apt-file search /usr/share/dict


The interface and format of this tool is not expected to change. The expected improvements are only security improvements or bugfixes.

Please file an issue ticket if you notice use-case gotchas, such as using poor dictionary inputs, errors in the entropy estimation, errors in the entropy generation, or other security flaws or bugs.

Bonus points for links to password-related research that address this approach to password selection.