Skip to content

Implement passkeys to unlock the keystore (alongside or instead of PIN) #207

Description

@dmnyc

Currently the encrypted keystore is unlocked with a PIN. Passkeys (WebAuthn) should be supported as an additional — or replacement — unlock factor.

Why

  • PINs are guessable, shoulder-surfable, and reused across sites; passkeys are phishing-resistant and bound to the device.
  • A browser extension sidebar can use WebAuthn with publickey-credentials in the manifest permissions (Chromium supports this for extensions with MV3).
  • Aligns with the 2026-08-14 security audit's general posture of hardening the unlock path (cf. Security audit 2026-08-14 remediation (blocks 1.9.0 release) #199 remediation batch).

Options to decide

  1. Passkey alongside PIN — user picks either factor at unlock; PIN remains as fallback (safer rollout, but keeps the weaker factor alive).
  2. Passkey replaces PIN — WebAuthn PRF extension derives/decrypts the keystore key directly (no password in the loop at all); requires a recovery path (e.g. ncryptsec backup) for lost devices.

Implementation notes

  • Research: WebAuthn PRF (prf extension) support in Chromium extension sidepanels — can we use the PRF output to derive the AES key that currently wraps the keystore?
  • If PRF is unavailable/awkward: store a random unlock secret in the keystore wrapper, gate its release behind navigator.credentials.get() with user verification
  • Manifest: add publickey-credentials permission; verify behavior in Firefox (may need a PIN fallback path there)
  • Enrollment flow: settings pane to register a passkey (with device/user verification required)
  • Unlock flow: passkey prompt in the sidebar before decrypting the keystore
  • Recovery: document that ncryptsec backup is the recovery path if the passkey/device is lost
  • Decide option 1 vs 2 above (product decision, similar to Product decision: should the trusted tier keep silent nip04/nip44 decrypt (DM reading)? #197/Product decision: nostrarchives follow-list disclosure (opt-in setting, document, or drop) #194)

Audit doc: docs/security-audit-2026-08-14.md

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions