java.lang.Object
me.gosimple.nbvcxz.scoring.Result
This class contains all info about the entropy calculation.
- Author:
- Adam Brusselback
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintThis scoring function returns an int from 0-4 to indicate the score of this password using the same semantics as zxcvbn.Returns the configuration used to generate this result.Returns the entropy for thisResult.Returns feedback to the user to suggest ways to improve their password.The original password passed in.The estimated number of tries required to crack this passwordThe matches that comprise this result.The password passed in truncated to maxLength.booleanReturns whether the minimum entropy specified in the config was met.booleanisRandom()Returns whether the password is considered to be random.booleanReturns whether the password was truncated for estimation because it was longer than maxLength.
-
Constructor Details
-
Result
public Result(Configuration configuration, String password, String full_password, List<Match> matches) throws IllegalStateException - Parameters:
configuration- theConfigurationobject.password- the password this result was generated formatches- list of matches which when combined make up the original password- Throws:
IllegalStateException- if the matches do not equal the original password, this will be thrown.
-
-
Method Details
-
getEntropy
Returns the entropy for thisResult.- Returns:
- the estimated entropy as a
double.
-
getGuesses
The estimated number of tries required to crack this password- Returns:
- the estimated number of guesses as a
BigDecimal
-
getMatches
The matches that comprise this result.- Returns:
- a
ListofMatchthat were used in this result estimation.
-
getPassword
The password passed in truncated to maxLength.- Returns:
Stringof the truncated password.
-
getFullPassword
The original password passed in.- Returns:
Stringof the original password.
-
isTruncated
public boolean isTruncated()Returns whether the password was truncated for estimation because it was longer than maxLength.- Returns:
trueif the password was truncated;falseif not.
-
isMinimumEntropyMet
public boolean isMinimumEntropyMet()Returns whether the minimum entropy specified in the config was met.- Returns:
trueif minimum entropy is met;falseif not.
-
isRandom
public boolean isRandom()Returns whether the password is considered to be random.- Returns:
- true if the password is considered random, false otherwise.
-
getConfiguration
Returns the configuration used to generate this result.- Returns:
Configurationthat was used to generate thisResult.
-
getFeedback
Returns feedback to the user to suggest ways to improve their password.- Returns:
- a
Feedbackobject with suggestions for the user.
-
getBasicScore
public int getBasicScore()This scoring function returns an int from 0-4 to indicate the score of this password using the same semantics as zxcvbn.- Returns:
- Score
0: risky password: "too guessable"
1: modest protection from throttled online attacks: "very guessable"
2: modest protection from unthrottled online attacks: "somewhat guessable"
3: modest protection from offline attacks: "safely unguessable" (assuming a salted, slow hash function)
4: strong protection from offline attacks: "very unguessable" (assuming a salted, slow hash function)
-