nisteag.entropy module

This module is related to token entropy calculation and the like.

See Appendix A of the NIST document (page 103) if you want to understand how the calculation is done.

class nisteag.entropy.EntropyCalculator

Bases: object

This class is used to calculate entropies for tokens.

calculate(token, dictionary=None, username=None)

Calculates the entropy for a given token.

Parameters:
  • token (str) – The token for the calculation. May be a password, a pass-phrase and the like.
  • dictionary (sequence) – An optional dictionary as a sequence, against which the token will be tested, if provided. If you opt by using it, provide a dictionary of at least 50,000 items. Default: None.
  • username (str) – An optional username to be used for anagram checking. Default: None.