Skip to content

Unlock the PC with the phone: design, draft protocol, and the core's vault - #36

Draft
thtbee wants to merge 1 commit into
mainfrom
unlock-with-phone
Draft

thtbee wants to merge 1 commit into
mainfrom
unlock-with-phone

Conversation

@thtbee

@thtbee thtbee commented Oct 19, 2026 •

Copy link
Copy Markdown
Owner

What and why

The groundwork for unlocking a locked Windows session with the phone's fingerprint (docs/PLAN.md §3.10). It's a draft on purpose: nothing here reaches the apps yet, and the design needs decisions before the rest is built.

  • ADR 0009 (docs/adr/0009-unlock-with-phone.md, Proposed): a credential provider that returns the user's password, kept split so the PC can't use it alone. The PC stores the password sealed with AES-256-GCM under a key K; only the phone holds K, wrapped by a Keystore key that needs a strong biometric for every use. It covers the guards (local network only, single-use 30 s requests, 5 failures locks it for 15 minutes, unlock only, off by default), the threat model, and where each piece runs.
  • Draft protocol (docs/protocol/unlock.md): unlock.enroll, unlock.wrapped, unlock.request, unlock.release, unlock.forget.
  • The core's vault (core/nectarlink-core/src/unlock.rs): sealing and opening with the PC, the phone and the Windows user bound in as associated data, a secret type that's wiped on drop and never printed, and the request rules (expiry, single use, failure lockout). Uses ring, already a dependency.

Open questions (from the ADR)

  1. Is storing the password, split like this, acceptable, or should we first check whether Windows Hello's companion device API still works on Windows 11 24H2 and later?
  2. PIN-only and passwordless Microsoft accounts have no usable password; those users would be told it isn't available. Acceptable?
  3. Who does the external review, and does the credential provider need code signing (SignPath) first?

Still to do

The phone's Keystore key and biometric prompt, the protocol handlers on both sides, the credential provider DLL (desktop/credprov), its install and removal, a VM test plan, and an external security review before any of it ships.

How it was tested

The vault's 7 unit tests: a sealed password opens only with its key and binding, a changed one doesn't open, each seal uses a new nonce and keys must be 32 bytes, secrets are never printed, a request is answered once, in time, by its phone, repeated failures lock it out for a while, and old failures and a success don't count. scripts/check.ps1 passes.

ADR 0009 (proposed) designs unlocking the locked PC with the phone's
fingerprint: a credential provider that returns the user's password,
which the PC keeps only sealed under a key the phone holds wrapped by a
non-exportable, biometric-bound Keystore key. Neither the PC's disk nor
the phone alone can recover it. It covers the options Windows allows,
the threat model, the guards (LAN only, single-use requests, rate limit,
unlock only, off by default) and open questions for the owner.

docs/protocol/unlock.md drafts the messages. core::unlock has the parts
that can be tested on their own: sealing and opening the password
(AES-256-GCM via ring, bound to the PC, phone and Windows user), secrets
wiped on drop and never printed, and the request rules. Nothing is wired
to the network, and no credential provider exists yet: that needs a VM
and an external review.
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