public static string Decode(string cipheredText) { cipher = new MyAtbashCipher(); return(string.Concat(cipheredText .ToLower() .Where(char.IsLetterOrDigit) .Select(l => char.IsLetter(l) ? cipher.Decode(l) : l))); }
public static string Encode(string plainText) { cipher = new MyAtbashCipher(); var cipherText = string.Concat(plainText .ToLower() .Where(char.IsLetterOrDigit) .Select(l => char.IsLetter(l) ? cipher.Encode(l) : l)); return(string.Concat(GroupCipheredText(cipherText, ' ', 5))); }