ade57321a70f

AUD-005: document extractable passkey key architectural tradeoff

time
2026-05-16 13:50 UTC · 5 months ago
machine
koh2
parent
7d6b4e5e48bd
1 file src/background/passkey-crypto.ts+10 −2
src/background/passkey-crypto.ts+10 −2
@@ -153,6 +153,14 @@153153   ]);154154 }155155 156+// AUD-005: Passkey private keys are generated with `extractable: true`. This is157+// an intentional architectural tradeoff — Peach stores the JWK inside the158+// encrypted vault blob to enable PeachScript backup, Codex restore, and cross-159+// device sync. A stronger design would use non-extractable platform keys, but160+// that would break portability. The private key never leaves the background161+// process: content scripts receive only signed assertions, never the key162+// material itself. If non-extractable platform keys ever become compatible163+// with Peach's backup and sync goals, prefer them for new credentials.156164 export async function generatePasskeyKeypair(157165   algorithm: -7 | -8158166 ): Promise<{@@ -163,7 +171,7 @@163171   if (algorithm === -7) {164172     const keyPair = await crypto.subtle.generateKey(165173       { name: "ECDSA", namedCurve: "P-256" },166-      true,174+      true, // AUD-005: extractable — required for vault-stored portability167175       ["sign", "verify"]168176     );169177     const privateKeyJwk = await crypto.subtle.exportKey("jwk", keyPair.privateKey);@@ -178,7 +186,7 @@178186 179187   const keyPair = await crypto.subtle.generateKey(180188     { name: "Ed25519" },181-    true,189+    true, // AUD-005: extractable — required for vault-stored portability182190     ["sign", "verify"]183191   );184192   const privateKeyJwk = await crypto.subtle.exportKey("jwk", keyPair.privateKey);

view file