java.lang.Object
me.gosimple.nbvcxz.scoring.Result
public class Result
extends java.lang.Object
This class contains all info about the entropy calculation.
- Author:
- Adam Brusselback
-
Constructor Summary
Constructors Constructor Description Result(Configuration configuration, java.lang.String password, java.util.List<Match> matches) -
Method Summary
Modifier and Type Method Description intgetBasicScore()This scoring function returns an int from 0-4 to indicate the score of this password using the same semantics as zxcvbn.ConfigurationgetConfiguration()Returns the configuration used to generate this result.java.lang.DoublegetEntropy()Returns the entropy for thisResult.FeedbackgetFeedback()Returns feedback to the user to suggest ways to improve their password.java.math.BigDecimalgetGuesses()The estimated number of tries required to crack this passwordjava.util.List<Match>getMatches()The matches that comprise this result.java.lang.StringgetPassword()The original password passed in.booleanisMinimumEntropyMet()Returns whether the minimum entropy specified in the config was met.booleanisRandom()Returns whether the password is considered to be random.
-
Constructor Details
-
Result
public Result(Configuration configuration, java.lang.String password, java.util.List<Match> matches) throws java.lang.IllegalStateException- Parameters:
configuration- theConfigurationobject.password- the password this result was generated formatches- list of matches which when combined make up the original password- Throws:
java.lang.IllegalStateException- if the matches do not equal the original password, this will be thrown.
-
-
Method Details
-
getEntropy
public java.lang.Double getEntropy()Returns the entropy for thisResult.- Returns:
- the estimated entropy as a
double.
-
getGuesses
public java.math.BigDecimal 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
public java.lang.String getPassword()The original password passed in.- Returns:
Stringof the original password.
-
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)
-