Nerd stuff

LockPing

A deliberately dumb relay between two smart endpoints.

LockPing answers one question — did I lock my PC? — with a phone app, a relay and an agent. The interesting part is what each piece is not allowed to know: the relay routes envelopes it cannot read, and the agent ignores everything that is not sealed by a paired device.

Go 1.25 (agent)React 19 + TS (app)NaCl box (X25519 + XSalsa20-Poly1305)FastAPI WebSockets (relay)D-Bus / logindWin32 WTS APIGoReleaser + NSISAzure Trusted SigningCapacitor 8

§The relay is dumb on purpose

One WSS endpoint, four frame types: hello, envelope, presence, error. The payload of every envelope is an opaque "e1:" ciphertext — the relay routes on the address fields and understands nothing else. Identity is trust-on-first-use pinned to a public key, re-proven on every reconnect with a nonce challenge derived from an X25519 shared secret. Wrong answer: WebSocket close 4403, goodbye.

§Pairing without a secret on the wire

The QR contains a relay URL, an agent id and a one-time secret (5 minutes, single use). That secret never travels the network: the phone proves knowledge of it with an HMAC over its own identity, the agent answers with the same construction, and both sides keep each other's X25519 public key. From then on everything is a NaCl box with a fresh nonce per message — the same primitive in Go on the PC and tweetnacl in the browser.

§Deny by default, one exception

The agent's gateway drops everything that is not a sealed message from a paired device — silently. The single plaintext exception is a valid pair_request while a pairing window is open on the PC itself. Lock commands additionally carry a nonce and timestamp, so replaying an old "lock" does nothing.

§Zero polling

The agent never polls the OS. On Linux it subscribes to logind's PropertiesChanged on the system D-Bus; on Windows it creates a message-only window and lets WTSRegisterSessionNotification wake it on session changes. It also survives the classic trap of binding to systemd's Class=manager pseudo-session — the session picker is pure, unit-tested logic that re-resolves on every call.

§Open source where it matters

You are installing a program that can lock your PC, so the agent is public under MIT, together with the canonical protocol document — you can read exactly what it does and what it deliberately cannot do (no remote unlock, no screen access, no telemetry). One static binary per OS, no admin rights needed, and the Windows build is signed twice: the exe first, then the installer built around it.

§Lock Karma

A gauge over your last 20 checks, ranked from Swinging Door to The Bunker — only a spotless window reaches The Bunker. Background polls don't count, so the app cannot punish you for merely being open. Scores live in localStorage; there is no server leaderboard, because that would be a database of when you leave your PC unlocked.

§The flow

"e1:" box"e1:" boxQR + HMAC (offline)eventsAppPWA · tweetnaclRelayFastAPI · WSSAgentGo · statischSessielogind · WTS API

← Back to rm-worx.be

This website uses minimal technical storage (cookies and local storage) to ensure proper functioning and simple visit statistics. By continuing to browse, you agree to this. See our Cookie Policy and Privacy Policy.