Skip to main content

Secure but memorable passphrase generator

Project description

Correct Horse: A memorable passphrase generator

Correct Horse is a tool for generating resonably secure but reasonably memorable passphrases. It does this by picking a set of words from a dictionary and then sorting them into an order that plausibly makes sense as a phrase. It can be used either as a command line tool to generate and print a passphrase that one might enter into another application or through an API to pick new passphrases for something like a rotating code on a WiFi network.

Usage

Command line

correcthorse [-h] [-n MAX_WORDS] [-N MAX_LETTERS] [-l] [-c] [-u] [-s] [-j] [-H]
                   [-S SEPARATOR] [-f FILENAME] [-L LOCALE]

Use the -n WORD_COUNT or --max_words WORD_COUNT option to set the maximum number of words in the passphrase. Use the -N LETTER_COUNT or --max_letters LETTER_COUNT option to set the maximum number of letters in the passphrase. You may set both

The -l or --lower-case will cause all of the words in the passphrase to be printed in lower case while the -c or --capitalise flag will cause the first letter of each word to be capitalised. The default is to capitalise the first letter.

When the words of the passphrase are printed a seperator string will be placed between then. This can be set using the -S SEPARATOR or --separator SEPARATOR option. For convenience you can use -u or --underscore to join the words with an underscore, -s or --space to join the words with a space, -H or --hyphen to join the words with a hyphen or -j or --join to simply run the words together without a separator.

By default correcthorse will detect your locale and pick a word set that matches your local language. You can override the detected locale using the -L LOCALE or --locale LOCALE options. While great in theory, unless your language is English the chances are that currently there is no built in word file for your language. You can however specify a custom word file using the -f FILENAMEor --word-file FILENAME options.

Use as a python module

To use the correcthorse module through the API create an instance of the WordSet using WordSet(filename=None, locale=None, encoding='UTF-8') and then call random_phrase(max_words=4).

Project details


Download files

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

Source Distribution

correcthorse-0.2.0.tar.gz (19.1 kB view hashes)

Uploaded Source

Built Distribution

correcthorse-0.2.0-py3-none-any.whl (14.8 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page