Skip to main content

Word-based passphrase generator

Project description


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.


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


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


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
-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)
                        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.



  • update CHANGES to reflect 2.0.0 changes (no code changes compared 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


  • 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)


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


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


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


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


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


  • cosmetic changes for better PyPI display


  • cosmetic changes for better PyPI display


  • cosmetic changes for better PyPI display


  • 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.

Files for mkpassphrase, version 2.0.0.post1
Filename, size & hash File type Python version Upload date
mkpassphrase-2.0.0.post1-py2.py3-none-any.whl (43.5 kB) View hashes Wheel py2.py3

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 SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page