Advertisement
Guest User

Ciper

a guest
Jan 26th, 2020
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.34 KB | None | 0 0
  1.         public void Decrypt(Span<byte> src, Span<byte> dst)
  2.         {
  3.             if (!Decrypt2)
  4.             {
  5.                 for (int i = 0; i < src.Length; i++)
  6.                 {
  7.                     dst[i] = (byte)(src[i] ^ 0xAB);
  8.                     dst[i] = (byte)(dst[i] >> 4 | dst[i] << 4);
  9.                     dst[i] = (byte)(dst[i] ^ (_cryptKey2[_decryptCounter.Key2] ^ _cryptKey1[_decryptCounter.Key1]));
  10.                     _decryptCounter.Increment();
  11.                 }
  12.             }
  13.             else
  14.             {
  15.                 for (int i = 0; i < src.Length; i++)
  16.                 {
  17.                     dst[i] = (byte)(src[i] ^ 0xAB);
  18.                     dst[i] = (byte)(dst[i] >> 4 | dst[i] << 4);
  19.                     dst[i] = (byte)(dst[i] ^ (_cryptKey4[_decryptCounter.Key2] ^ _cryptKey3[_decryptCounter.Key1]));
  20.                     _decryptCounter.Increment();
  21.                 }
  22.             }
  23.         }
  24.  
  25.  
  26.  
  27.         public void Encrypt(Span<byte> src, Span<byte> dst)
  28.         {
  29.             for (int i = 0; i < src.Length; i++)
  30.             {
  31.                 dst[i] = (byte)(src[i] ^ 0xAB);
  32.                 dst[i] = (byte)(dst[i] >> 4 | dst[i] << 4);
  33.                 dst[i] = (byte)(dst[i] ^ (_cryptKey1[_encryptCounter.Key1] ^ _cryptKey2[_encryptCounter.Key2]));
  34.                 _encryptCounter.Increment();
  35.             }
  36.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement