Skip to main content

A collection of tools to make diceware passphrase conform with "password policy"

Project description

Diceware Utilities

Build Status PyPI version PyPI license PyPI pyversions PyPI status

A collection of tools to make diceware passphrase conform with "password policy"


  • (2017.05.22) Allow "weak" password generation.
>>> from diceware_utils.generate import GeneratePassword
>>> GeneratePassword().generate(weak=True)


pip install diceware_utils


pipenv install -e git+


>>> from diceware_utils.policy import Conformize
>>> conformize = Conformize()
>>> conformize.conformize(['unlikely', 'piezo', 'electric', 'grounds'])
>>> conformize.update_policy(new_policy)
>>> from diceware_utils.wordlist import Wordlist
>>> Wordlist().get_random_word()
>>> from diceware_utils.generate import GeneratePassword
>>> GeneratePassword().generate()

Adapting to the policy of your choice

  • Policy is now updateable. It is of format:
both_upper_and_lower: true
digit_count: 2
punctuation_count: 2
  min: 10
  max: 20

Database sources

leetspeak.yaml, policy.yaml and Conformization algorithm are original. Wordlists are taken from pwgen-passphrase, which belongs to the respective authors.

Main wordlist to generate the password is eff-long.txt, which is from Electronic Frontier Foundation.

Another interesting wordlist in this series is aspell-en.txt which is maintained by Kevin Atkinson. I exported these two files to the Android app below.

The idea of diceware password is from

Web demo

Mobile application

Please see Keepass DX - memorable password -- an Android password manager with this generator.

I might plan to create a dedicated app for this password generator (probably without manager), because of the relatively slow start-up time of the SentenceMaker.

Related projects

  • randomsentence - a random sentence maker based on a list of keywords.

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 diceware_utils, version 0.6.0
Filename, size File type Python version Upload date Hashes
Filename, size diceware_utils-0.6.0-py3-none-any.whl (1.2 MB) File type Wheel Python version py3 Upload date Hashes View
Filename, size diceware_utils-0.6.0.tar.gz (1.2 MB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page