modernaesthetics

RXOR - C#

Jun 7th, 2018
387
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.89 KB | None | 0 0
  1.         //------------------
  2.         //Creator: aeonhack
  3.         //Site: elitevs.net
  4.         //Created: 9/20/2012
  5.         //Changed: 9/20/2012
  6.         //Version: 1.0.0
  7.         //------------------
  8.         public byte[] RXOR(byte[] data, byte[] key)
  9.         {
  10.             int N1 = 11;
  11.             int N2 = 13;
  12.             int NS = 257;
  13.  
  14.             for (int I = 0; I <= key.Length - 1; I++)
  15.             {
  16.                 NS += NS % (key[I] + 1);
  17.             }
  18.  
  19.             byte[] T = new byte[data.Length];
  20.             for (int I = 0; I <= data.Length - 1; I++)
  21.             {
  22.                 NS = key[I % key.Length] + NS;
  23.                 N1 = (NS + 5) * (N1 & 255) + (N1 >> 8);
  24.                 N2 = (NS + 7) * (N2 & 255) + (N2 >> 8);
  25.                 NS = ((N1 << 8) + N2) & 255;
  26.  
  27.                 T[I] = (byte)(data[I] ^ (byte)(NS));
  28.             }
  29.  
  30.             return T;
  31.         }
Advertisement
Add Comment
Please, Sign In to add comment