Skip to main content

Word-based passphrase generator

Project description

mkpassphrase

https://travis-ci.org/eukaryote/mkpassphrase.svg?branch=master

mkpassphrase is a commandline script and an associated library for generating passphrases by concatenating words chosen from a dictionary file that contains one word per line.

As of version 2, released in July, 2018, it bundles the three EFF wordlists, and uses their standard 7,776-word list by default, but can use the other EFF wordlists or a custom wordlist.

When run with no args, mkpassphrase generates a passphrase like exemplify strobe pushover appealing Glimpse Snazzy, which inserts a space character between each word and randomly uppercases the first character of each word with probability 1/2, using enough words to reach the recommended 80-bit security level, but these choices and others are configurable.

Installation

To install or upgrade to the latest stable version of mkpassphrase from PyPI, you can install it as your normal user by running:

$ pip install --user --upgrade mkpassphrase

On Linux, that installs mkpasphrase to ~/.local/bin, which you may need to add to your $PATH.

Or you can install it globally by running:

$ sudo pip install --upgrade mkpassphrase

Usage

Generate a passphrase using the default settings:

$ mkpassphrase
Octane Flatfoot timid revival Darkened dropkick

83-bit security level

The security level reported is based only on the number of words in the passphrase and the number of possible words (as well as whether the --lowercase option is chosen), and does not include other factors such as padding or a custom delimiter, which would increase the security level. You can also add the -q option to only see the passphrases.

You can use the -t NUM option to generate multiple passphrases if you want more options to choose from:

$ mkpassphrase -t 10
disposal Linoleum antibody petty Nucleus Unzip
Banish Barterer doorway avenging Errand tasting
poking disband Precook Ought pronounce procedure
rambling Flanking trimness heaving Dock Corned
overfull Evade Army fever sled Enjoyment
fancied Maternal pawing Marmalade Synapse Ruse
willow Hatless moving Dealmaker Mammogram share
perm broker only company Privacy Animation
composure Header polo prewar Unaware Creation
Entomb unselfish Shrewdly rundown snuff Wing

83-bit security level

Options

Use the –help option to see the available options:

$ mkpassphrase --help
usage: mkpassphrase [-h] [-n NUM_WORDS] [-s ENTROPY] [-w WORD_LIST]
                    [-f WORD_FILE] [-l] [-p PAD] [-d DELIMITER] [-t TIMES]
                    [-V] [-q]

Generate a passphrase.

optional arguments:
-h, --help            show this help message and exit
-n NUM_WORDS, --num-words NUM_WORDS
                        Number of words in passphrase (the default is enough
                        words to reach a security level of 80 bits)
-s ENTROPY, --entropy ENTROPY
                        Target entropy bits (the default is 80 bits)
-w WORD_LIST, --word-list WORD_LIST
                        Use built-in wordlist (eff-large [default], eff1, or
                        eff2)
-f WORD_FILE, --word-file WORD_FILE
                        Word file path (one word per line)
-l, --lowercase       Lowercase words (the default is to capitalize the
                        first letterof each word with probability 0.5 and use
                        lowercase for all other letters)
-p PAD, --pad PAD     Pad passphrase using PAD as prefix and suffix (the
                        default is no padding)
-d DELIMITER, --delimiter DELIMITER
                        Use DELIMITER to separate words in passphrase (the
                        default is a space character)
-t TIMES, --times TIMES
                        Generate TIMES different passphrases (the default is
                        to generate 1 passphrase)
-V, --version         Show version
-q, --quiet           Print just the passphrase (the default is to also show
                        the security-level of the generated passphrase(s))

Supported Python Versions and Operating Systems

mkpassphrase is supported on Python-2.7 (CPython or PyPy), Python-3.4+ for CPython, and Python-3.2.5+ for PyPy. It is tested on Linux, but should work on any OS with a supported Python version.

Changes

v2.0.0.post1

  • update CHANGES to reflect 2.0.0 changes (no code changes compared v2.0.0)

v2.0.0

  • support using (bundled) EFF wordlists as the source for words, in addition to user-provided wordlists, with the default behavior now being to use the long EFF wordlist (7,776 words)
  • support specifying security level to get a passphrase with the required number of words for that security level (e.g., mkpassphrase -s 80 to get a passphrase with enough words from the default EFF wordlist for 80 bits of entropy)
  • removed –min and –max options for ignoring words in a wordlist that are too short or too long
  • removed –non-ascii option for ignoring words that have non-ascii characters

v1.0.0

  • 1.0 bump, and change to ‘stable’
  • python3 support is limited to 3.2.5+ (python2.7 still supported)
  • added testing against python-3.6 (alpha3 currently)

v0.9.1

  • minor adjustments to python2/3 compatibility checks
  • pep257 docstring updates

v0.9.0

  • much faster generation of multiple passphrases using -t
  • minor verbiage tweaks for non-quiet output

v0.8.0

  • use cryptographically secure pseudo-random number generator if available
  • added standard imports to help with python2/3 compatibility

v0.7.0

  • added -t|–times N to allow generating multiple passphrases w/ one command

v0.6.8

  • include CHANGES.rst and README.rst in sdist via MANIFEST.in

v0.6.7

  • cosmetic changes for better PyPI display

v0.6.6

  • cosmetic changes for better PyPI display

v0.6.4

  • cosmetic changes for better PyPI display

v0.6.2

  • added -q option to omit extra information about how many unique candidate words were found and how many passphrases were possible
  • fix for –ascii option not being used, and improved encoding handling
  • start documenting changes in CHANGES.rst
  • use README and CHANGES as long_description for improved pypi info

Project details


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
mkpassphrase-2.0.0.post1-py2.py3-none-any.whl (43.5 kB) Copy SHA256 hash SHA256 Wheel py2.py3 Jul 29, 2018

Supported by

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