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 long |
getDefaultCrackingHardwareCost() |
static List<Dictionary> |
getDefaultDictionaries() |
static Boolean |
getDefaultDistanceCalc() |
static Map<String,Long> |
getDefaultGuessTypes()
This list was compiled in August 2018 using a baseline of what could be bought for roughly $20k usd for the offline attack values.
|
static Map<String,Long> |
getDefaultGuessTypes(Long crackingHardwareCost)
This list was compiled in August 2018 using a baseline of what could be bought for roughly $20k usd for the offline attack values.
|
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 |
setCrackingHardwareCost(Long crackingHardwareCost)
Sets the cost of cracking hardware to scale the guesses / second for the default guess types.
|
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(BigDecimal seconds_to_crack,
String guess_type)
Sets the minimum entropy based on time to crack, and a specific guess type.
|
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(Long crackingHardwareCost)
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.
crackingHardwareCost - the hardware cost (USD) to scale the guesses per secondpublic 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 static long getDefaultCrackingHardwareCost()
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 minimumEntropy (should be a positive value)public ConfigurationBuilder setMinimumEntropy(BigDecimal seconds_to_crack, String guess_type)
seconds_to_crack - Value in seconds that you want to consider the minimum for a password to be considered goodguess_type - The guess type to use to figure out what the guesses per second are for this calculationpublic 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 ConfigurationBuilder setCrackingHardwareCost(Long crackingHardwareCost)
crackingHardwareCost - The hardware cost in USDpublic Configuration createConfiguration()
Configuration object using all values set in this builder, or default values if unset.Copyright © 2018. All rights reserved.