public class ConfigurationBuilder extends Object
Configuration.| Constructor and Description |
|---|
ConfigurationBuilder() |
| Modifier and Type | Method and Description |
|---|---|
Configuration |
createConfiguration()
Creates the
Configuration object using all values set in this builder, or default values if unset. |
static List<AdjacencyGraph> |
getDefaultAdjacencyGraphs() |
static long |
getDefaultCombinationAlgorithmTimeout() |
static List<Dictionary> |
getDefaultDictionaries() |
static Boolean |
getDefaultDistanceCalc() |
static Map<String,Long> |
getDefaultGuessTypes() |
static Map<Character,Character[]> |
getDefaultLeetTable() |
static double |
getDefaultMinimumEntropy() |
static List<PasswordMatcher> |
getDefaultPasswordMatchers() |
static Pattern |
getDefaultYearPattern() |
static BigDecimal |
getMooresMultiplier()
Returns the Moore's law multiplier we're using for getDefaultGuessTypes().
|
ConfigurationBuilder |
setAdjacencyGraphs(List<AdjacencyGraph> adjacencyGraphs)
AdjacencyGraphs are used to find spacial patterns within passwords (e.g. |
ConfigurationBuilder |
setCombinationAlgorithmTimeout(Long combinationAlgorithmTimeout)
Timeout for the findBestCombination algorithm.
|
ConfigurationBuilder |
setDictionaries(List<Dictionary> dictionaries)
Dictionaries are used by the
DictionaryMatcher to find common words, names, and known passwords within the password. |
ConfigurationBuilder |
setDistanceCalc(Boolean distanceCalc)
Distance based dictionary calculations which provide support for misspelling
detection, at the expense of performance.
|
ConfigurationBuilder |
setGuessTypes(Map<String,Long> guessTypes)
Guess types are used to calculate how long an attack would take using that method using guesses/sec.
|
ConfigurationBuilder |
setLeetTable(Map<Character,Character[]> leetTable)
The leet table is used to check within a password for common character substitutions (e.g.
|
ConfigurationBuilder |
setLocale(Locale locale)
Supported locales are en, and fr.
|
ConfigurationBuilder |
setMinimumEntropy(Double minimumEntropy)
Used to check if the password is secure enough, and give feedback if not.
|
ConfigurationBuilder |
setPasswordMatchers(List<PasswordMatcher> passwordMatchers)
PasswordMatcher are what look for different patterns within the password and create an associated Match object. |
ConfigurationBuilder |
setYearPattern(Pattern yearPattern)
Year patterns are used to look for years within a password.
|
public static List<PasswordMatcher> getDefaultPasswordMatchers()
public static BigDecimal getMooresMultiplier()
public static Map<String,Long> getDefaultGuessTypes()
In the case this library is no longer maintained (or you choose to stay on an old version of it), we will scale the existing values by Moore's law.
public static List<Dictionary> getDefaultDictionaries()
public static List<AdjacencyGraph> getDefaultAdjacencyGraphs()
public static Map<Character,Character[]> getDefaultLeetTable()
public static Pattern getDefaultYearPattern()
public static double getDefaultMinimumEntropy()
public static Boolean getDefaultDistanceCalc()
public static long getDefaultCombinationAlgorithmTimeout()
public ConfigurationBuilder setPasswordMatchers(List<PasswordMatcher> passwordMatchers)
PasswordMatcher are what look for different patterns within the password and create an associated Match object.
PasswordMatcher and Match classes, here is where you would register them.passwordMatchers - List of matcherspublic ConfigurationBuilder setGuessTypes(Map<String,Long> guessTypes)
guessTypes - key is a description of the type of guess, value is how many guesses per secondpublic ConfigurationBuilder setDictionaries(List<Dictionary> dictionaries)
DictionaryMatcher to find common words, names, and known passwords within the password.dictionaries - List of dictionariespublic ConfigurationBuilder setAdjacencyGraphs(List<AdjacencyGraph> adjacencyGraphs)
AdjacencyGraphs are used to find spacial patterns within passwords (e.g. asdfghj).adjacencyGraphs - List of adjacencyGraphspublic ConfigurationBuilder setLeetTable(Map<Character,Character[]> leetTable)
leetTable - Map for leetTablepublic ConfigurationBuilder setYearPattern(Pattern yearPattern)
yearPattern - Pattern for year matchingpublic ConfigurationBuilder setMinimumEntropy(Double minimumEntropy)
minimumEntropy - Value for minimumEntropypublic ConfigurationBuilder setLocale(Locale locale)
locale - Locale for localizationpublic ConfigurationBuilder setDistanceCalc(Boolean distanceCalc)
distanceCalc - true to enable distance based dictionary calculationspublic ConfigurationBuilder setCombinationAlgorithmTimeout(Long combinationAlgorithmTimeout)
To disable the findBestMatches calculation and always fall back to the faster, less accurate one, set to 0.
combinationAlgorithmTimeout - The time in ms to timeoutpublic Configuration createConfiguration()
Configuration object using all values set in this builder, or default values if unset.Copyright © 2018. All rights reserved.