Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            Console.WriteLine("Exectuting Es1...");
            Es1.Exectute();

            Console.WriteLine("Exectuting Es2...");
            Es2.Exectute();
        }
Ejemplo n.º 2
0
 public static string XorHexStrings(string s1, string s2)
 {
     byte[] b1 = Es1.StringToByteArray(s1);
     byte[] b2 = Es1.StringToByteArray(s2);
     if (b1.Length == b2.Length)
     {
         byte[] result = new byte[b1.Length];
         for (int i = 0; i < b1.Length; i++)
         {
             result[i] = (byte)(b1[i] ^ b2[i]);
         }
         string hex = BitConverter.ToString(result).Replace("-", "");
         return(hex);
     }
     else
     {
         throw new ArgumentException("Strings should be of the same length.");
     }
 }