@weave_protocol/yoxallismus 0.0.1 → 0.2.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (64) hide show
  1. package/README.md +236 -16
  2. package/SECURITY.md +110 -0
  3. package/SECURITY_ADVISORIES.md +86 -0
  4. package/SKILL.md +52 -0
  5. package/THREAT_MODEL.md +187 -0
  6. package/WIRE_FORMAT.md +102 -0
  7. package/dist/aead.d.ts +44 -0
  8. package/dist/aead.d.ts.map +1 -0
  9. package/dist/aead.js +96 -0
  10. package/dist/aead.js.map +1 -0
  11. package/dist/cascade.d.ts +31 -0
  12. package/dist/cascade.d.ts.map +1 -0
  13. package/dist/cascade.js +74 -0
  14. package/dist/cascade.js.map +1 -0
  15. package/dist/cli.d.ts +16 -0
  16. package/dist/cli.d.ts.map +1 -0
  17. package/dist/cli.js +501 -0
  18. package/dist/cli.js.map +1 -0
  19. package/dist/double-ratchet.d.ts +106 -0
  20. package/dist/double-ratchet.d.ts.map +1 -0
  21. package/dist/double-ratchet.js +238 -0
  22. package/dist/double-ratchet.js.map +1 -0
  23. package/dist/index.d.ts +54 -0
  24. package/dist/index.d.ts.map +1 -0
  25. package/dist/index.js +79 -0
  26. package/dist/index.js.map +1 -0
  27. package/dist/kdf.d.ts +33 -0
  28. package/dist/kdf.d.ts.map +1 -0
  29. package/dist/kdf.js +45 -0
  30. package/dist/kdf.js.map +1 -0
  31. package/dist/kem.d.ts +79 -0
  32. package/dist/kem.d.ts.map +1 -0
  33. package/dist/kem.js +220 -0
  34. package/dist/kem.js.map +1 -0
  35. package/dist/labels.d.ts +51 -0
  36. package/dist/labels.d.ts.map +1 -0
  37. package/dist/labels.js +93 -0
  38. package/dist/labels.js.map +1 -0
  39. package/dist/ratchet.d.ts +38 -0
  40. package/dist/ratchet.d.ts.map +1 -0
  41. package/dist/ratchet.js +91 -0
  42. package/dist/ratchet.js.map +1 -0
  43. package/dist/sealed.d.ts +33 -0
  44. package/dist/sealed.d.ts.map +1 -0
  45. package/dist/sealed.js +40 -0
  46. package/dist/sealed.js.map +1 -0
  47. package/dist/serialize.d.ts +20 -0
  48. package/dist/serialize.d.ts.map +1 -0
  49. package/dist/serialize.js +97 -0
  50. package/dist/serialize.js.map +1 -0
  51. package/dist/types.d.ts +67 -0
  52. package/dist/types.d.ts.map +1 -0
  53. package/dist/types.js +6 -0
  54. package/dist/types.js.map +1 -0
  55. package/dist/v1-compat.d.ts +37 -0
  56. package/dist/v1-compat.d.ts.map +1 -0
  57. package/dist/v1-compat.js +58 -0
  58. package/dist/v1-compat.js.map +1 -0
  59. package/dist/wire.d.ts +21 -0
  60. package/dist/wire.d.ts.map +1 -0
  61. package/dist/wire.js +114 -0
  62. package/dist/wire.js.map +1 -0
  63. package/package.json +53 -7
  64. package/index.js +0 -27
package/README.md CHANGED
@@ -1,26 +1,246 @@
1
- # @weave_protocol/yoxallismus — stub
1
+ # šŸ” @weave_protocol/yoxallismus
2
2
 
3
- **This 0.0.1 release is a stub.** It exists only because npm requires every
4
- package to have a `latest` tag, and we don't want an unaudited beta
5
- cryptographic library pulled in by default `npm install`.
3
+ > **Post-quantum cryptographic composition layer for AI agents.**
4
+ > Built on NIST-standardized primitives. Composed for multi-agent, memory-persistent, headless-tool architectures.
6
5
 
