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); } }