Skip to content
Tech News
← Back to articles

A password generator inspired by the Xkcd password spec

read original get computer monitor → more articles

Introduction

This python script implements the xkcd password spec.

Install

This package requires the pip Python package manager for installation. pip installation instructions.

Then:

pip install xkpa

Usage

% xkpa -h usage: xkpa.py [-h] [-n] [-d DICT_PATH] [-x] [-i] [-s SEPARATOR] [-l LENGTH] [-c COUNT] [-v] [w] Generate an xkcd style password. positional arguments: w The number of words in the password. Defaults to 4. optional arguments: -h, --help show this help message and exit -n Disable printing a newline at the end of the password. Good for piping to the clipboard. -d DICT_PATH The dictionary file. Defaults to [PATH]. -x Disable excluding special characters and punctuation. -i Enable showing password information (entropy, etc). -s SEPARATOR Delimit words with a given character/string. -l LENGTH The maximum word length. Words must be at or below this length. -c COUNT Number of passwords to generate. Defaults to 1. -v Display version information. http://xkcd.com/936/

Examples

Generate a password, and put it in the clipboard (OS X)

... continue reading