{
  "status": "shipping",
  "advantages": [],
  "limitations": [],
  "supersedes": [],
  "supersededBy": [],
  "firstSeen": null,
  "lastSeen": null,
  "updated": "2026-10-25",
  "slug": "bzip2",
  "term": "Bzip2",
  "aliases": [
    ".bz2"
  ],
  "definition": "Bzip2 is a lossless compression format with independently compressed blocks, per-block CRCs and a combined stream CRC.",
  "note": "Recovery: bzip2recover scans bit patterns and writes candidate one-block streams; bzip2 -t must validate each candidate. Successful splitting does not certify data or completeness. [manual] [source]\n\nBoundary damage: in a controlled four-block, 320000-byte fixture, a second-block marker bit left blocks 3 and 4 validated: 120039 bytes. An encoded-data bit instead left blocks 1, 3 and 4: 220020 bytes. A missing delimiter affected the preceding candidate too; this is scanner behavior, not irrecoverable loss. [study]\n\nStream checks: changing only the final CRC made the original fail while recovered blocks exactly reconstructed the input. Recovery creates new per-candidate framing. Original expectations, not candidate checks alone, establish completeness. [source] [study]\n\nPreserve fragments and missing intervals separately. Candidate numbers and compressed-bit positions do not give original uncompressed offsets. Joining fragments across a gap changes higher-level records. [study]\n\nBlock order: the combined CRC rotates a 32-bit accumulator by one bit and XORs each block CRC. Positions 32 blocks apart have equal weights. Exchanging blocks 1 and 33 in a designed bzip2 1.0.8 stream kept all stored CRCs and length unchanged; testing and decoding passed with different bytes. No individual block collision was needed. Shorter swaps are not universally guaranteed detection. [source] [order]\n\nUse a trusted whole-object digest or a manifest binding object, generation, position, length and digest. Unordered block hashes cannot establish order; authenticate the reference when tampering matters. [study]",
  "related": [
    "block-independent-compression",
    "cyclic-redundancy-check",
    "gzip",
    "backup-manifest",
    "restore-test"
  ],
  "citations": [
    {
      "id": "manual",
      "title": "Julian Seward. bzip2 and libbzip2 1.0.8: sections 2.3, 2.5 and 2.6 (recovery).",
      "url": "https://sourceware.org/bzip2/manual/manual.html",
      "accessed": "2026-10-20"
    },
    {
      "id": "source",
      "title": "bzip2 1.0.8 official source release: bzip2recover.c, bzlib.c and compress.c.",
      "url": "https://sourceware.org/pub/bzip2/bzip2-1.0.8.tar.gz",
      "accessed": "2026-10-20"
    },
    {
      "id": "study",
      "title": "Hesela: six bzip2 corruption fixtures, validated fragments and missing intervals.",
      "url": "https://hesela.com/analyses/bzip2-block-recovery-boundaries/",
      "accessed": "2026-10-20"
    },
    {
      "id": "order",
      "title": "Hesela: six designed native bzip2 block-order controls, source-visible rotate/XOR recurrence and exact-byte oracle.",
      "url": "https://hesela.dev/research/bzip2-block-order/results-system.json",
      "accessed": "2026-10-25"
    }
  ],
  "provenance": [
    "Controlled synthetic observations on recorded bzip2/bzip2recover 1.0.8 binaries, not fault probabilities or a claim of irrecoverable loss. Pristine data supplied the original-byte map.",
    "Runner: https://hesela.dev/research/bzip2-salvage.py ; results: https://hesela.dev/research/bzip2-salvage.json . Authored artifacts are CC0-1.0.",
    "Order supplement: https://hesela.dev/research/bzip2-block-order/probe.py ; source hashes: https://hesela.dev/research/bzip2-block-order/sources.json . Two retained bzip2 1.0.8 builds are not independent implementations; current system replay agrees. No field frequency or global novelty claim."
  ]
}
