Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- namespace XORenc
- {
- using System;
- using System.Linq;
- class Program
- {
- static void Main()
- {
- var a = Console.ReadLine(); // Read text to cypher
- var key = Console.ReadLine()[0]; // Read key character
- var encoded = a.Select(x => (byte)(x ^ key)).ToArray(); // Encode text
- Console.WriteLine(Convert.ToBase64String(encoded)); // Write result as Base64
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement