CryptoUtils Class Reference

Inheritance diagram for CryptoUtils:
Collaboration diagram for CryptoUtils:

List of all members.

Detailed Description

Base class of all cryptographic and steganographic en- and decipherers with various required attributes and methods.


Public Methods

Set< Character > getAlphabet ()
void setAlphabet (char[] alphabet)
String replaceAll (String toProcess)
Map< String, String > getReplacements ()

Public Static Methods

static char[] getDefaultAlphabet ()
static char[] getDefaultAlphabetWithoutChar (char ch)
static char[] getTrithemianAlphabet ()
static Map< String, String > trithemianAlphabetReplacements ()

Protected Methods

boolean checkAlphabet (String alphabetString, char[] defaultAlphabet)
boolean checkReplacements (String replacementString)
void checkWSDeletion (String deleteWhitespace)
boolean checkIntKey (String intKeyString, int defaultKey)
String getAlphabetAsStringKey (int start)

Protected Attributes

char[] alphabet
Map< String, String > replacementMap
int intKey
boolean deleteWhitespace
Logger logger = Logger.getLogger(this.getClass())

Method Details

boolean checkAlphabet ( String  alphabetString,
char[]  defaultAlphabet 
) [protected]

Builds alphabet from specified string, if not null and not empty. Else the specified default alphabet will be set as alphabet.

alphabetStringString to set as alphabet.
defaultAlphabetdefault alphabet.
true, if alphabetString can be set as alphabet, false if default alphabet is set.
boolean checkIntKey ( String  intKeyString,
int  defaultKey 
) [protected]

Builds an integer key from the specified string.

intKeyStringinteger key as string
defaultKeykey to set if integer key could not be build from specified string.
true, if int key is builded from specified string, false otherwise.
boolean checkReplacements ( String  replacementString) [protected]

Builds replacement map from specified string that should be parsable CSV data.

replacementStringreplacements as csv data.
true, if replacement map could be build, false otherwise.
void checkWSDeletion ( String  deleteWhitespace) [protected]

If specified string equals true, whitespace will be deleted in the substituted text.

deleteWhitespaceboolean value as string
Set<Character> getAlphabet ( )

Returns the alphabet of this crypto component.

alphabet of this crypto component.
String getAlphabetAsStringKey ( int  start) [protected]

Returns the alphabet as string key (starts from the specified position, e.g. 1 for a).

startPosition of the alphabet to start.
alphabet as string key.
static char [] getDefaultAlphabet ( ) [static]

Returns the default alphabet (a-z), lower case letters.

default alphabet (a-z).
static char [] getDefaultAlphabetWithoutChar ( char  ch) [static]

Returns the default alphabet (a-z) without the specified character. Needed e.g. to get 25 letters for a 5 * 5 matrix.

chcharacter to ignore.
default alphabet without the specified character.
Map<String, String> getReplacements ( )
static char [] getTrithemianAlphabet ( ) [static]

Returns the Trithemian alphabet: abcdefghiklmnopqrstuxyzw.

Trithemian alphabet.
String replaceAll ( String  toProcess)

Replaces characters of the specified string by the replacements set in this.

toProcessString to process.
String with replaced characters.
void setAlphabet ( char[]  alphabet)

Sets the alphabet of this crypto component.

alphabetto set.
static Map<String,String> trithemianAlphabetReplacements ( ) [static]

Returns a map of default alphabet values and their replacements in the T. alphabet.

Tritemian replacement map.

Field Details

char [] alphabet [protected]
boolean deleteWhitespace [protected]
int intKey [protected]
Logger logger = Logger.getLogger(this.getClass()) [protected]
Map<String,String> replacementMap [protected]