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.

Source Distribution

passwordstrength-0.2.4.tar.gz (5.0 kB view hashes)

Uploaded source

Built Distribution

passwordstrength-0.2.4-py3-none-any.whl (1.5 MB view hashes)

Uploaded py3

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 Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page