private static void AffineDecrypt() { Console.WriteLine("Input your message to decrypt"); string message = Console.ReadLine(); Console.WriteLine("Input key a"); int a = ParseKey(); Console.WriteLine("Input key b"); int b = ParseKey(); var Affine2 = new AffineCipher(a, b); Console.WriteLine(Affine2.DecryptMessage(message)); }
private static void AffineEncrypt() { 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 a (must be relatively prime to the volume of the alphabet)"); int a = ParseKey(); Console.WriteLine("Input key b"); int b = ParseKey(); var Affine1 = new AffineCipher(a, b); Console.WriteLine(Affine1.EncryptMessage(message)); }