This folder is a standalone integration kit for adding an encrypted TRE archive format to an SWGSource-style client tree.
It does not modify the source checkout in place. Copy or install these files into a full source clone when you are ready to integrate.
tools/trecrypt.py- self-contained TREE0007 pack/list/extract/convert tool.tools/install_trecrypt.py- overlay installer for a full SWGSource tree.cpp/TreeFileCrypt.handcpp/TreeFileCrypt.cpp- Windows CNG AES-GCM helper.docs/TREE0007_FORMAT.md- exact on-disk format.docs/KEY_DELIVERY.md- practical key delivery and threat model notes.patches/TreeFile_SearchNode.integration.md- anchored C++ integration guide.v2/- hardened TREE0007 v2 kit usingTAG_0008, keyed path hashes, encrypted file records, chunked payload encryption, and session-secret HKDF.
Generate a key:
python E:\TRECRYPT\tools\trecrypt.py gen-keyPack a loose directory:
python E:\TRECRYPT\tools\trecrypt.py pack-dir `
--input-dir E:\some\loose\assets `
--output E:\some\out\secure_assets.tre `
--key-hex <64 hex chars>List or extract with the same key:
python E:\TRECRYPT\tools\trecrypt.py list --input E:\some\out\secure_assets.tre --key-hex <key>
python E:\TRECRYPT\tools\trecrypt.py extract --input E:\some\out\secure_assets.tre --out E:\some\extract --key-hex <key>From this folder:
python E:\TRECRYPT\tools\install_trecrypt.py --repo E:\Path\To\SWGSourceThe installer copies the new C++ helper and Python packer into the target repo
and prints the C++ reader edits that still need review. It intentionally does
not overwrite TreeFile_SearchNode.cpp automatically, because local SWG forks
usually carry reader changes for 0006, TOC quirks, and diagnostics.
TREE0007 uses real authenticated encryption, but if the client can decrypt an asset locally, a determined attacker can eventually capture the key or plaintext from that local process. The meaningful security gain comes from keeping archive keys out of source, out of shipped TRE files, and out of static client binaries. Use launcher/server key delivery for production.
For the tighter design, use v2/. It removes filenames from the archive and
requires a live session secret before even path lookup can work.