๐ก๏ธ BLA (Blind LLM Agents) โ Adversarial defense shield that protects binaries, Electron apps, JS bundles, Python, and WebAssembly against AI reverse-engineering agents like REA. Poison -> Exhaust -> Hallucinate.
JavaScript adversarial-aiclaude-codecursorelectron-securityllm-securitymcpmcp-serverobfuscationreverse-engineeringwebassembly
Red/Blue round-7 ยท Blue
qybaihec0d7831aa9ee
diff --git a/.agents/skills/blind-llm-agents/SKILL.md b/.agents/skills/blind-llm-agents/SKILL.mdindex d75079a..25c71ba 100644--- a/.agents/skills/blind-llm-agents/SKILL.md+++ b/.agents/skills/blind-llm-agents/SKILL.md@@ -7,7 +7,7 @@ description: >Agents). Prefer this skill as the guide; call existing MCP tools / CLI โ do not inventnew MCP tools. Default verb: bla_harden. Refuse crack/RE of third-party software.metadata:- version: "1.5.10"+ version: "1.5.11"---# BLA: Blind LLM Agents@@ -24,7 +24,7 @@ model misjudgment on proprietary logic, or **one-click / ไธ้ฎๅ ๅบ** a build.Defensive only: protect **their own** artifacts. Refuse crack, RE, bypass PoCs, orattack playbooks against software they do not own.-**Principles (red-blue round-1+2+3+4+5+6):** do not ship a stable public WASM ABI without an explicit `wasm_preserve_exports` list; do not leave JS-side independent lane tables โ prefer whole-key chained mixing (`bla_lint_lanes` / harden refuse). **Do not** place plaintext seal/catalog JSON (`revision`, salts, certificate ciphertext) beside hardened outputs. Public compare targets must be **one-way** (SHA-256/HMAC/etc.); reversible ARX/Feistel digests as public `revision` are a key-recovery footgun (round-2 break โ **closed in round-3** when seal is digests-only). Enforce with `bla_lint_seal` / `bla lint-seal`; bankrupt harden **refuses** unless `allow_plaintext_seal` / `--allow-plaintext-seal`. Round-3 residual **gates**: `bla_lint_wasm_params` / `bla lint-wasm-params` โ bankrupt refuses clear `R2SEAL`/`R3PARM`/`R3CIPH`-class carriers unless `allow_wasm_clear_params`; `bla_lint_panel_derive` โ maximum/bankrupt **rewrites** `__vaultPanelDerive_*` to `_blaPd_*` unless `allow_stable_panel_derive`; bankrupt harden sets `selfSealRecommended` for multi-artifact trees (never auto for single-file) โ prefer **`self_seal`**. Round-4 gates: `bla_lint_js_aes_unwrap` / `bla lint-js-aes-unwrap` โ bankrupt **refuses** JS wrap-key + `create*iv` + fixed sealed hdr (e.g. `d17ea004`) unless `allow_js_aes_unwrap` (gate only โ **not** white-box AES; prefer in-WASM unwrap). `bla_lint_panel_derive` flags `deriveLocal` (rewritten to `_blaPdLocal_*`) and **refuses** `deriveLocal` + plaintext `panelTokenSha256` offline-oracle packaging unless `allow_panel_offline_oracle` (rename is not a crypto fix โ scrub digests / avoid derive UI). `self_seal` embeds **expected sibling SHA-256 hard-fail** when siblings exist at protect time (harden processes JS last); opaque-seed entanglement alone does **not** gate entitlement control flow. Round-5 gates: `bla_lint_js_wasm_hydrate_dump` / `bla lint-js-wasm-hydrate-dump` โ bankrupt **refuses** JS that copies salt/rounds/cipher from `WebAssembly.Memory` after hydrate/instantiate unless `allow_js_wasm_hydrate_dump` (host memory dump needs **no** Node `create*iv`; export rename alone does not close this โ prefer keep ARX+certify **inside** WASM so params never re-enter JS). Round-6 product pattern: export `unlock(keyPtr,keyLen)->outLen` (or equivalent) so ARX+compare+decrypt stay in WASM; JS only writes key bytes and reads the result โ do **not** call hydrate then decode salt/rounds/cipher in JS (closes the round-5 host memory-dump residual under bankrupt defaults). Honesty: WASM reverse-engineering of the unlock body remains a theoretical surface; gates do not claim white-box secrecy. Round-6 **break residual**: do **not** store a plaintext XOR mask adjacent to a masked entitlement pack (`salt||rounds||expected-words||cipher`) in WASM data โ static unmask needs no key; combined with invertible ARX expected-state compare this recovers the prize (`bla_lint_wasm_xor_mask_sidecar` / `bla lint-wasm-xor-mask-sidecar`; bankrupt refuses unless `allow_wasm_xor_mask_sidecar`). Prefer key-dependent unmask and **one-way** commitments inside WASM (not reversible expected words).+**Principles (red-blue round-1+2+3+4+5+6+7):** do not ship a stable public WASM ABI without an explicit `wasm_preserve_exports` list; do not leave JS-side independent lane tables โ prefer whole-key chained mixing (`bla_lint_lanes` / harden refuse). **Do not** place plaintext seal/catalog JSON (`revision`, salts, certificate ciphertext) beside hardened outputs. Public compare targets must be **one-way** (SHA-256/HMAC/etc.); reversible ARX/Feistel digests as public `revision` are a key-recovery footgun (round-2 break โ **closed in round-3** when seal is digests-only). Enforce with `bla_lint_seal` / `bla lint-seal`; bankrupt harden **refuses** unless `allow_plaintext_seal` / `--allow-plaintext-seal`. Round-3 residual **gates**: `bla_lint_wasm_params` / `bla lint-wasm-params` โ bankrupt refuses clear `R2SEAL`/`R3PARM`/`R3CIPH`-class carriers unless `allow_wasm_clear_params`; `bla_lint_panel_derive` โ maximum/bankrupt **rewrites** `__vaultPanelDerive_*` to `_blaPd_*` unless `allow_stable_panel_derive`; bankrupt harden sets `selfSealRecommended` for multi-artifact trees (never auto for single-file) โ prefer **`self_seal`**. Round-4 gates: `bla_lint_js_aes_unwrap` / `bla lint-js-aes-unwrap` โ bankrupt **refuses** JS wrap-key + `create*iv` + fixed sealed hdr (e.g. `d17ea004`) unless `allow_js_aes_unwrap` (gate only โ **not** white-box AES; prefer in-WASM unwrap). `bla_lint_panel_derive` flags `deriveLocal` (rewritten to `_blaPdLocal_*`) and **refuses** `deriveLocal` + plaintext `panelTokenSha256` offline-oracle packaging unless `allow_panel_offline_oracle` (rename is not a crypto fix โ scrub digests / avoid derive UI). `self_seal` embeds **expected sibling SHA-256 hard-fail** when siblings exist at protect time (harden processes JS last); opaque-seed entanglement alone does **not** gate entitlement control flow. Round-5 gates: `bla_lint_js_wasm_hydrate_dump` / `bla lint-js-wasm-hydrate-dump` โ bankrupt **refuses** JS that copies salt/rounds/cipher from `WebAssembly.Memory` after hydrate/instantiate unless `allow_js_wasm_hydrate_dump` (host memory dump needs **no** Node `create*iv`; export rename alone does not close this โ prefer keep ARX+certify **inside** WASM so params never re-enter JS). Round-6 product pattern: export `unlock(keyPtr,keyLen)->outLen` (or equivalent) so ARX+compare+decrypt stay in WASM; JS only writes key bytes and reads the result โ do **not** call hydrate then decode salt/rounds/cipher in JS (closes the round-5 host memory-dump residual under bankrupt defaults). Honesty: WASM reverse-engineering of the unlock body remains a theoretical surface; gates do not claim white-box secrecy. Round-6 **break residual**: do **not** store a plaintext XOR mask adjacent to a masked entitlement pack (`salt||rounds||expected-words||cipher`) in WASM data โ static unmask needs no key; combined with invertible ARX expected-state compare this recovers the prize (`bla_lint_wasm_xor_mask_sidecar` / `bla lint-wasm-xor-mask-sidecar`; bankrupt refuses unless `allow_wasm_xor_mask_sidecar`). Prefer key-dependent unmask and **one-way** commitments inside WASM (not reversible expected words). Round-7 product pattern: keep unlock-in-WASM; derive the XOR mask from the key inside `unlock` (do **not** embed a plaintext mask beside the blob); store a SHA-256 commitment of the ARX state for compare (not invertible expected words). Honesty: full WASM reverse-engineering of unlock can still recover algorithms; gates close the *static mask-sidecar + reversible expected-words* packaging footgun, not white-box secrecy.## Prerequisites (once)diff --git a/src/engine/wasm-xor-mask-sidecar-lint.ts b/src/engine/wasm-xor-mask-sidecar-lint.tsindex 492e331..7ce52d6 100644--- a/src/engine/wasm-xor-mask-sidecar-lint.ts+++ b/src/engine/wasm-xor-mask-sidecar-lint.ts@@ -388,6 +388,8 @@ export function buildTestWasmWithXorMaskSidecar(readonly words?: readonly [number, number, number, number];readonly cipher?: Buffer;readonly mask?: Buffer;+ /** Round-7 style: store masked blob only (key-dependent unmask) โ must NOT refuse. */+ readonly omitMaskSidecar?: boolean;} = {},): Buffer {const salt = options.salt ?? 0x12345678;@@ -408,7 +410,7 @@ export function buildTestWasmWithXorMaskSidecar(cipher.copy(plain, 26);const masked = Buffer.alloc(N);for (let i = 0; i < N; i++) masked[i] = plain[i]! ^ mask[i % 32]!;- const dataPayload = Buffer.concat([masked, mask]);+ const dataPayload = options.omitMaskSidecar ? masked : Buffer.concat([masked, mask]);const typeSec = section(1, [1, 0x60, 0, 0]);const funcSec = section(3, [1, 0]);diff --git a/tests/wasm-xor-mask-sidecar-lint.test.ts b/tests/wasm-xor-mask-sidecar-lint.test.tsindex 8a72a2b..645a639 100644--- a/tests/wasm-xor-mask-sidecar-lint.test.ts+++ b/tests/wasm-xor-mask-sidecar-lint.test.ts@@ -33,3 +33,11 @@ describe("wasm-xor-mask-sidecar-lint", () => {expect(looksLikeXorMaskedEntitlementPack(Buffer.alloc(100)).ok).toBe(false);});});++ it("does not refuse masked entitlement pack without adjacent plaintext mask (r7 key-dep style)", () => {+ const wasm = buildTestWasmWithXorMaskSidecar({ omitMaskSidecar: true });+ const report = lintWasmXorMaskSidecarBuffer(wasm, { path: "keydep.wasm" });+ expect(report.shouldRefuseBankrupt).toBe(false);+ expect(report.findings).toHaveLength(0);+ });+