IHttpServer currently does not negotiate with compression for the reason that I cannot decompress browser messages.Dumb question: Why is the data compressed? Did you enable compression in the negotiations of the connection with the client (I'm guessing here this has something to do with your iHttpServer)? How?
Yes, the HandShake is identical.Are you sure deflate is being negotiated? According to this https://github.com/eclipse/jetty.project/issues/288, deflate has been dropped in Jetty
aa 56 4a 49 2c 49 54 b2 8a ae 56 ca 4c 51 b2 52 4a 2a c9 2b 4e cd 4b 51 d2 51 4a 2d 4b cd 2b 01 8a 24 e7 64 26 67 2b d5 c6 02 45 4a 2a 0b 52 81 22 c5 a9 25 8e a5 25 f9 b9 89 25 99 c9 ae 20 55 c5 4a b5 00 00
ab 56 4a 49 2c 49 54 b2 8a ae 56 ca 4c 51 b2 52 4a 2a c9 2b 4e cd 4b 51 d2 51 4a 2d 4b cd 2b 01 8a 24 e7 64 26 67 2b d5 c6 02 45 4a 2a 0b 52 81 22 c5 a9 25 8e a5 25 f9 b9 89 25 99 c9 ae 20 55 c5 4a b5 00
The input is the same, but from the last test I think I understand that it depends on the algorithm. Adding in the right header zip.inflater decompresses correctly.This isn't really my expert area, but I remembered me pounding my head into the wall a couple of years back as I was making a bash script, piping things in multiple steps. And the end result wasn't at all what I expected. Turns out that one of the commands took the liberty of adding a newline at the end of its output, which messed up the process and my day.
So my naïve suggestion is to perhaps make sure that you and Erel actually are working on identical input? It's so easy to miss a newline last in the file, which in turn might make the output data one byte longer than expected.
Also: Erels CyberChef screenshot says "Dynamic Huffman Coding", yours say "Fixed Huffman Coding".
After several compression / decompression comparisons between the CompressedStreams class and the various tools I have come to the final conclusion. That CompressedStreams also requires the 78.9C header which must be added if it is not there.In java I solved it using java.util.zip.Inflater. Correctly it gave error for the header, in fact to be recognized as inflate the byte array must start with two specific Hex bytes 78,9C (decimal 120,156).
I put them at the beginning of the array and it works in Java.
Deflate.DecompressBytes doesn't work ... so in fact for B4i I'm still on the high seas.
Update: It seems that in iOs the addition of these header bytes should be avoided. See here
+---+---+
|CMF|FLG| (2 bytes - Defines the compression mode - More details below)
+---+---+---+---+
| DICTID | (4 bytes. Present only when FLG.FDICT is set.) - Mostly not set
+---+---+---+---+
|...compressed data...| (variable size of data)
+---+---+---+---+
| ADLER32 | (4 bytes of checksum)
+---+---+---+---+
Yes, I found it, but unfortunately it is an uncompressed checksum of the original data, so I can't get it.From the title it looks like an ADLER32 hash in which case the algorithm is here
Adler-32 - Wikipedia
The dictionary is a sequence of bytes which are initially fed to the compressor without producing any compressed output. DICT is the Adler-32 checksum of this sequence of bytes
This is how Apache does it, perhaps it can help?At this point there seems to be no way out
It would be interesting to know how they recover the original data from the packet size only. I can't even use legitimate meansThe kicker is that compression, as much as of is desirable for reducing network traffic, also introduces security issues, even with encrypted data.