Class Result

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
    int getBasicScore()
    This scoring function returns an int from 0-4 to indicate the score of this password using the same semantics as zxcvbn.
    Configuration getConfiguration()
    Returns the configuration used to generate this result.
    java.lang.Double getEntropy()
    Returns the entropy for this Result.
    Feedback getFeedback()
    Returns feedback to the user to suggest ways to improve their password.
    java.math.BigDecimal getGuesses()
    The estimated number of tries required to crack this password
    java.util.List<Match> getMatches()
    The matches that comprise this result.
    java.lang.String getPassword()
    The original password passed in.
    boolean isMinimumEntropyMet()
    Returns whether the minimum entropy specified in the config was met.
    boolean isRandom()
    Returns whether the password is considered to be random.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Result

      public Result​(Configuration configuration, java.lang.String password, java.util.List<Match> matches) throws java.lang.IllegalStateException
      Parameters:
      configuration - the Configuration object.
      password - the password this result was generated for
      matches - 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 this Result.
      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

      public java.util.List<Match> getMatches()
      The matches that comprise this result.
      Returns:
      a List of Match that were used in this result estimation.
    • getPassword

      public java.lang.String getPassword()
      The original password passed in.
      Returns:
      String of the original password.
    • isMinimumEntropyMet

      public boolean isMinimumEntropyMet()
      Returns whether the minimum entropy specified in the config was met.
      Returns:
      true if minimum entropy is met; false if 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

      public Configuration getConfiguration()
      Returns the configuration used to generate this result.
      Returns:
      Configuration that was used to generate this Result.
    • getFeedback

      public Feedback getFeedback()
      Returns feedback to the user to suggest ways to improve their password.
      Returns:
      a Feedback object 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)