Skip to main content

MakePW Secure Password Generator

Overview

A Python command line utility I put together so I can use a master password and have it generate a site specific password for each site that needs a password. I'm in the process of adding a Javascript implementation for use in a web browser and and an Android applet implementation.

The passwords generated are carefully massaged to try to fit just about every site's password requirements and keep at least 60 bits of entropy in every password.

It should work both in Python 2.7 and any version of Python 3.

How To Use It

Example Usage

$ ./makepw.py -e --site=google.com
Password: 
check_site hash is: 4Uwtzpj+3Jt0Jp
6TsgvLT+vbXZSw

The check_site hash uses a fixed and special site name to hash your master password. This allows you to see if you've mistyped your password without revealing what it is. The check_site hash should always the same for a given master password.

In this case, 6TsgvLT+vbXZSw is the password you should use for Google. You can specify whatever you want to for the site name. It is mixed with your master password in an irreversible way to generate the site password.

Program Help Message

$ ./makepw.py --help
usage: makepw.py [-h] [--iterations ITERS] [--site SITE] [--extra] [--old]
                 [--format FORMAT] [--list-formats] [--random] [--no-check]

Generate a site password from a master password and a site name.

optional arguments:
  -h, --help            show this help message and exit
  --iterations ITERS, -i ITERS
                        Number of hash iterations. Defaults to 200000. For the
                        original behavior of a non-iterated hash, use an
                        iteration count of 0.
  --site SITE, -s SITE  Unique site or account identifier, usually the last
                        two components of site domain name (aka slashdot.org).
  --extra, -e           Backwards compatility - equivalent to --format
                        stupid_policy14
  --old, -o             Use old non-PBKDF2 function for generating the
                        password. Not relevant with -r
  --format FORMAT, -f FORMAT
                        Output format of resulting password. Defaults to
                        'stupid_policy13'. Use --list-formats for a list of
                        supported formats.
  --list-formats, -l    Print out a list of supported formats, like --help,
                        this short-circuits any other function.
  --random, -r          Use the OS secure random number generation to creae a
                        random password instead of asking for a master
                        password. Useful for generating master passwords, or
                        with the xkcd algorithm. Implies --no-check and
                        ignores the site name and --iterations.
  --no-check, -n        Do not print out hash for check_site site. This hash
                        can help you tell if you entered the wrong password.

How It Works

When not using --random mode, it uses the PKCS#5 v2.0 PBKDF2 with a large (but configurable) number of iterations to make sure that even if an attacker manages to get the plaintext password for a given site, it will be practically impossible for them to reverse the hash and figure out the master password.

Known Bugs

It has a small bug in which it skips 'Z', 'z' and '9' for generating the uppercase, lowercase and digit characters. When implementing this for some other language, this this bug should be faithfully replicated to maintain compatibility and allow people to use any implementation for re-creating a password they created with a different implementation.

Metadata

Release files for makepw 2.0.1

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

Source distribution (sdist)

Source distribution for makepw 2.0.1
File Size Uploaded Provenance Actions
makepw-2.0.1.tar.gz 21.7 kB Without provenance Details for makepw-2.0.1.tar.gz

Release files / makepw-2.0.1.tar.gz

Download URL makepw-2.0.1.tar.gz
Size 21.7 kB
Tags Source
SHA-256 checksum
How to use checksums
82b97e7db4a1d8591cc49ec8a4d9242edb625f9d76dff8401cc80f554adaddd2
BLAKE2b-256 checksum
How to use checksums
c0dd565483ffa9e095ea9244ebf332a8b098d66e3a7f41c18ee1f3307585ba6c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.2 pkginfo/1.4.2 requests/2.20.0 setuptools/40.8.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.2

Security for makepw 2.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

2.0.1 This release

1 release file No provenance

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