Skip to main content

Password strength calculator in Python

Project description


Build Status Latest Version PyPI license PyPI pyversions

Editable password strength calculator for Python.

Update: Add entropy module!


This calculates the ability to tolerate dictionary attack. Probably, an entropy of 2**70 is eventually needed.

>>> from passwordstrength.entropy import Entropy
>>> import math
>>> entropy = Entropy()
>>> math.log2(entropy.entropy('asdhaskj'))
>>> math.log2(entropy.entropy('hello'))
>>> math.log2(entropy.entropy('helloworld'))
>>> math.log2(entropy.entropy('@sdhaskj'))
>>> math.log2(entropy.entropy('@sQsA$!j'))

Password Meter

This is based on


>>> from passwordstrength.passwordmeter import PasswordStrength
>>> strength = PasswordStrength('password')
>>> strength.strength()
>>> strength.rule_scores()
{'Additions': {'nAlphaLCBonus': 0,
  'nAlphaUCBonus': 0,
  'nLengthBonus': 32,
  'nMidCharBonus': 0,
  'nNumberBonus': 0,
  'nSymbolBonus': 0},
 'Deductions': {'nAlphasOnlyBonus': 8,
  'nConsecAlphaLCBonus': 14,
  'nConsecAlphaUCBonus': 0,
  'nConsecNumberBonus': 0,
  'nNumbersOnlyBonus': 0,
  'nRepCharBonus': 1,
  'nSeqAlphaBonus': 0,
  'nSeqNumberBonus': 0,
  'nSeqSymbolBonus': 0}}

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

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate 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