public void Encrypt() { var polybius = new PolybiusSquare(); var message = System.IO.File.ReadAllText(input1); Console.WriteLine("Шифруемый текст: " + message); Console.Write("Введите ключ: "); var pass = Console.ReadLine().ToUpper(); System.IO.File.WriteAllText(key, pass); var cipherText = polybius.PolibiusEncrypt(message, pass); Console.WriteLine("Зашифрованный текст: {0}", cipherText); System.IO.File.WriteAllText(input2, cipherText); }
static void Main(string[] args) { var polybius = new PolybiusSquare(); Console.Write("Введите текст: "); var message = Console.ReadLine().ToUpper(); Console.Write("Введите пароль(без повторов букв): "); var pass = Console.ReadLine().ToUpper(); var cipherText = polybius.PolibiusEncrypt(message, pass); Console.WriteLine("Зашифрованный текст: {0}", cipherText); Console.WriteLine("Расшифрованный текст: {0}", polybius.PolybiusDecrypt(cipherText, pass)); Console.ReadLine(); }