|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objecthcrypto.analyzer.CryptoAnalyzer
hcrypto.analyzer.CaesarAnalyzer
public class CaesarAnalyzer
Assumes that the text it is passed is encrypted with a Caesar shift. It performs a brute-force Chi-square analysis to determine the likely shift.
| Field Summary |
|---|
| Fields inherited from class hcrypto.analyzer.CryptoAnalyzer |
|---|
PERMUTATION, PLAYFAIR, RAILFENCE, SIMPLESUB |
| Fields inherited from interface hcrypto.analyzer.Analyzer |
|---|
DECIPHER_LIMIT |
| Constructor Summary | |
|---|---|
CaesarAnalyzer()
|
|
CaesarAnalyzer(AnalyzerFrame f)
|
|
CaesarAnalyzer(TextStatistics ts)
|
|
| Method Summary | |
|---|---|
void |
doAnalysis()
This method performs an analysis of the text assuming a Caesar (shift) cipher was used. |
void |
doAnalysis(java.lang.String text)
|
java.lang.String |
getKeywordString()
|
int |
getOptimalShift()
This method performs a Chi-Square test to find the optimal shift. |
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 text)
setup() initializes the text and the result string. |
java.lang.String |
toString()
Every class should have a toString() method. |
| Methods inherited from class hcrypto.analyzer.CryptoAnalyzer |
|---|
prettyPrint, setup, stopThread, threadIsStopped |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public CaesarAnalyzer()
public CaesarAnalyzer(AnalyzerFrame f)
public CaesarAnalyzer(TextStatistics ts)
throws java.lang.NullPointerException
java.lang.NullPointerException| Method Detail |
|---|
public void setup(java.lang.String text)
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 java.lang.String getKeywordString()
getKeywordString in interface ExpertAnalyzerpublic java.lang.String toString()
CryptoAnalyzer
toString in class CryptoAnalyzerpublic void doAnalysis(java.lang.String text)
doAnalysis in interface ExpertAnalyzerpublic void doAnalysis()
public int getOptimalShift()
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 | |||||||||