Inheritance diagram for CaesarCipherGenerator:
Collaboration diagram for CaesarCipherGenerator:Class that generates ciphers based on the Ceasar substitution.
Public Types | |
| enum | EncipherMethod { ATBASH = ("de.uni_koeln.spinfo.cryptology.cryptanalysis.ciphergenerators.AtbashCipherGenerator"), GEMATRIA = ("de.uni_koeln.spinfo.cryptology.cryptanalysis.ciphergenerators.GematriaValueGenerator"), PLAYFAIR = ("de.uni_koeln.spinfo.cryptology.cryptanalysis.ciphergenerators.PlayfairCipherGenerator"), POLYBUS = ("de.uni_koeln.spinfo.cryptology.cryptanalysis.ciphergenerators.PolybusCipherGenerator"), CAESAR = ("de.uni_koeln.spinfo.cryptology.cryptanalysis.ciphergenerators.CaesarCipherGenerator"), VIGNERE = ("de.uni_koeln.spinfo.cryptology.cryptanalysis.ciphergenerators.VignereCipherGenerator"), POLYGRAPHIA_I = ("de.uni_koeln.spinfo.cryptology.steganalysis.ciphergenerators.PolygraphiaICipherGenerator"), POLYGRAPHIA_III = ("de.uni_koeln.spinfo.cryptology.steganalysis.ciphergenerators.PolygraphiaIIICipherGenerator"), POLYGRAPHIA_V = ("de.uni_koeln.spinfo.cryptology.cryptanalysis.ciphergenerators.PolygraphiaVCipherGenerator") } |
| enum | ConfigurationElement { KEY = ("Key"), ALPHABET = ("Alphabet"), REPLACEMENTS = ("Replacements"), WORD_SUBSTITUTES = ("Substitutes"), DELETE_WHITESPACE = ("Whitespace deletion") } |
Public Methods | |
| CaesarCipherGenerator () | |
| CaesarCipherGenerator (int key) | |
| CaesarCipherGenerator (int key, char[] alphabet) | |
| String | encipher (String plainText) |
| String | encipher (List< String > words) |
| void | configure (Map< ConfigurationElement, String > configurations) |
| char[][] | buildPlayfairMatrix (String key) |
| int | gematrieValue (String toSubstitute, char[] alphabet) |
| int | gematrieValue (String toSubstitute, Map< Character, Integer > substitutionMap) |
| int | gematrieValue (String toSubstitute) |
| Map< Character, Integer > | getGematrieValues () |
| void | setGematrieValues (Map< Character, Integer > gematrieValues) |
| String | atbashCipher (String toSubstitute, Map< Character, Character > substitutions) |
| String | atbashCipher (String toSubstitute, char[] alphabet) |
| String | atbashCipher (String toSubstitute) |
| String | caesarCipher (String toSubstitute, Map< Character, Character > substitutions) |
| String | caesarCipher (String toSubstitute, int addition, char[] alphabet) |
| String | caesarCipher (String toSubstitute, int addition) |
| String | vignereCipher (String toSubstitute, List< Map< Character, Character >> vignereSubstitutions, int position) |
| String | vignereCipher (String toSubstitute, String key, char[] alphabet, int position) |
| String | vignereCipher (String toSubstitute, String key, int position) |
| String | polygraphiaVCipher (String toSubstitute, List< Map< Character, Character >> vignereSubstitutions, int position) |
| String | polygraphiaVCipher (String toSubstitute, char[] alphabet, int position) |
| String | polygraphiaVCipher (String toSubstitute, int position) |
| String | polybusCipher (String toSubstitute, Map< Integer, Integer > substitutions) |
| String | polybusCipher (String toSubstitute, char[] alphabet, int matrixWidth) |
| String | polybusCipher (String toSubstitute) |
| String | playfairCipher (String toSubstitute, char[][] matrix, Map< Character, Point > charPositions) |
| String | playfairCipher (String toSubstitute, String key) |
| Map< Character, Character > | getSubstitutions () |
| void | setSubstitutions (Map< Character, Character > substitutions) |
| List< Map< Character, Character > > | getVignereSubstitutions () |
| void | setVignereSubstitutions (List< Map< Character, Character >> vignereSubstitutions) |
| Map< Integer, Integer > | getPolybusSubstitutions () |
| void | setPolybusSubstitutions (Map< Integer, Integer > polybusSubstitutions) |
| char[][] | getPlayfairMatrix () |
| void | setPlayfairMatrix (char[][] playfairMatrix) |
| Map< Character, Point > | getPlayfairMatrixCharPositions () |
| void | setPlayfairMatrixCharPositions (Map< Character, Point > playfairMatrixCharPositions) |
| String | getKey () |
| void | setKey (String key) |
| int | getAddition () |
| void | setAddition (int addition) |
| boolean | isDeleteWhitespaces () |
| void | setDeleteWhitespaces (boolean deleteWhitespaces) |
| int | getPosition () |
| void | setPosition (int position) |
| void | incPosition (int increment) |
| Set< Character > | getAlphabet () |
| void | setAlphabet (char[] alphabet) |
| String | replaceAll (String toProcess) |
| Map< String, String > | getReplacements () |
| Map< String, String > | getReplacements () |
| Set< Character > | getAlphabet () |
Public Static Methods | |
| static char[] | getDefaultAlphabet () |
| static char[] | getDefaultAlphabetWithoutChar (char ch) |
| static char[] | getTrithemianAlphabet () |
| static Map< String, String > | trithemianAlphabetReplacements () |
Protected Methods | |
| Map< Character, Character > | buildCeasarSubstitutionMap (char[] alphabet, int addition) |
| Map< Character, Integer > | buildGematrieSubstitutionMap (char[] alphabet) |
| Map< Integer, Integer > | buildPolybusSubstitutionMap (char[] alphabet, int matrixWidth) |
| List< Integer > | getPolybusInputUnits (String input) |
| String | getPolybusOutputUnit (Integer output) |
| Map< Character, Character > | buildAtbashSubstitutionMap (char[] alphabet) |
| List< Map< Character, Character > > | buildVignereSubstitutions (char[] alphabet, String key) |
| List< String > | getBigrams (String toSplit) |
| Map< Character, Point > | getCharPositions (char[][] matrix) |
| boolean | checkStringKey (String stringKey, String defaultKey) |
| 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()) |
enum ConfigurationElement [inherited] |
enum EncipherMethod [inherited] |
Generates an encryptor based on a Caesar substitution on latin default alphabet (a-z), and key 3, if this will not be configured by the configure(Map<String, String> configurations) method.
| CaesarCipherGenerator | ( | int | key | ) |
Generates an encryptor based on a caesar substitution with the specified key and the latin default alphabet (a-z).
| key | Ceasar key (offset position of the cipher alphabet). |
| CaesarCipherGenerator | ( | int | key, |
| char[] | alphabet | ||
| ) |
Generates an encryptor based on a caesar substitution with the specified key and alphabet.
| key | Ceasar key (offset position of the cipher alphabet). |
| alphabet | the substitution alphabet |
| String atbashCipher | ( | String | toSubstitute, |
| Map< Character, Character > | substitutions | ||
| ) | [inherited] |
Substitutes the specified string using the Atbash method (monoalphabetical, monographical, monopartit).
| toSubstitute | String to substitute. |
| substitutions | Map of substitutions. |
| String atbashCipher | ( | String | toSubstitute, |
| char[] | alphabet | ||
| ) | [inherited] |
Substitutes the specified string using the Atbash method (monoalphabetical, monographical, monopartit).
| toSubstitute | String to substitute |
| alphabet | Defined alphabet. |
| String atbashCipher | ( | String | toSubstitute | ) | [inherited] |
Substitutes the specified string using the Atbash method (monoalphabetical, monographical, monopartit). Uses latin default alphabet.
| toSubstitute | String to substitute |
| Map<Character,Character> buildAtbashSubstitutionMap | ( | char[] | alphabet | ) | [protected, inherited] |
| Map<Character,Character> buildCeasarSubstitutionMap | ( | char[] | alphabet, |
| int | addition | ||
| ) | [protected, virtual, inherited] |
Implements CryptoCipherUtils.
| Map<Character,Integer> buildGematrieSubstitutionMap | ( | char[] | alphabet | ) | [protected, inherited] |
| char [][] buildPlayfairMatrix | ( | String | key | ) | [virtual, inherited] |
Implements CryptoCipherUtils.
| Map<Integer,Integer> buildPolybusSubstitutionMap | ( | char[] | alphabet, |
| int | matrixWidth | ||
| ) | [protected, virtual, inherited] |
Implements CryptoCipherUtils.
| List<Map<Character,Character> > buildVignereSubstitutions | ( | char[] | alphabet, |
| String | key | ||
| ) | [protected, inherited] |
| String caesarCipher | ( | String | toSubstitute, |
| Map< Character, Character > | substitutions | ||
| ) | [inherited] |
Substitutes the specified string using the Caesar method (monoalphabetical, monographical, monopartit).
| toSubstitute | String to substitute. |
| substitutions | Defined Substitutions. |
| String caesarCipher | ( | String | toSubstitute, |
| int | addition, | ||
| char[] | alphabet | ||
| ) | [inherited] |
Substitutes the specified string using the Caesar method (monoalphabetical, monographical, monopartit).
| toSubstitute | String to substitute. |
| addition | Key to generate substitution matrix. |
| alphabet | Defined alphabet. |
| String caesarCipher | ( | String | toSubstitute, |
| int | addition | ||
| ) | [inherited] |
Substitutes the specified string using the Caesar method (monoalphabetical, monographical, monopartit). Uses latin default alphabet.
| toSubstitute | String to substitute. |
| addition | Key to generate substitution matrix. |
| boolean checkAlphabet | ( | String | alphabetString, |
| char[] | defaultAlphabet | ||
| ) | [protected, inherited] |
Builds alphabet from specified string, if not null and not empty. Else the specified default alphabet will be set as alphabet.
| alphabetString | String to set as alphabet. |
| defaultAlphabet | default alphabet. |
| boolean checkIntKey | ( | String | intKeyString, |
| int | defaultKey | ||
| ) | [protected, inherited] |
Builds an integer key from the specified string.
| intKeyString | integer key as string |
| defaultKey | key to set if integer key could not be build from specified string. |
| boolean checkReplacements | ( | String | replacementString | ) | [protected, inherited] |
Builds replacement map from specified string that should be parsable CSV data.
| replacementString | replacements as csv data. |
| boolean checkStringKey | ( | String | stringKey, |
| String | defaultKey | ||
| ) | [protected, inherited] |
| void checkWSDeletion | ( | String | deleteWhitespace | ) | [protected, inherited] |
If specified string equals true, whitespace will be deleted in the substituted text.
| deleteWhitespace | boolean value as string |
| void configure | ( | Map< ConfigurationElement, String > | configurations | ) |
Configures the Cryptologer with the specified ConfigurationElement - String value pairs.
| configurations | Map of ConfigurationElement - String value pairs |
Implements Cryptologer.
| String encipher | ( | List< String > | words | ) |
Returns the cipher text of the specified cipher word sequence. Some methods (eg. Playfair) delete white spaces.
| words | Sequence of words to encipher. |
Implements Encipherer.
| String encipher | ( | String | plainText | ) |
Enciphers the specified text.
| plainText | text to encipher. |
Implements Encipherer.
| int gematrieValue | ( | String | toSubstitute, |
| Map< Character, Integer > | substitutionMap | ||
| ) | [inherited] |
Calculates the Gematrie value of the specified string by using the specified substitutions.
| toSubstitute | to process. |
| substitutionMap | Map of substitutions. |
| int gematrieValue | ( | String | toSubstitute | ) | [inherited] |
Calculates the Gematrie value of the specified string and latin default alphabet (a-z).
| toSubstitute | to process. |
| int gematrieValue | ( | String | toSubstitute, |
| char[] | alphabet | ||
| ) | [inherited] |
Calculates the Gematrie value of the specified string by using the specified alphabet.
| toSubstitute | to process. |
| alphabet | underlying alphabet. |
| int getAddition | ( | ) | [inherited] |
| Set<Character> getAlphabet | ( | ) | [inherited] |
Returns a set of the alphabet of replacement characters
| Set<Character> getAlphabet | ( | ) | [inherited] |
Returns the alphabet of this crypto component.
| String getAlphabetAsStringKey | ( | int | start | ) | [protected, inherited] |
Returns the alphabet as string key (starts from the specified position, e.g. 1 for a).
| start | Position of the alphabet to start. |
| List<String> getBigrams | ( | String | toSplit | ) | [protected, inherited] |
| Map<Character,Point> getCharPositions | ( | char | matrix[][] | ) | [protected, inherited] |
| static char [] getDefaultAlphabet | ( | ) | [static, inherited] |
Returns the default alphabet (a-z), lower case letters.
| static char [] getDefaultAlphabetWithoutChar | ( | char | ch | ) | [static, inherited] |
Returns the default alphabet (a-z) without the specified character. Needed e.g. to get 25 letters for a 5 * 5 matrix.
| ch | character to ignore. |
| Map<Character, Integer> getGematrieValues | ( | ) | [inherited] |
Returns the gematrie values.
| String getKey | ( | ) | [inherited] |
| char [][] getPlayfairMatrix | ( | ) | [inherited] |
| Map<Character, Point> getPlayfairMatrixCharPositions | ( | ) | [inherited] |
| List<Integer> getPolybusInputUnits | ( | String | input | ) | [protected, virtual, inherited] |
Implements CryptoCipherUtils.
| String getPolybusOutputUnit | ( | Integer | output | ) | [protected, virtual, inherited] |
Implements CryptoCipherUtils.
| Map<Integer, Integer> getPolybusSubstitutions | ( | ) | [inherited] |
| int getPosition | ( | ) | [inherited] |
| Map<String, String> getReplacements | ( | ) | [inherited] |
| Map<String, String> getReplacements | ( | ) | [inherited] |
Returns a map of the replacements that were used by the component
| Map<Character, Character> getSubstitutions | ( | ) | [inherited] |
| static char [] getTrithemianAlphabet | ( | ) | [static, inherited] |
Returns the Trithemian alphabet: abcdefghiklmnopqrstuxyzw.
| List<Map<Character, Character> > getVignereSubstitutions | ( | ) | [inherited] |
| void incPosition | ( | int | increment | ) | [inherited] |
| boolean isDeleteWhitespaces | ( | ) | [inherited] |
| String playfairCipher | ( | String | toSubstitute, |
| char | matrix[][], | ||
| Map< Character, Point > | charPositions | ||
| ) | [inherited] |
Substitutes the specified string using the Playfair method (monoalphabetical, bigraphical, bipartit). The substitution string will be lower cased, 'j' will be treated as 'i'. If it contains letters not defined in the matrix (key letters + default alphabet letters), they were replaced by 'x' (this is also true for whitespace). be treated as 'i'. The matrix should contain a 'x', because this character is needed as default char.
| toSubstitute | String to substitute. |
| matrix | Substitution matrix. |
| charPositions | Map of matrix' character positions |
| String playfairCipher | ( | String | toSubstitute, |
| String | key | ||
| ) | [inherited] |
Substitutes the specified string using the Playfair method (monoalphabetical, bigraphical, bipartit). The methods underlying matrix will be constructed by the specified key string. The substitution string will be lower cased, 'j' will be treated as 'i'. If it contains letters not defined in the matrix (key letters + default alphabet letters), they were replaced by 'x' (this is also true for whitespace). The characters of the key will be placed at the first positions of the matrix. Upper case letters were transformed to lower case letters. Here again, 'j' will be treated as 'i'. The key should not contain more than 24 different letters (25, if it contains a 'x', because this character is needed as default char).
| toSubstitute | String to substitute. |
| key | the key characters. |
| String polybusCipher | ( | String | toSubstitute | ) | [inherited] |
Substitutes the specified string using the Polybus method (monoalphabetical, monographical, bipartit). Uses latin default alphabet ('j'='i') and matrixWidth of 5.
| toSubstitute | String to substitute. |
| String polybusCipher | ( | String | toSubstitute, |
| Map< Integer, Integer > | substitutions | ||
| ) | [inherited] |
Substitutes the specified string using the Polybus method (monoalphabetical, monographical, bipartit).
| toSubstitute | String to substitute. |
| substitutions | Map of substitutions |
| String polybusCipher | ( | String | toSubstitute, |
| char[] | alphabet, | ||
| int | matrixWidth | ||
| ) | [inherited] |
Substitutes the specified string using the Polybus method (monoalphabetical, monographical, bipartit).
| toSubstitute | String to substitute |
| alphabet | Defined alphabet. |
| matrixWidth | Width of the substitution matrix. |
| String polygraphiaVCipher | ( | String | toSubstitute, |
| int | position | ||
| ) | [inherited] |
Substitutes the specified string using the method from Trithemius' Polygraphia V (polyalphabetical, monographical, monopartit). Uses Trithemian alphabet (abcdefghiklmopqrstuxyzw).
| toSubstitute | String to substitute. |
| String polygraphiaVCipher | ( | String | toSubstitute, |
| char[] | alphabet, | ||
| int | position | ||
| ) | [inherited] |
Substitutes the specified string using the method from Trithemius' Polygraphia V (polyalphabetical, monographical, monopartit).
| toSubstitute | String to substitute. |
| alphabet | Defined alphabet. |
| String polygraphiaVCipher | ( | String | toSubstitute, |
| List< Map< Character, Character >> | vignereSubstitutions, | ||
| int | position | ||
| ) | [inherited] |
Substitutes the specified string using the method from Trithemius' Polygraphia V (polyalphabetical, monographical, monopartit).
| toSubstitute | String to substitute. |
| vignereSubstitutions | List of substitution maps. |
| String replaceAll | ( | String | toProcess | ) | [inherited] |
Replaces characters of the specified string by the replacements set in this.
| toProcess | String to process. |
| void setAddition | ( | int | addition | ) | [inherited] |
| void setAlphabet | ( | char[] | alphabet | ) | [inherited] |
Sets the alphabet of this crypto component.
| alphabet | to set. |
| void setDeleteWhitespaces | ( | boolean | deleteWhitespaces | ) | [inherited] |
| void setGematrieValues | ( | Map< Character, Integer > | gematrieValues | ) | [inherited] |
Sets the gematrie values.
| gematrieValues | to set. |
| void setKey | ( | String | key | ) | [inherited] |
| void setPlayfairMatrix | ( | char | playfairMatrix[][] | ) | [inherited] |
| void setPlayfairMatrixCharPositions | ( | Map< Character, Point > | playfairMatrixCharPositions | ) | [inherited] |
| void setPolybusSubstitutions | ( | Map< Integer, Integer > | polybusSubstitutions | ) | [inherited] |
| void setPosition | ( | int | position | ) | [inherited] |
| void setSubstitutions | ( | Map< Character, Character > | substitutions | ) | [inherited] |
| void setVignereSubstitutions | ( | List< Map< Character, Character >> | vignereSubstitutions | ) | [inherited] |
| static Map<String,String> trithemianAlphabetReplacements | ( | ) | [static, inherited] |
Returns a map of default alphabet values and their replacements in the T. alphabet.
| String vignereCipher | ( | String | toSubstitute, |
| String | key, | ||
| char[] | alphabet, | ||
| int | position | ||
| ) | [inherited] |
Substitutes the specified string using the Vignère method (polyalphabetical, monographical, monopartit).
| toSubstitute | String to substitute. |
| key | Key to generate substitution matrix. |
| alphabet | Defined alphabet. |
| String vignereCipher | ( | String | toSubstitute, |
| String | key, | ||
| int | position | ||
| ) | [inherited] |
Substitutes the specified string using the Vignère method (polyalphabetical, monographical, monopartit). Uses latin default alphabet.
| toSubstitute | String to substitute. |
| key | Key to generate substitution matrix. |
| String vignereCipher | ( | String | toSubstitute, |
| List< Map< Character, Character >> | vignereSubstitutions, | ||
| int | position | ||
| ) | [inherited] |
Substitutes the specified string using the Vignère method (polyalphabetical, monographical, monopartit).
| toSubstitute | String to substitute. |
| vignereSubstitutions | Defined Substitutions. |
char [] alphabet [protected, inherited] |
boolean deleteWhitespace [protected, inherited] |
int intKey [protected, inherited] |
Logger logger = Logger.getLogger(this.getClass()) [protected, inherited] |
Map<String,String> replacementMap [protected, inherited] |