Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static byte[] KEY = Encoding.ASCII.GetBytes("unknownkey");
- static public void Encrypt(byte[] Buffer)
- {
- byte Incrementor = Buffer[4];
- int Group = 0;
- int GroupCount = 0;
- for (int i = 5; i < Buffer.Length; i++)
- {
- int keyPoint = ((i - 5) % KEY.Length); // First Stage
- Buffer[i] ^= KEY[keyPoint];
- byte KeyVal = (byte)(Group % 256); // Second Stage
- if (KeyVal != Incrementor)
- {
- Buffer[i] ^= KeyVal;
- }
- Buffer[i] ^= Incrementor; // Third Stage
- GroupCount++;
- if (GroupCount == KEY.Length)
- {
- Group++;
- GroupCount = 0;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement