Advertisement
Guest User

Untitled

a guest
Nov 7th, 2018
443
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.75 KB | None | 0 0
  1. namespace Core.BitShift
  2. {
  3.     public class Crypt
  4.     {
  5.         public int getId()
  6.         {
  7.             return this.GetHashCode() / 4096;
  8.         }
  9.  
  10.         public int getShift()
  11.         {
  12.             return (this.getId() + 29890) % 7 + 1;
  13.         }
  14.  
  15.         public byte[] DeCrypt(byte[] data)
  16.         {
  17.             byte num = data[data.Length - 1];
  18.             for (int index = data.Length - 1; index > 0; --index)
  19.                 data[index] = (byte)(((int)data[index - 1] & (int)byte.MaxValue) << 8 - this.getShift() | ((int)data[index] & (int)byte.MaxValue) >> this.getShift());
  20.             data[0] = (byte)((int)num << 8 - this.getShift() | ((int)data[0] & (int)byte.MaxValue) >> this.getShift());
  21.             return data;
  22.         }
  23.     }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement