Skip to main content
Help us improve Python packaging – donate today!

Generate secure multiword passwords/passphrases, inspired by XKCD

Project Description

xkcdpass

A flexible and scriptable password generator which generates strong passphrases, inspired by XKCD 936:

$ xkcdpass
> correct horse battery staple
http://imgs.xkcd.com/comics/password_strength.png

Install

xkcdpass can be easily installed using pip:

pip install xkcdpass

or manually:

python setup.py install

Source

The latest development version can be found on github: https://github.com/redacted/XKCD-password-generator

Contributions welcome and gratefully appreciated!

Requirements

Python 2.4+ (Python 3.x compatible)

Running xkcdpass

xkcdpass can be called with no arguments:

$ xkcdpass
> pinball previous deprive militancy bereaved numeric

which returns a single password, using the default dictionary and default settings. Or you can mix whatever arguments you want:

$ xkcdpass --count=5 --acrostic='chaos' --delimiter='|' --min=5 --max=6 --valid_chars='[a-z]'
> collar|highly|asset|ovoid|sultan
> caper|hangup|addle|oboist|scroll
> couple|honcho|abbot|obtain|simple
> cutler|hotly|aortae|outset|stool
> cradle|helot|axial|ordure|shale

which returns

  • --count=5 5 passwords to choose from
  • --acrostic='chaos' the first letters of which spell ‘chaos’
  • --delimiter='|' joined using ‘|’
  • --min=5 --max=6 with words between 5 and 6 characters long
  • --valid_chars='[a-z]' using only lower-case letters (via regex).

A concise overview of the available xkcdpass options can be accessed via:

xkcdpass --help

Usage: xkcdpass [options]

Options:
    -h, --help
                                show this help message and exit
    -w WORDFILE, --wordfile=WORDFILE
                                List of valid words for password
    --min=MIN_LENGTH
                                Minimum length of words to make password
    --max=MAX_LENGTH
                                Maximum length of words to make password
    -n NUMWORDS, --numwords=NUMWORDS
                                Number of words to make password
    -i, --interactive
                                Interactively select a password
    -v VALID_CHARS, --valid_chars=VALID_CHARS
                                Valid chars, using regexp style (e.g. '[a-z]')
    -V, --verbose
                                Report various metrics for given options
    -a ACROSTIC, --acrostic=ACROSTIC
                                Acrostic to constrain word choices
    -c COUNT, --count=COUNT
                                number of passwords to generate
    -d DELIM, --delimiter=DELIM
                                separator character between words

A large wordlist is provided (courtesy of 12Dicts) for convenience, but the generator can be used with any word file of the correct format: a file containing one ‘word’ per line. The default word file can be found in xkcdpass/static/default.txt.

The main script can also be imported into other python code, and an example of this usage is provided in the package (xkcdpass/example_import.py).

License

The BSD License (BSD)

Release history Release notifications

History Node

1.16.5

History Node

1.16.4

History Node

1.16.3

History Node

1.16.2

History Node

1.16.1

History Node

1.16.0

History Node

1.15.1

History Node

1.15.0

History Node

1.14.3

History Node

1.14.2

History Node

1.14.1

History Node

1.14.0

History Node

1.13.0

History Node

1.12.0

History Node

1.11.1

History Node

1.11.0

History Node

1.10.0

History Node

1.9.5

History Node

1.9.4

History Node

1.9.3

History Node

1.9.2

History Node

1.9.1

History Node

1.9.0

History Node

1.8.2

History Node

1.8.1

History Node

1.8.0

History Node

1.7.0

History Node

1.6.4

History Node

1.6.3

History Node

1.6.2

History Node

1.6.1

History Node

1.6.0

History Node

1.5.0

History Node

1.4.4

History Node

1.4.3

History Node

1.4.2

History Node

1.4.0

History Node

1.3.1

History Node

1.3.0

History Node

1.2.5

History Node

1.2.4

History Node

1.2.3

History Node

1.2.2

History Node

1.2.1

History Node

1.2.0

This version
History Node

1.1.0

History Node

1.0.3

History Node

1.0.2

History Node

1.0.1

History Node

1.0.0

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
xkcdpass-1.1.0.tar.gz (138.7 kB) Copy SHA256 hash SHA256 Source None Jul 12, 2014

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page