Byte-identical TOC re-encryption: the only open-source RPF9 write path #26

Open
opened 2026-11-27 18:40:39 +00:00 by github-bot · 0 comments
Owner

@⁠nineforge0 on GitHub · 2026-11-27 18:36 UTC · original

forge9 is the only public tool that can re-encrypt the RPF9 TOC

Every other RPF9 tool is read-only or extract-only. forge9 implements the full encrypt/decrypt round trip:

Proven capabilities

  • Identity repack produces byte-identical output on common.rpf (418 entries), appdata0.rpf, script.rpf, shaders.rpf, and both of script.rpf's children
  • Re-encryption uses the same T-table block cipher, 13 rounds, CBC mode, and fixed IV as the original
  • Verification (repack --verify) reopens the output and compares every entry against the source
  • Mod packs apply hash-guarded patches and produce a valid, re-encrypted archive

The cipher

128-bit block cipher with 16 input S-boxes, 16 T-tables, and 16 per-key output S-boxes. forge9 inverts each T-table round by solving the 32×32 linear system over GF(2), precomputed as byte lookup tables (InverseRound).

What this enables

  • Modding: edit game configuration (XML, PSIN binary data) and produce valid archives
  • Research: inject instrumented payloads for analysis
  • Validation: confirm that the decryption is correct by round-tripping

See docs/rpf9_format.md §Encryption and docs/repack_validation.md for the full technical reference.

**@⁠nineforge0** on GitHub · 2026-11-27 18:36 UTC · [original](https://github.com/nineforge0/forge9/issues/26) ## forge9 is the only public tool that can re-encrypt the RPF9 TOC Every other RPF9 tool is read-only or extract-only. forge9 implements the full encrypt/decrypt round trip: ### Proven capabilities - **Identity repack** produces byte-identical output on common.rpf (418 entries), appdata0.rpf, script.rpf, shaders.rpf, and both of script.rpf's children - **Re-encryption** uses the same T-table block cipher, 13 rounds, CBC mode, and fixed IV as the original - **Verification** (`repack --verify`) reopens the output and compares every entry against the source - **Mod packs** apply hash-guarded patches and produce a valid, re-encrypted archive ### The cipher 128-bit block cipher with 16 input S-boxes, 16 T-tables, and 16 per-key output S-boxes. forge9 inverts each T-table round by solving the 32×32 linear system over GF(2), precomputed as byte lookup tables (`InverseRound`). ### What this enables - **Modding**: edit game configuration (XML, PSIN binary data) and produce valid archives - **Research**: inject instrumented payloads for analysis - **Validation**: confirm that the decryption is correct by round-tripping See [docs/rpf9_format.md](docs/rpf9_format.md) §Encryption and [docs/repack_validation.md](docs/repack_validation.md) for the full technical reference.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 18:40:39 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.