private static void Encrypt(byte[] target, int targetOffset, byte[] source, int sourceOffset, int length, ref EncryptContext ctx) { int si = sourceOffset; int ti = targetOffset; for (int i = 0; i < length; i++, si++, ti++) { var p = source[si]; ctx.Hash ^= p << ((ctx.Index % 4) * 8); target[ti] = (byte)(p ^ ctx.Key); ctx.Index += 1; } }