Skip to content

docs: Ky stack post-quantum migration plan and research (spec) - #80

Open
Yoshiofthewire wants to merge 6 commits into
masterfrom
docs/pqc-stack-plan
Open

Yoshiofthewire wants to merge 6 commits into
masterfrom
docs/pqc-stack-plan

Conversation

@Yoshiofthewire

Copy link
Copy Markdown
Member

In one line: a proposed plan for moving the whole Ky stack to post-quantum cryptography, plus the research behind it. Docs only; nothing is built, and fourteen owner questions decide the rest.

What changed

  • New docs/superpowers/specs/2026-11-25-pqc-stack-plan.md: one row per crypto use across the suite (81 rows), each with the algorithm today, the PQC target, the blocker and its wave.
  • New 2026-11-25-pqc-research.md: primary-source research covering RFC 9580, RFC 9980 (the OpenPGP PQC RFC, June 2026), FIPS 203/204/205, NIST SP 800-227 and IR 8547, the IETF hybrid drafts, Signal PQXDH and SPQR, Go 1.27 and the OpenPGP libraries.
  • New 2026-11-25-pqc-stack-inventory.md: the full per-repo sweep with file and line references. Rows for private repos are left out of this public copy.
  • Findings:
    • TLS between Go services already negotiates hybrid X25519MLKEM768, including under fips140=on. It is unproven by tests, so W0 adds them.
    • Six classical key wraps on Ky code carry long-lived secrets: the KyPost device envelope, the KyIdentity AD password queue, KyNotes team envelopes and device linking, and the KyIdentity keyring transfer and handoff. W1 moves them to X-Wing HPKE.
    • Passkeys, Olm/Megolm, Web Push, DKIM, DNSSEC and public certificates cannot go PQ yet.
  • Five shared helpers are planned for ky-primitives: xwing, hybridsig (lifted from kyguard), ML-DSA in oidcverify, pinnedca, and a TLS PQ test.

Review this

  • The "Owner questions" section, especially Q3 (browser PQ code as Go WASM or a JS library), Q7 (KyMessages: wait for upstream rather than build custom crypto) and Q10 (hosted cell links).
  • 2026-11-25-pqc-stack-inventory.md, for anything private that should not be public. Private repo rows and hostnames were removed by script, and the remaining mentions say "private repo".
  • The W1 order in "Waves". Each W1 step re-keys existing keys (KyNotes members, the AD DC agent, KyPost devices), so each waits for your approval.

Checked: these claims were spot-checked in code at origin:

  • KyIdentity internal/adpass/adpass.go uses an X25519 HPKE key.
  • KyNotes web/src/teamKeys.ts uses HPKE mode_auth X25519.
  • The KyIdentity keyring handoff uses P-256 ECDH with a zero HKDF salt (web/src/keyringCrypto.ts:11,120-131).

The primary sources for RFC 9980, the go-crypto algorithm IDs, the gopenpgp PQC() profile and Go 1.27.4 crypto/hpke.MLKEM768X25519 were also re-read. A grep of the public files finds none of the private repo names, hostnames or SHAs.

Not checked:

  • Most of the 480 inventory rows. Read-only workers produced them, and they were not re-opened one by one.
  • Native TLS group support on Android, Apple and Linux. It is marked unverified.
  • Nothing was run.

Decided for you: the plan lives in ky-primitives rather than KyIdentity-server. The shared code lands here, the suite crypto policy (docs/STRONG-CRYPTO.md) is already here, and it is not one app's plan. The private-repo rows go to the private launch repo instead.

You need to: answer Q1-Q14. The KyPost spec is Busnes-app/KyPost-Server#743.

Detail
  • Workers: lichen (research), samphire (inventory) and marram (table condensation), all read-only on origin default branches, 2026-11-25. Snapshot SHAs are at the top of the inventory.
  • Surprises the plan records:
    • KyDrive step K (per-org keys) is still an unpushed local branch, and is symmetric, so it needs no PQ work.
    • go-oidc v3.21.0 drops ML-DSA from discovered algorithms, so relying parties need explicit SupportedSigningAlgs.
    • KyIdentity's single RSA signing key has never been rotated, and rotation is the prerequisite for dual-publishing.
    • The kyguard broker listener still allows an X25519 fallback.
    • PostgreSQL 18's default groups are classical.
    • Recovery capsule manifests are unsigned.
  • docs/superpowers/ files are force-added, as in the other repos.

🤖 Generated with Claude Code

A suite-wide inventory of key exchange, public-key encryption and
signatures (one row per use, condensed from a per-repo sweep), the
primary-source research behind it, waves W0-W3, five shared helpers
for ky-primitives and fourteen owner questions. Rows for private
repos are kept out of this public copy. Docs only.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Yoshiofthewire

Yoshiofthewire commented Nov 26, 2026 •

Copy link
Copy Markdown
Member Author

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

⏱️ Estimated effort to review: 5 🔵🔵🔵🔵🔵

🧪 No relevant tests

⚡ No major issues detected


⚠️ Review coverage: The following files were not included in this review because of the token budget:

  • docs/superpowers/specs/2026-11-25-pqc-research.md
  • docs/superpowers/specs/2026-11-25-pqc-wireguard-mesh-research.md

Advisory only: this comment never gates the pull request.
gpt-6.1-sol using pr-agent on behalf of Yoshi

@Yoshiofthewire

Yoshiofthewire commented Nov 26, 2026 •

Copy link
Copy Markdown
Member Author

Security review - cleared

Detail withheld: this repository is public, and posting an unfixed finding here would be public disclosure. The full report was posted to the hand-off board at https://myslop.urlxl.us/f/pr-reviewer-busnes-app-ky-primitives-80, where it is readable by the operator and expires seven days after the last post.

Review input was truncated; omitted changes were not reviewed.


gpt-6.1-sol using security-audit on behalf of Yoshi

@Yoshiofthewire

Yoshiofthewire commented Nov 26, 2026 •

Copy link
Copy Markdown
Member Author

Autonomous review - 1/1 personas cleared

  • security: cleared

Merging remains a human decision; this bot never approves.


gpt-6.1-sol using security-audit on behalf of Yoshi

Yoshiofthewire and others added 5 commits November 25, 2026 21:23
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ing)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant