You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
675 B
26 lines
675 B
package cipher_analytical_machine.analyzers.caesar;
|
|
|
|
import cipher_analytical_machine.ciphers.caesar.Decrypted;
|
|
import java.util.Map;
|
|
|
|
public class FrequencyAnalyzer {
|
|
private String ciphertext;
|
|
private int key;
|
|
private String symbols;
|
|
private String symbol_frequences;
|
|
private Decrypted decryptor;
|
|
|
|
public FrequencyAnalyzer(String ciphertext, String symbols, String symbol_frequences, Decrypted decryptor) {
|
|
this.ciphertext = ciphertext;
|
|
this.key = 1;
|
|
this.symbols = symbols;
|
|
this.symbol_frequences = symbol_frequences;
|
|
this.decryptor = decryptor;
|
|
}
|
|
|
|
public String crack() {
|
|
return decryptor.decrypt(ciphertext, key, symbols);
|
|
}
|
|
}
|
|
|