Package org.passay.entropy
Class ShannonEntropyFactory
java.lang.Object
org.passay.entropy.ShannonEntropyFactory
Factory for creating
ShannonEntropy from password rules and password data.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final intNumber of character characteristics rules to enforce for a password to have composition.private static final PasswordValidatorValidator which decides whether a password has composition. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivatePrivate constructor for factory class. -
Method Summary
Modifier and TypeMethodDescriptionstatic ShannonEntropycreateEntropy(boolean dictionaryCheck, PasswordData passwordData) Creates a new shannon entropy.static ShannonEntropycreateEntropy(List<? extends Rule> passwordRules, PasswordData passwordData) Creates a new shannon entropy.private static booleanhasComposition(PasswordData passwordData) Checks whether the supplied passwordData has composition.
-
Field Details
-
COMPOSITION_CHARACTERISTICS_REQUIREMENT
private static final int COMPOSITION_CHARACTERISTICS_REQUIREMENTNumber of character characteristics rules to enforce for a password to have composition.- See Also:
-
COMPOSITION_VALIDATOR
Validator which decides whether a password has composition.
-
-
Constructor Details
-
ShannonEntropyFactory
private ShannonEntropyFactory()Private constructor for factory class.
-
-
Method Details
-
createEntropy
public static ShannonEntropy createEntropy(List<? extends Rule> passwordRules, PasswordData passwordData) Creates a new shannon entropy.- Parameters:
passwordRules- to aid in entropy calculationpasswordData- to aid in entropy calculation- Returns:
- shannon entropy
-
createEntropy
Creates a new shannon entropy.- Parameters:
dictionaryCheck- whether a common passwords dictionary is checked against the passwordpasswordData- to aid in entropy calculation- Returns:
- shannon entropy
-
hasComposition
Checks whether the supplied passwordData has composition. (As suggested by NIST SP-800-63-1)- Parameters:
passwordData- to check for composition- Returns:
- true if valid, false otherwise
-