Exemplo n.º 1
0
    public void decrypt()
    {
        var polybius = new PolybiusSquare();
        var message  = System.IO.File.ReadAllText(input2);

        Console.WriteLine("Зашифрованный текст: " + message);
        Console.Write("Введите ключ: ");
        var pass       = Console.ReadLine().ToUpper();
        var cipherText = polybius.PolybiusDecrypt(message, pass);

        Console.WriteLine("Расшифрованный текст: {0}", cipherText);
        System.IO.File.WriteAllText(output1, cipherText);
    }
Exemplo n.º 2
0
    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();
    }