|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objecthcrypto.analyzer.CryptoAnalyzer
hcrypto.analyzer.VigenereAnalyzer
public class VigenereAnalyzer
Assumes that the text it is passed is encrypted with a Vigenere cipher. It performs both the Kasiski Test and the Superposition Analysis.
| Field Summary | |
|---|---|
static int |
MAX_BIGRAMS
|
static int |
MAX_CONTACT
|
static int |
MAX_FACTORS
|
static int |
MAX_KEYWORD
|
static double |
SUPERPOSNUMBER
|
| Fields inherited from class hcrypto.analyzer.CryptoAnalyzer |
|---|
PERMUTATION, PLAYFAIR, RAILFENCE, SIMPLESUB |
| Fields inherited from interface hcrypto.analyzer.Analyzer |
|---|
DECIPHER_LIMIT |
| Constructor Summary | |
|---|---|
VigenereAnalyzer()
|
|
VigenereAnalyzer(AnalyzerFrame f)
|
|
VigenereAnalyzer(TextStatistics ts)
|
|
| Method Summary | |
|---|---|
void |
computeBigramDistances(java.lang.String s)
|
void |
computeSuperpositionAnalysis(java.lang.String s)
This method performs a superposition test. |
void |
doAnalysis()
|
void |
doAnalysis(java.lang.String s)
|
java.lang.String |
estimateKeyword(int keyLen)
To find the find the keyword we break the cryptogram into keyLen monoalphabetic cryptograms, each of which is obtained by a Caesar shift from the standard alphabet. |
int |
estimateKeywordLength(int[] factors)
|
java.lang.String |
getKeywordString()
|
int |
getOptimalShift(int firstChar,
int displ)
This method performs a Chi-Square test to find the optimal Caesar shift on a polyalphabetic text. |
java.lang.String |
getReport()
Part of Analyzer interface. |
void |
run()
Part of Analyzer and Runnable interface. |
void |
setup(java.lang.String s)
setup() initializes the text and the result string. |
| Methods inherited from class hcrypto.analyzer.CryptoAnalyzer |
|---|
prettyPrint, setup, stopThread, threadIsStopped, toString |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final int MAX_BIGRAMS
public static final int MAX_FACTORS
public static final int MAX_KEYWORD
public static final int MAX_CONTACT
public static final double SUPERPOSNUMBER
| Constructor Detail |
|---|
public VigenereAnalyzer()
public VigenereAnalyzer(AnalyzerFrame f)
public VigenereAnalyzer(TextStatistics ts)
throws java.lang.NullPointerException
java.lang.NullPointerException| Method Detail |
|---|
public void setup(java.lang.String s)
CryptoAnalyzer
setup in interface Analyzersetup in class CryptoAnalyzerpublic void run()
CryptoAnalyzer
run in interface Analyzerrun in interface java.lang.Runnablerun in class CryptoAnalyzerpublic java.lang.String getReport()
CryptoAnalyzer
getReport in interface AnalyzergetReport in class CryptoAnalyzerpublic void computeSuperpositionAnalysis(java.lang.String s)
public void computeBigramDistances(java.lang.String s)
public java.lang.String getKeywordString()
getKeywordString in interface ExpertAnalyzerpublic void doAnalysis(java.lang.String s)
doAnalysis in interface ExpertAnalyzerpublic void doAnalysis()
public int estimateKeywordLength(int[] factors)
public java.lang.String estimateKeyword(int keyLen)
public int getOptimalShift(int firstChar,
int displ)
firstChar - - the location of the first character in the cryptotextdispl - - the displacement (keyword length) or cycle length
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||