Пример #1
0
        private static void CaesarHack()
        {
            Console.WriteLine("Input your message to hack");
            string message = Console.ReadLine();

            Console.WriteLine("Variants:");
            CaesarCipher.HackMessage(message);
        }
Пример #2
0
        private static void CaesarDecrypt()
        {
            Console.WriteLine("Input your message to decrypt");
            string message = Console.ReadLine();

            Console.WriteLine("Input key");
            int key     = int.Parse(Console.ReadLine());
            var Caesar2 = new CaesarCipher(key);

            Console.WriteLine(Caesar2.DecryptMessage(message));
        }
Пример #3
0
        private static void CaesarEncrypt()
        {
            Console.WriteLine("Input your message to encrypt (in English and without punctuation)");
            string message = Console.ReadLine().ToLower();

            message = message.Replace(" ", string.Empty);
            Console.WriteLine("Input key");
            int key     = int.Parse(Console.ReadLine());
            var Caesar1 = new CaesarCipher(key);

            Console.WriteLine(Caesar1.EncryptMessage(message));
        }