Пример #1
0
 public void Encrypt(byte[] buffer)
 {
     for (int i = 0; i < buffer.Length; i++)
     {
         buffer[i] ^= (byte)0xAB;
         buffer[i]  = (byte)(buffer[i] >> 4 | buffer[i] << 4);
         buffer[i] ^= (byte)(_cryptKey1[_encryptCounter.Key1] ^ _cryptKey2[_encryptCounter.Key2]);
         _encryptCounter.Increment();
     }
 }
Пример #2
0
 public override void Decrypt(byte[] buffer)
 {
     for (int i = 0; i < buffer.Length; i++)
     {
         buffer[i] ^= (byte)0xAB;
         buffer[i]  = (byte)(buffer[i] >> 4 | buffer[i] << 4);
         buffer[i] ^= (byte)(CryptKey2[DecryptCounter.Key2] ^ CryptKey1[DecryptCounter.Key1]);
         DecryptCounter.Increment();
     }
 }