|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objecthcrypto.analyzer.CryptoAnalyzer
hcrypto.analyzer.evolutionary.GaAnalyzer
hcrypto.analyzer.evolutionary.NgramGaAnalyzer
public class NgramGaAnalyzer
Assumes that the text is encrypted with simple substitution cipher and uses a frequency-based genetic algorithm to analyze it.
Its evaluation function uses an NgramArray with frequencies of N = 2, 3, or 4 (bigrams, trigrams, or tetragrams) to cryptanalyze transposition and substitution ciphers. Using the sum of the inverses of the frequencies as an evaluation of how accurately a decrypt matches the usual N-gram frequencies in a language is an idea described by Alex Griffing the developer of the "Automatic Cryptogram Solver". This program is based on R. Walde's NgramClimber.java. To compile and run from the TestAnalyzer application: cd ~crypto/hcryptoj/1.4/applications/testanalyzer javac -classpath ../../classes -d ../../classes ../../source/hcrypto/analyzer/NgramGaAnalyzer.java java -classpath ../../classes:. TestAnalyzer analyzers.NgramAnalyzer ga_paramfiles ngram.ga.cgrams.txt
| Field Summary |
|---|
| Fields inherited from class hcrypto.analyzer.CryptoAnalyzer |
|---|
PERMUTATION, PLAYFAIR, RAILFENCE, SIMPLESUB |
| Fields inherited from interface hcrypto.analyzer.Analyzer |
|---|
DECIPHER_LIMIT |
| Constructor Summary | |
|---|---|
NgramGaAnalyzer()
NgramGaAnalyzer() -- Default constructor |
|
NgramGaAnalyzer(GaParameters params,
AnalyzerFrame f)
NgramGaAnalyzer() -- this constructor is given an object containing parameter settings |
|
| Method Summary | |
|---|---|
void |
run()
run() conducts the GA run and reports the results. |
void |
setup(java.lang.String text)
setup() creates the population for the NgramGa. |
| Methods inherited from class hcrypto.analyzer.CryptoAnalyzer |
|---|
getReport, prettyPrint, setup, stopThread, threadIsStopped, toString |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public NgramGaAnalyzer()
public NgramGaAnalyzer(GaParameters params,
AnalyzerFrame f)
params - -- an object containing param1=val1 param2=val2 ...g - -- the AnalyzerFrame (GUI) for this analyzer| Method Detail |
|---|
public void setup(java.lang.String text)
setup in interface Analyzersetup in class GaAnalyzerpublic void run()
run in interface Analyzerrun in interface java.lang.Runnablerun in class GaAnalyzer
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||