Esempio n. 1
0
        public static void Main(string[] args)
        {
            String         str      = "Hello, World!";
            VernamResponse response = Encode(str);

            Console.WriteLine(Decode(response));
        }
Esempio n. 2
0
        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());
        }