passwordstrength 0.2.4

Creator: railscoder56

Last updated:

Add to Cart

Description:

passwordstrength 0.2.4

PasswordStrength




Editable password strength calculator for Python.
Update: Add entropy module!
Entropy
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'))
39.603517745128734
>>> math.log2(entropy.entropy('hello'))
11.240195053979924
>>> math.log2(entropy.entropy('helloworld'))
49.00439718141092
>>> math.log2(entropy.entropy('@sdhaskj'))
41.54693421676237
>>> math.log2(entropy.entropy('@sQsA$!j'))
48.43376716002963

Password Meter
This is based on http://www.passwordmeter.com
Usage
>>> from passwordstrength.passwordmeter import PasswordStrength
>>> strength = PasswordStrength('password')
>>> strength.strength()
9
>>> 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}}

License

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Customer Reviews

There are no reviews.