7
- ## To install the real package
6
+ [![npm](https://img.shields.io/npm/v/@weave_protocol/yoxallismus?color=000&style=flat-square)](https://www.npmjs.com/package/@weave_protocol/yoxallismus)
7
+ [![License](https://img.shields.io/badge/license-Apache--2.0-000?style=flat-square)](../LICENSE)
8
+ [![Status](https://img.shields.io/badge/status-EXPERIMENTAL-red?style=flat-square)]()
9
+ [![Audit](https://img.shields.io/badge/external%20audit-none-red?style=flat-square)]()
10
+
11
+ ---
12
+
13
+ ## āš ļø EXPERIMENTAL — NOT AUDITED āš ļø
14
+
15
+ **This library has NOT undergone external cryptographic audit.**
16
+
17
+ **DO NOT USE for:**
18
+ - Regulated data (HIPAA, PCI-DSS, SOC2-audited storage)
19
+ - Medical records
20
+ - Financial records
21
+ - Legal evidence
22
+ - Any system where a cryptographic failure would cause real-world harm
23
+
24
+ **DO USE for:**
25
+ - Research on post-quantum agent architectures
26
+ - Experimentation with PQ-hybrid primitives
27
+ - Development against future PQ-cryptographic patterns
28
+ - Learning post-quantum cryptography by example
29
+
30
+ **Read [THREAT_MODEL.md](THREAT_MODEL.md) and [SECURITY.md](SECURITY.md) before using this library for anything.**
31
+
32
+ The version is `0.1.0-beta.0` for a reason. The wire format may break between v0.1 and v0.2. Formal external audit is not currently planned — the library is being validated by public use, forks, community verification, and a coordinated-disclosure program. Your judgment as an adopter is your only safety net; make it well.
33
+
34
+ ---
35
+
36
+ ## What this is
37
+
38
+ An agent-native cryptographic composition layer built on NIST FIPS 203 (ML-KEM-768) and standard classical primitives (X25519, AES-256-GCM, HKDF-SHA-256). It doesn't invent new cryptographic primitives — it composes audited ones for the specific threat surface of long-lived, multi-agent AI systems.
39
+
40
+ The design principle: **novel architecture, standardized primitives.** The primitives (X25519, ML-KEM-768, AES-256-GCM, HKDF) are NIST-standardized or de facto industry standard. The composition (PQ-hybrid KEM, session ratcheting, agent-scoped context binding) is what's novel and what should be scrutinized.
41
+
42
+ ## What this isn't
43
+
44
+ - **Not a replacement for liboqs, PQClean, or BoringSSL.** Those libraries are the primitive layer. This library composes them for agent use cases.
45
+ - **Not audited.** Signal, Cloudflare, Google, and every serious PQ-crypto deployment has been externally audited. This library has not.
46
+ - **Not production-ready.** 0.2.0-beta.0 explicitly.
47
+
48
+ ## Installation
8
49
 
9
50
  ```bash
10
51
  npm install @weave_protocol/yoxallismus@beta
11
52
  ```
12
53
 
13
- The real package is a post-quantum cryptographic composition layer.
14
- It is **experimental** and **not audited**. Read the following before use:
54
+ The `@beta` tag is required: `latest` intentionally points at a stub until the library is audited.
15
55
 
16
- - [README](https://github.com/Tyox-all/Weave_Protocol/blob/main/yoxallismus/README.md)
17
- - [THREAT_MODEL.md](https://github.com/Tyox-all/Weave_Protocol/blob/main/yoxallismus/THREAT_MODEL.md)
18
- - [SECURITY.md](https://github.com/Tyox-all/Weave_Protocol/blob/main/yoxallismus/SECURITY.md)
56
+ To silence the runtime beta banner:
19
57
 
20
- ## Do not use for
58
+ ```bash
59
+ export YOXALL_SILENCE_BETA_WARNING=1
60
+ ```
21
61
 
22
- - Regulated data (HIPAA, PCI-DSS, SOC2)
23
- - Medical records
24
- - Financial records
25
- - Legal evidence
26
- - Any system where cryptographic failure would cause real-world harm
62
+ ## šŸ”’ Wire format `yoxall/2` is locked
63
+
64
+ As of **0.2.0-beta.0**, everything 0.2 writes stays readable by every release through **1.0**. The format is specified byte by byte in [WIRE_FORMAT.md](WIRE_FORMAT.md), and known-answer test vectors in CI fail the build if any byte changes. Later releases may only *add* optional fields; anything else becomes `yoxall/3`. Data written by v0.1 stays readable too.
65
+
66
+ ## Quick start (programmatic)
67
+
68
+ **One-shot encryption to a public key (sealed box):**
69
+
70
+ ```typescript
71
+ import { generateHybridKeypair, publicKeyOf, seal, open, serializeSealed, deserializeSealed } from '@weave_protocol/yoxallismus';
72
+
73
+ const alice = generateHybridKeypair();
74
+
75
+ // Anyone with Alice's public key can seal a message to her
76
+ const msg = seal(publicKeyOf(alice), new TextEncoder().encode('secret'), {
77
+ aad: new TextEncoder().encode('inbox:alice'), // context binding, checked on open
78
+ mode: 'cascade', // optional: AES-256-GCM inside ChaCha20-Poly1305
79
+ });
80
+ const wire = serializeSealed(msg); // yoxall/2 JSON envelope
81
+
82
+ // Alice opens it, supplying the context she expects
83
+ const pt = open(alice, deserializeSealed(wire), { aad: new TextEncoder().encode('inbox:alice') });
84
+ ```
85
+
86
+ **A conversation with post-compromise security (Double Ratchet):**
87
+
88
+ ```typescript
89
+ import { initiateSession, acceptSession, drEncrypt, drDecrypt } from '@weave_protocol/yoxallismus';
90
+
91
+ const bob = generateHybridKeypair();
92
+
93
+ // Alice starts a session from Bob's public key and sends first
94
+ const alice = initiateSession(publicKeyOf(bob));
95
+ const m1 = drEncrypt(alice, new TextEncoder().encode('hi bob'));
96
+
97
+ // Bob creates his session from that first message: no other setup needed
98
+ const { session: bobSession, plaintext } = acceptSession(bob, m1);
99
+
100
+ // From here, either side sends; keys ratchet forward every message
101
+ const reply = drEncrypt(bobSession, new TextEncoder().encode('hi alice'));
102
+ drDecrypt(alice, reply);
103
+ ```
104
+
105
+ Persist sessions with `serializeSession()` / `deserializeSession()`. Those envelopes contain secret keys, so store them encrypted.
106
+
107
+ `PQCipher` (the v0.1 API) still works and still reads v0.1 data; use `seal()` / `open()` for new code.
108
+
109
+ ## Quick start (CLI)
110
+
111
+ ```bash
112
+ # Generate a hybrid keypair
113
+ weave-yoxall keygen --out=./alice
114
+
115
+ # Encrypt a file to a public key
116
+ weave-yoxall encrypt --to=./alice.pub --in=./message.txt
117
+
118
+ # Decrypt with the corresponding private key
119
+ weave-yoxall decrypt --with=./alice.priv --in=./message.txt.yox
120
+
121
+ # See status, primitives, known limitations
122
+ weave-yoxall status
123
+
124
+ # Run the reproducible-claims test suite
125
+ weave-yoxall test
126
+
127
+ # Run known-attack test vectors
128
+ weave-yoxall audit-self
129
+
130
+ # Benchmarks
131
+ weave-yoxall benchmark
132
+ ```
133
+
134
+ ## What's inside (v0.2.0-beta.0)
135
+
136
+ | Component | Primitive | Size / Cost |
137
+ |---|---|---|
138
+ | Classical KEM | X25519 (Node crypto) | 32B pub / 32B priv |
139
+ | Post-quantum KEM | ML-KEM-768 via `@noble/post-quantum` (NIST FIPS 203) | 1184B pub / 2400B priv |
140
+ | Hybrid combination | **v2:** X-Wing-style HKDF over both secrets + X25519 ephemeral and recipient keys | 32B output |
141
+ | AEAD | AES-256-GCM (Node crypto) | 12B nonce, 16B tag |
142
+ | Cascade AEAD *(new)* | AES-256-GCM inside ChaCha20-Poly1305, independent keys | +44B |
143
+ | Sealed boxes *(new)* | Hybrid KEM → HKDF → AEAD or cascade | 1120B KEM ciphertext |
144
+ | Double Ratchet *(new)* | Signal Double Ratchet over X25519, seeded by the hybrid KEM | Forward secrecy + post-compromise security |
145
+ | Wire format | `yoxall/2` JSON envelopes, **locked through 1.0** | Base64url values |
146
+ | v1 detection *(new)* | Recognizes Hord `YoxallismusCipher` payloads (unrecoverable; YOXALL-2026-003) | — |
147
+
148
+ ## Performance (measured on v0.1.0-beta.0; v0.2 adds no cost to these paths)
149
+
150
+ Measured on Node.js 22, x86_64, single-threaded, warm cache:
151
+
152
+ | Operation | Time per op |
153
+ |---|---|
154
+ | AEAD encrypt (1 KB) | ~0.024 ms |
155
+ | Hybrid keypair generation | ~3.1 ms |
156
+ | Hybrid encap + decap | ~2.4 ms |
157
+ | End-to-end PQCipher (1 KB) | ~2.3 ms |
158
+
159
+ Reproduce with `weave-yoxall benchmark`.
160
+
161
+ ## Reproducible claims
162
+
163
+ Every claim in this README is backed by a runnable test. To verify:
164
+
165
+ ```bash
166
+ weave-yoxall test
167
+ ```
168
+
169
+ This runs assertions on:
170
+ - AEAD encrypt/decrypt roundtrip, bit-flip rejection, AAD binding
171
+ - PQ-hybrid keypair sizes match NIST FIPS 203
172
+ - Encapsulate/decapsulate produce matching shared secrets
173
+ - Wrong recipient cannot decrypt
174
+ - Sealed boxes in both modes, including wrong-AAD rejection
175
+ - Double Ratchet: session start from the handshake alone, and **a stolen session copy that stops decrypting after one DH round trip** (post-compromise security)
176
+ - Serialization roundtrip preserves bytes
177
+
178
+ The full suite (`npm test`, 26 tests) also covers the `yoxall/2` known-answer vectors, out-of-order delivery across ratchet steps, replay and forgery rejection that leaves the session untouched, the skipped-message limit, and v1 payload detection.
179
+
180
+ To verify known-attack vectors are rejected:
181
+
182
+ ```bash
183
+ weave-yoxall audit-self
184
+ ```
185
+
186
+ ## Known limitations
187
+
188
+ - **No formal external audit** performed
189
+ - **Ratchet steps are classical.** Sessions *start* post-quantum (hybrid KEM), but ongoing Double Ratchet DH steps use X25519, as in Signal's original design. A PQ ratchet is planned after v0.3.
190
+ - **No sender authentication**: sealed boxes and sessions are sender-anonymous. Authenticate peers at a higher layer.
191
+ - **Yoxallismus v1 (Hord) payloads can't be decrypted** by any implementation; v0.2 detects them and explains why (YOXALL-2026-003).
192
+ - **No threshold encryption** (multi-agent m-of-n) yet, planned v0.3
193
+ - **No zero-knowledge proofs or verifiable delay functions** yet, planned v0.3+
194
+ - **No FHE integration** yet, planned v0.4+
195
+ - **No quantum-RNG integration**, planned v0.3+
196
+
197
+ See `weave-yoxall status` for the machine-readable version of this list.
198
+
199
+ ## Threat model
200
+
201
+ Full threat model in [THREAT_MODEL.md](THREAT_MODEL.md).
202
+
203
+ **What v0.1 defends against:**
204
+ - Passive network observation (via AEAD)
205
+ - Ciphertext tampering (via AEAD auth tag)
206
+ - Wrong-recipient decryption (via hybrid KEM correctness)
207
+ - Chosen-ciphertext attacks on the KEM (via ML-KEM's IND-CCA2 security + X25519 ephemeral keys)
208
+ - Post-quantum harvest-now-decrypt-later on ciphertexts (via hybrid KEM PQ half)
209
+ - Forward secrecy of past messages within a session (via ratcheting)
210
+ - Post-compromise recovery: a stolen session stops working after one DH round trip (Double Ratchet)
211
+ - Out-of-order and lost messages within a session
212
+
213
+ **What v0.2 does NOT defend against:**
214
+ - Quantum attacks on the ongoing ratchet: only the session start is post-quantum
215
+ - Sender impersonation: messages are sender-anonymous
216
+ - Multi-agent state isolation (need threshold encryption; planned v0.3)
217
+ - Side-channel attacks (timing, cache, power)
218
+ - Compromised RNG
219
+ - Malicious dependency updates
220
+ - Runtime memory attacks (buffer inspection, coredump)
221
+ - Endpoint compromise
222
+ - Nation-state adversaries with unlimited quantum resources
223
+
224
+ ## Security reports
225
+
226
+ See [SECURITY.md](SECURITY.md).
227
+
228
+ ## Roadmap
229
+
230
+ The full research scope is intentionally proprietary until Q1 2027 IP position is set. The public roadmap:
231
+
232
+ - **v0.1.0-beta** (this release) — PQ-hybrid KEM + AEAD + symmetric ratchet + CLI + test suites + aggressive labels
233
+ - **v0.2.0-beta** — DH double-ratchet, cascade cipher (classical āŠ• PQ), v1 backward-compat shim, wire format stabilization
234
+ - **v0.3.0-beta** — Threshold encryption (multi-agent m-of-n), verifiable delay functions, ZK state-transition proofs (experimental), QRNG integration hook
235
+ - **v0.4.0-beta** — Homomorphic bounded arithmetic (FHE integration)
236
+ - **v1.0** — Once the community has hammered on it enough that we're confident the primitives compose correctly. No time table.
237
+
238
+ ## License
239
+
240
+ Apache 2.0 — see [LICENSE](../LICENSE). No warranty. No fitness for purpose. Use at your own risk.
241
+
242
+ ## Contact
243
+
244
+ - **Bug reports** → [GitHub Issues](https://github.com/Tyox-all/Weave_Protocol/issues)
245
+ - **Security reports** → see [SECURITY.md](SECURITY.md)
246
+ - **Everything else** → <TYox-all@tutamail.com>
package/SECURITY.md ADDED
@@ -0,0 +1,110 @@
1
+ # Security Policy — @weave_protocol/yoxallismus
2
+
3
+ ## Reporting a vulnerability
4
+
5
+ **Do not open a public GitHub issue for security reports.**
6
+
7
+ Send security reports to: **<TYox-all@tutamail.com>**
8
+
9
+ Include:
10
+ 1. Version affected (start of subject line: `[YOXALL SECURITY vX.Y.Z]`)
11
+ 2. Vulnerability class (cryptographic, implementation, side-channel, supply-chain, other)
12
+ 3. Reproducer — ideally a runnable test case
13
+ 4. Impact assessment — what an attacker can achieve
14
+ 5. Suggested fix (optional)
15
+
16
+ Expect an acknowledgement within 72 hours. Response times vary — this is a solo-maintained beta.
17
+
18
+ ---
19
+
20
+ ## Responsible disclosure program
21
+
22
+ **Status:** Active as of v0.1.0-beta.0
23
+
24
+ This library is deliberately unaudited. Community verification is the only safety net. We commit to fast triage, coordinated disclosure, and public recognition of researchers who report responsibly.
25
+
26
+ ### What reporters receive
27
+
28
+ - **Acknowledgement in the advisory** — every fixed vulnerability publishes an entry in [SECURITY_ADVISORIES.md](SECURITY_ADVISORIES.md) crediting the reporter (with permission, or anonymously by request)
29
+ - **CVE assignment** where warranted, via GitHub Security Advisories
30
+ - **Coordinated disclosure timeline** — reporter and maintainer agree on publication timing
31
+ - **A direct communication channel** with the maintainer, not a support queue
32
+ - **First-report priority** — if two people report the same issue, the earlier report gets credited
33
+
34
+ There is no monetary bounty program at this time. If that changes, this document will be updated with the terms.
35
+
36
+ ### Scope
37
+
38
+ **In scope:**
39
+ - Any file in the `@weave_protocol/yoxallismus` npm package
40
+ - Wire-format ambiguity or parsing vulnerabilities
41
+ - Composition flaws in the PQ-hybrid KEM
42
+ - Ratchet state confusion, chain-key reuse, message-key derivation errors
43
+ - KDF misuse, HKDF domain-separation errors
44
+ - AEAD misuse, nonce-reuse patterns
45
+ - Documentation claims that don't match code behavior
46
+
47
+ **Out of scope:**
48
+ - Vulnerabilities in `@noble/post-quantum` (report to that project directly)
49
+ - Vulnerabilities in Node.js crypto module (report to Node)
50
+ - Attacks requiring endpoint compromise, physical access, or side channels
51
+ - Attacks on the theoretical strength of ML-KEM-768 or X25519 that assume advances not currently known (report as research, not as vulnerability)
52
+ - Regulatory-compliance findings (this library is explicitly not compliance-ready)
53
+ - Any behavior explicitly noted in THREAT_MODEL.md as out of scope
54
+
55
+ ### Severity classification
56
+
57
+ Every accepted report is classified for the public advisory:
58
+
59
+ | Severity | Definition |
60
+ |---|---|
61
+ | **Critical** | Confidentiality break — attacker recovers plaintext or key material without holding the private key |
62
+ | **High** | Integrity break — attacker forges valid ciphertexts, or bypasses AEAD authentication |
63
+ | **Medium** | Denial-of-service, algorithm confusion, wire-format ambiguity that could enable attacks |
64
+ | **Low** | Documentation errors that could mislead users into insecure usage |
65
+
66
+ ### Rules of engagement
67
+
68
+ 1. **No public disclosure** before a fix is released (or 90 days from acknowledgment, whichever is sooner)
69
+ 2. **No attacks on users' data** — only against your own test infrastructure
70
+ 3. **No social engineering** or attacks on the maintainer's accounts
71
+ 4. **One vulnerability per report** — chained vulnerabilities credited as the highest-severity link
72
+
73
+ ---
74
+
75
+ ## Disclosure process
76
+
77
+ 1. Report received → acknowledgment within 72 hours
78
+ 2. Triage → severity assignment within 7 days
79
+ 3. Fix development → target 30 days for high/critical; 90 days for medium/low
80
+ 4. Coordinated disclosure — reporter and maintainer agree on public advisory timing
81
+ 5. Fix released with corresponding entry in SECURITY_ADVISORIES.md
82
+ 6. CVE assignment via GitHub Security Advisories, where warranted
83
+
84
+ ---
85
+
86
+ ## What we won't do
87
+
88
+ - **We won't sue researchers who follow this policy in good faith.** Reports made in good faith under this policy are considered authorized testing under DMCA § 1201(j) and CFAA safe harbors.
89
+ - **We won't retaliate** against reporters, even for reports we ultimately reject.
90
+ - **We won't gag researchers** after 90 days from acknowledgment. Coordinated disclosure is a request, not a permanent obligation.
91
+
92
+ ---
93
+
94
+ ## Cryptographic questions that are NOT security reports
95
+
96
+ If you have questions about:
97
+ - Algorithm choices (Why ML-KEM-768 not 1024?)
98
+ - Wire format decisions (Why JSON not CBOR?)
99
+ - Missing features (When is threshold coming?)
100
+ - Design tradeoffs
101
+
102
+ ...open a regular GitHub discussion or issue. These aren't security-sensitive and belong in public conversation.
103
+
104
+ ---
105
+
106
+ ## Beta software reminder
107
+
108
+ This is beta. It is NOT audited. Reports about *its beta status* are not vulnerabilities — that's stated policy.
109
+
110
+ Reports about **cryptographic correctness**, **composition safety**, **wire format flaws**, and **implementation bugs** are exactly what the disclosure program is for.
@@ -0,0 +1,86 @@
1
+ # Security Advisories — @weave_protocol/yoxallismus
2
+
3
+ _This document is the public record of all security advisories issued for this library._
4
+
5
+ _Three advisories have been issued, all found during v0.2 development and fixed or documented in 0.2.0-beta.0._
6
+
7
+ ---
8
+
9
+ ## Format
10
+
11
+ Each entry follows this structure:
12
+
13
+ ```
14
+ ### YOXALL-YYYY-NNN — <title>
15
+
16
+ - **Severity:** Critical / High / Medium / Low
17
+ - **Affects:** @weave_protocol/yoxallismus X.Y.Z–X.Y.Z
18
+ - **Fixed in:** @weave_protocol/yoxallismus X.Y.Z
19
+ - **Reporter:** Name (with permission) or "anonymous"
20
+ - **CVE:** CVE-YYYY-NNNNN (if assigned)
21
+
22
+ **Description:** ...
23
+
24
+ **Impact:** ...
25
+
26
+ **Root cause:** ...
27
+
28
+ **Fix:** ...
29
+
30
+ **Mitigation for users on older versions:** ...
31
+ ```
32
+
33
+ ---
34
+
35
+ ## Advisories
36
+
37
+ ### YOXALL-2026-001: v0.1 symmetric ratchet has no interoperable session start
38
+
39
+ - **Severity:** Low (availability / misuse; no confidentiality break)
40
+ - **Affects:** @weave_protocol/yoxallismus 0.1.0-beta.0
41
+ - **Fixed in:** 0.2.0-beta.0 (replaced by the Double Ratchet)
42
+ - **Reporter:** found internally during v0.2 development
43
+
44
+ **Description:** `initRatchet(sharedSecret)` salts the chain key with a random `sessionId` generated locally, and nothing transmits it. Two parties calling it with the same shared secret derive different chain keys and cannot exchange messages. The v0.1 self-test only passed by copying the sender's `sessionId` and `chainKey` into the receiver.
45
+
46
+ **Impact:** The v0.1 ratchet couldn't be used between two real parties without an ad-hoc, unspecified state transfer. A transfer like that, done carelessly, could expose chain keys.
47
+
48
+ **Fix:** v0.2 adds `initiateSession()` / `acceptSession()` (Double Ratchet), where the session is derived from the hybrid KEM handshake carried in the first messages. `initRatchet` remains only for compatibility and is deprecated.
49
+
50
+ **Mitigation for users on older versions:** Use `initiateSession` / `acceptSession`.
51
+
52
+ ### YOXALL-2026-002: v0.1 KEM combiner doesn't bind the X25519 public keys
53
+
54
+ - **Severity:** Low (defense in depth; no known practical attack)
55
+ - **Affects:** @weave_protocol/yoxallismus 0.1.0-beta.0
56
+ - **Fixed in:** 0.2.0-beta.0 (combiner v2)
57
+ - **Reporter:** found internally during v0.2 development
58
+
59
+ **Description:** The v0.1 combiner hashed the two shared secrets with the recipient public keys as salt, but not the X25519 **ephemeral** public key. Modern hybrid combiners such as X-Wing hash it, because a raw X25519 shared secret alone isn't IND-CCA.
60
+
61
+ **Impact:** The ML-KEM-768 half is IND-CCA on its own, so the combined secret stays secure while ML-KEM holds. The weakness only matters in the scenario hybrids are meant to hedge, where ML-KEM is broken and X25519 is relied on alone.
62
+
63
+ **Fix:** Combiner v2 hashes `ss_mlkem ‖ ss_x25519 ‖ eph_pub ‖ recipient_pub` under a new label (see WIRE_FORMAT.md). It's the default for all new data; the v0.1 combiner is used only to read v0.1 data.
64
+
65
+ **Mitigation for users on older versions:** Re-encrypt long-lived v0.1 data with `seal()`.
66
+
67
+ ### YOXALL-2026-003: Yoxallismus v1 (Hord `YoxallismusCipher`) output cannot be decrypted
68
+
69
+ - **Severity:** High for data written with it (unrecoverable); not a confidentiality leak
70
+ - **Affects:** `YoxallismusCipher` in @weave_protocol/hord (all versions to date)
71
+ - **Fixed in:** not fixable for existing payloads. @weave_protocol/hord 0.1.8 deprecates `YoxallismusCipher` (`unlock()` now throws instead of returning wrong bytes), and @weave_protocol/yoxallismus 0.2.0-beta.0 detects v1 payloads
72
+ - **Reporter:** found internally while building the planned v1 decoder
73
+
74
+ **Description:** `lock()` derives its XOR mask from `HMAC(deadboltKey, seed)`, where `seed = SHA-256(tumblerKey ‖ SHA-256(plaintext))`. The header stores only the first 1-12 seed bytes, and stores them after they've been advanced during encryption. `unlock()` rebuilds the mask from the header bytes instead, so Hord's own `unlock()` never round-trips (we verified this for every configuration tested). No decoder holding the key can recover the remaining seed bytes, which depend on the unknown plaintext, short of brute force.
75
+
76
+ **Impact:** Anything stored only as a v1 payload is lost. Hord's vault does **not** use this cipher internally, so the exposure is limited to callers who used `YoxallismusCipher` directly. v1 was also never an AEAD: it's deterministic, unauthenticated, and built from permutation plus XOR.
77
+
78
+ **Fix:** The planned read-only v1 decoder is impossible. Instead, `inspectV1()` / `readV1()` recognize v1 payloads and raise `V1PayloadUnrecoverableError`, and `weave-yoxall decrypt` explains the situation.
79
+
80
+ **Mitigation:** Stop using `YoxallismusCipher` for anything that must be recovered. Re-encrypt from the original data with `seal()`.
81
+
82
+ ---
83
+
84
+ ## Reporting a new vulnerability
85
+
86
+ See [SECURITY.md](SECURITY.md) for the responsible-disclosure process.
package/SKILL.md ADDED
@@ -0,0 +1,52 @@
1
+ ## šŸ” Skill: `pq-crypto`
2
+
3
+ You have access to `@weave_protocol/yoxallismus` — an EXPERIMENTAL post-quantum cryptographic composition layer. NOT AUDITED. Use with care.
4
+
5
+ ### When to invoke
6
+
7
+ Use PQ crypto when the user:
8
+ - Asks about post-quantum encryption or NIST FIPS 203 (ML-KEM)
9
+ - Wants to encrypt data with hybrid classical + post-quantum security
10
+ - Is building a system that needs harvest-now-decrypt-later resistance
11
+ - Needs a Signal-style ratchet for forward secrecy
12
+ - Asks about "quantum-safe" or "PQ-hybrid" cryptography
13
+
14
+ ### Key exports
15
+
16
+ ```typescript
17
+ import { PQCipher } from '@weave_protocol/yoxallismus';
18
+
19
+ // Simple encrypt-to-recipient facade
20
+ const alice = PQCipher.generateKeypair();
21
+ const bundle = PQCipher.encryptTo(PQCipher.publicKeyOf(alice), plaintext);
22
+ const decrypted = PQCipher.decryptFrom(alice, bundle.ciphertext, bundle.payload);
23
+ ```
24
+
25
+ Lower-level primitives also exported:
26
+ - `generateHybridKeypair`, `encapsulate`, `decapsulate` — hybrid KEM
27
+ - `aeadEncrypt`, `aeadDecrypt` — AES-256-GCM AEAD
28
+ - `hkdf`, `deriveAeadKey`, `deriveNonce` — HKDF-SHA-256 KDF
29
+ - `initRatchet`, `ratchetEncrypt`, `ratchetDecrypt` — symmetric ratchet
30
+ - `serialize*` / `deserialize*` — wire format helpers
31
+
32
+ ### CLI commands
33
+
34
+ - `weave-yoxall status` — library status + known limitations
35
+ - `weave-yoxall keygen --out=<name>` — generate keypair
36
+ - `weave-yoxall encrypt --to=<pub> --in=<file>` — encrypt file
37
+ - `weave-yoxall decrypt --with=<priv> --in=<file>` — decrypt file
38
+ - `weave-yoxall test` — reproducible-claims test suite
39
+ - `weave-yoxall audit-self` — known-attack test vectors
40
+ - `weave-yoxall benchmark` — micro-benchmarks
41
+
42
+ ### Critical caveats
43
+
44
+ - **NOT AUDITED.** Do not use for regulated, medical, financial, or legal data.
45
+ - Wire format `yoxall/2` is locked through 1.0 (see `WIRE_FORMAT.md`); use `seal()`/`open()` and `initiateSession()`/`acceptSession()` for new code.
46
+ - Double Ratchet sessions heal after compromise, but only the session start is post-quantum; ongoing ratchet steps are classical X25519.
47
+ - Messages are sender-anonymous: authenticate peers at a higher layer.
48
+ - Yoxallismus v1 (Hord `YoxallismusCipher`) payloads cannot be decrypted (YOXALL-2026-003).
49
+ - No threshold encryption yet (planned v0.3).
50
+ - Silence the runtime beta banner with `YOXALL_SILENCE_BETA_WARNING=1`.
51
+
52
+ Always point users to `THREAT_MODEL.md` and `SECURITY.md` before recommending adoption.