java.lang.Object
me.gosimple.nbvcxz.resources.Dictionary
Object used for dictionary matching. This allows users to implement custom dictionaries for different languages
or specialized vocabulary.
Dictionaries need to use all lower case keys for the words they contain for the algorithm to work correctly.
- Author:
- Adam Brusselback.
-
Constructor Summary
ConstructorsConstructorDescriptionDictionary(String dictionary_name, Map<String, Integer> dictonary, boolean exclusion) Object used for dictionary matching. -
Method Summary
Modifier and TypeMethodDescriptionA description of the values contained in the dictionary.The values within this dictionary.intThe longest length of an entry we should check with this dictionaryThis contains the same values as in getDictionary, but is sorted for optimizing the speed of the distance calculationA map containing different lengths, and the first index they appear in the sorted dictionary.booleanReturns if this dictionary is used for password exclusion or not.
-
Constructor Details
-
Dictionary
Object used for dictionary matching.- Parameters:
dictionary_name- unique name of dictionary.dictonary-Mapwith the word and it's rank. The key must be lowercase for the matching to work properly.exclusion-truewhen desiring to disallow any password contained in this dictionary;falseotherwise.
-
-
Method Details
-
getDictonary
The values within this dictionary.- Returns:
- key = values in the dictionary; value = rank
-
getSortedDictionary
This contains the same values as in getDictionary, but is sorted for optimizing the speed of the distance calculation- Returns:
- A list of dictionary values sorted by length then alphabetical
-
getSortedDictionaryLengthLookup
A map containing different lengths, and the first index they appear in the sorted dictionary.- Returns:
- key = length; value = first index that length appears
-
isExclusion
public boolean isExclusion()Returns if this dictionary is used for password exclusion or not.
If true, a password which matches to one of the values in the dictionary will always return 0 entropy for the portion which matches.- Returns:
- true if excluded
-
getDictionaryName
A description of the values contained in the dictionary.- Returns:
- The dictionary name
-
getMaxLength
public int getMaxLength()The longest length of an entry we should check with this dictionary- Returns:
- the longest value this dictionary contains
-