parent
0a87ab9e91
commit
40af8401b2
@ -0,0 +1,23 @@
|
||||
package cipher_analytical_machine.analizers.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 Decrypted decryptor;
|
||||
|
||||
public FrequencyAnalyzer(String ciphertext, String symbols, Map<Character, Double> symbol_frequences, Decrypted decryptor) {
|
||||
this.ciphertext = ciphertext;
|
||||
this.key = 1;
|
||||
this.symbols = symbols;
|
||||
this.decryptor = decryptor;
|
||||
}
|
||||
|
||||
public String crack() {
|
||||
return decryptor.decrypt(ciphertext, key, symbols);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in new issue