Skip to main content

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

Metadata

Release files for mkpassphrase 2.0.0.post1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for mkpassphrase 2.0.0.post1
File Interpreter ABI Platform
mkpassphrase-2.0.0.post1-py2.py3-none-any.whl Python 3, Python 2 none any Details

Release files / mkpassphrase-2.0.0.post1-py2.py3-none-any.whl

Download URL mkpassphrase-2.0.0.post1-py2.py3-none-any.whl
Size 43.5 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
0df124a3a54a395931151c928ace715f37a411c381fa4fb21dfdec13836460dc
BLAKE2b-256 checksum
How to use checksums
4f65fa17eb469e680d280beab317dd409dd74ca9ea4950f599934786dc51be94
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/28.8.0 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/3.6.4

Release history Release notifications | RSS feed

This release

2.0.0.post1 This release

1 release file

2.0.0

1 release file

1.0.0

1 release file

0.9.0

1 release file

0.8.0

1 release file

0.7.0

1 release file

0.6.8

1 release file

0.6.7

1 release file

0.6.6

1 release file

0.6.5

1 release file

0.6.4

1 release file

0.6.3

1 release file

0.6.2

1 release file

0.6.1

1 release file

0.6.0

2 release files

0.5

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page