Пример #1
0
        protected byte[] Decrypt(byte[] encrypted, byte[] iv, byte[] streamsBuffer)
        {
            var decrypted = DeobUtils.AesDecrypt(encrypted, DeobUtils.Sha256Sum(streamsBuffer), iv);
            var sha       = SHA512.Create();
            var hash      = sha.ComputeHash(streamsBuffer);

            for (int i = 0; i < decrypted.Length; i += 64)
            {
                int j;
                for (j = 0; j < 64 && i + j < decrypted.Length; j++)
                {
                    decrypted[i + j] ^= (byte)(hash[j] ^ key6);
                }
                hash = sha.ComputeHash(decrypted, i, j);
            }
            return(decrypted);
        }