Generate XKCD-style Passwords
Perl Shell
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
2000.sh
3000.sh
LICENSE
README.md
pgen.pl

README.md

pgen

Perl program to generate XKCD-style passwords

License

I want there to be NO barriers to using this code, so I am releasing it to the public domain. But "public domain" does not have an internationally agreed upon definition, so I use CC0:

Copyright 2017 Steven Ford http://geeky-boy.com and licensed "public domain" style under CC0: CC0

To the extent possible under law, the contributors to this project have waived all copyright and related or neighboring rights to this work. In other words, you can use this code for any purpose without any restrictions. This work is published from: United States. The project home is https://github.com/fordsfords/pgen

To contact me, Steve Ford, project owner, you can find my email address at http://geeky-boy.com. Can't see it? Keep looking.

Introduction

XKCD had an excellent comic -- https://xkcd.com/936/ -- which proposed a style of password generation consisting of randomly selecting 4 words from a list of ~2000 common words. The result is a password which is more secure and easier to remember than most common methods of password creation.

The pgen program downloads a list of common english words and randomly selects some for a password. I used the program to produce some mildly-interesting results in my blog.

Here are the interesting features of the program:

  • It starts with a set of 3000 words published by Education First and filters it by word length.

  • It can either use Perl's internal pseudo-random number generator (useful for experimentation and statistics gathering), or it can get random numbers from https://random.org which makes the resulting password properly secure.

You can get help by entering:

    ./pgen -h

Important: if you plan to actually use the passwords you generate, use "-r"! Here's why.

2000.sh and 3000.sh

Also included are two shell scripts that fetch lists of common words off the Internet. 2000.sh goes to Wiktionary to get 2000 words, and 3000.sh goes to Education First to get 3000 words.

These shell scripts are not needed since I included code in the Perl program to fetch the Education First list. (The reason I do this is that the material on Education First's site is copyrighted, so I can't just snag a copy of their word list without permission.)