Package org.passay.entropy
Class RandomPasswordEntropy
java.lang.Object
org.passay.entropy.RandomPasswordEntropy
- All Implemented Interfaces:
Entropy
Entropy bits estimate defined in NIST SP-800-63-1 Randomly Selected Passwords.
See PDF Publication A1. "Randomly Selected Passwords"
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final intSize of the alphabet.private final intSize of the password. -
Constructor Summary
ConstructorsConstructorDescriptionRandomPasswordEntropy(int alphaSize, int pwordSize) Creates a new random entropy estimate. -
Method Summary
-
Field Details
-
alphabetSize
private final int alphabetSizeSize of the alphabet. -
passwordSize
private final int passwordSizeSize of the password.
-
-
Constructor Details
-
RandomPasswordEntropy
public RandomPasswordEntropy(int alphaSize, int pwordSize) Creates a new random entropy estimate.- Parameters:
alphaSize- size of the alphabet usedpwordSize- size of the password
-
-
Method Details
-
estimate
public double estimate()Returns the entropy bits of a randomly generated password given the size of the unique characters used (alphabetSize) and the size of the password.See PDF Publication A1. "Randomly Selected Passwords"
-
log2
public static double log2(double number) Returns the log base 2 of a given number.- Parameters:
number- to get the log2 of- Returns:
- log2 of number
-