edu.vt.middleware.password
Class DictionarySubstringRule

java.lang.Object
  extended by edu.vt.middleware.password.AbstractDictionaryRule
      extended by edu.vt.middleware.password.DictionarySubstringRule
All Implemented Interfaces:
Rule

public class DictionarySubstringRule
extends AbstractDictionaryRule

DictionarySubstringRule determines if a password matches a dictionary word, or if it contains a dictionary word of a given minimum length or greater. The checker will optionally also check for reversed words.

Version:
$Revision: 1841 $ $Date: 2011-02-25 14:05:47 -0500 (Fri, 25 Feb 2011) $
Author:
Middleware Services

Field Summary
static int DEFAULT_WORD_LENGTH
          default word length.
 
Fields inherited from class edu.vt.middleware.password.AbstractDictionaryRule
dictionary, matchBackwards
 
Constructor Summary
DictionarySubstringRule()
          This creates a new a new DictionarySubstringRule without supplying a dictionary.
DictionarySubstringRule(edu.vt.middleware.dictionary.Dictionary dict)
          This creates a new DictionarySubstringRule with the supplied dictionary.
DictionarySubstringRule(edu.vt.middleware.dictionary.Dictionary dict, int n)
          This will create a new DictionarySubstringRule with the supplied dictionary and number of characters.
 
Method Summary
protected  java.lang.String doWordSearch(java.lang.String text)
          Searches the dictionary with the supplied text.
 int getWordLength()
          This will return the number of characters that constitute a word in a password.
 void setWordLength(int n)
          This sets the minimum number of characters that constitute a word in a password.
 
Methods inherited from class edu.vt.middleware.password.AbstractDictionaryRule
getDictionary, isMatchBackwards, setDictionary, setMatchBackwards, toString, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DEFAULT_WORD_LENGTH

public static final int DEFAULT_WORD_LENGTH
default word length.

See Also:
Constant Field Values
Constructor Detail

DictionarySubstringRule

public DictionarySubstringRule()
This creates a new a new DictionarySubstringRule without supplying a dictionary. The dictionary should be set using the AbstractDictionaryRule.setDictionary(Dictionary) method.


DictionarySubstringRule

public DictionarySubstringRule(edu.vt.middleware.dictionary.Dictionary dict)
This creates a new DictionarySubstringRule with the supplied dictionary. The dictionary should be ready to use when passed to this constructor.

Parameters:
dict - Dictionary to use for searching

DictionarySubstringRule

public DictionarySubstringRule(edu.vt.middleware.dictionary.Dictionary dict,
                               int n)
This will create a new DictionarySubstringRule with the supplied dictionary and number of characters. The dictionary should be ready to use when passed to this constructor. See setWordLength(int).

Parameters:
dict - Dictionary to use for searching
n - int number of characters to check in each dictionary word
Method Detail

setWordLength

public void setWordLength(int n)
This sets the minimum number of characters that constitute a word in a password. So if n = 5 and the password contains 'test', then the password is valid. However if n = 4 then 'test' will be found in the dictionary. The default value is 4.

Parameters:
n - int minimum number of characters to check in each dictionary word

getWordLength

public int getWordLength()
This will return the number of characters that constitute a word in a password.

Returns:
int

doWordSearch

protected java.lang.String doWordSearch(java.lang.String text)
Searches the dictionary with the supplied text.

Specified by:
doWordSearch in class AbstractDictionaryRule
Parameters:
text - to search dictionary with
Returns:
String matching word


Copyright © 2003-2011 Virginia Tech. All Rights Reserved.