Inheritance diagram for CaesarCipherAnalyzer:
Collaboration diagram for CaesarCipherAnalyzer:Class to analyse ciphers based on the Ceasar substitution.
Public Types | |
| enum | DecipherMethod { PLAYFAIR = ("de.uni_koeln.spinfo.cryptology.cryptanalysis.plaintextgenerators.PlayfairCipherAnalyzer"), POLYBUS = ("de.uni_koeln.spinfo.cryptology.cryptanalysis.plaintextgenerators.PolybusCipherAnalyzer"), CAESAR = ("de.uni_koeln.spinfo.cryptology.cryptanalysis.plaintextgenerators.CaesarCipherAnalyzer"), VIGNERE = ("de.uni_koeln.spinfo.cryptology.cryptanalysis.plaintextgenerators.VignereCipherAnalyzer"), ATBASH = ("de.uni_koeln.spinfo.cryptology.cryptanalysis.plaintextgenerators.AtbashCipherAnalyzer"), STEGANOGRAPHIA_I = ("SteganographiaICipherAnalyzer"), STEGANOGRAPHIA_INCANTATION = ("de.uni_koeln.spinfo.cryptology.steganalysis.plaintextgenerators.SteganographiaIncantationAnalyzer"), POLYGRAPHIA_I = ("de.uni_koeln.spinfo.cryptology.steganalysis.plaintextgenerators.PolygraphiaICipherAnalyzer"), POLYGRAPHIA_IV = ("de.uni_koeln.spinfo.cryptology.steganalysis.plaintextgenerators.PolygraphiaIVCipherAnalyzer"), POLYGRAPHIA_V = ("de.uni_koeln.spinfo.cryptology.cryptanalysis.plaintextgenerators.PolygraphiaVCipherGenerator") } |
| enum | ConfigurationElement { KEY = ("Key"), ALPHABET = ("Alphabet"), REPLACEMENTS = ("Replacements"), WORD_SUBSTITUTES = ("Substitutes"), DELETE_WHITESPACE = ("Whitespace deletion") } |
Public Methods | |
| CaesarCipherAnalyzer () | |
| CaesarCipherAnalyzer (int key) | |
| CaesarCipherAnalyzer (int key, char[] alphabet) | |
| String | decipher (List< String > words) |
| String | decipher (String cipherText) |
| void | configure (Map< ConfigurationElement, String > configurations) |
| char[][] | buildPlayfairMatrix (String key) |
| 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< 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 DecipherMethod [inherited] |
Generates an decryptor 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.
| CaesarCipherAnalyzer | ( | int | key | ) |
Generates a crypto-analyzer 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). |
| CaesarCipherAnalyzer | ( | int | key, |
| char[] | alphabet | ||
| ) |
Generates a crypto-analyzer 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.
| 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, |
| 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, |
| 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 | ||
| ) | [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 decipher | ( | String | cipherText | ) |
Deciphers the specified text.
| cipherText | text to decipher. |
Implements Decipherer.
| String decipher | ( | List< String > | words | ) |
Returns the plain text of the specified cipher word sequence.
| words | Sequence of words to decipher. |
Implements Decipherer.
| 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. |
| 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] |
Returns a map of the replacements that were used by the component
| Map<String, String> getReplacements | ( | ) | [inherited] |
| 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, |
| 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 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 | ) | [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 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 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 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 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] |