Advertisement
Guest User

Untitled

a guest
Jul 29th, 2015
233
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. namespace XORenc
  2. {
  3. using System;
  4. using System.Linq;
  5.  
  6. class Program
  7. {
  8. static void Main()
  9. {
  10. var a = Console.ReadLine(); // Read text to cypher
  11. var key = Console.ReadLine()[0]; // Read key character
  12. var encoded = a.Select(x => (byte)(x ^ key)).ToArray(); // Encode text
  13. Console.WriteLine(Convert.ToBase64String(encoded)); // Write result as Base64
  14. }
  15. }
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement