public static void Main(string[] args) { String str = "Hello, World!"; VernamResponse response = Encode(str); Console.WriteLine(Decode(response)); }
public static String Decode(VernamResponse response) { StringBuilder decoded = new StringBuilder(); for (int i = 0; i < response.EncodedMessage.Length; i++) { decoded.Append((char)(response.EncodedMessage[i] ^ response.OTP[i])); } return(decoded.ToString()); }