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.

Filename, size & hash SHA256 hash help File type Python version Upload date
passwordstrength-0.2.4-py3-none-any.whl (1.5 MB) Copy SHA256 hash SHA256 Wheel py3
passwordstrength-0.2.4.tar.gz (5.0 kB) Copy SHA256 hash SHA256 Source None

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page