From 29508a0cf033358f804a43507155c635d3753e86 Mon Sep 17 00:00:00 2001 From: Erik Karulf Date: Thu, 3 Dec 2026 22:25:56 -0600 Subject: [PATCH 1/3] Streamline the README around installation and the first SSH connection --- README.md | 452 ++++++++++++++++++------------------------------------ 1 file changed, 148 insertions(+), 304 deletions(-) diff --git a/README.md b/README.md index f7280d5..fc8bdc2 100644 --- a/README.md +++ b/README.md @@ -6,397 +6,241 @@

-**A small, post-quantum point-to-point VPN for connecting devices without a coordination server.** - -QuantumCat (`qcat`) combines WireGuard, Tailscale's networking stack, and DERP relay support with post-quantum device authentication and session key establishment. - -- No Tailscale account or control plane -- Direct peer-to-peer paths when available, DERP relay when needed -- ML-DSA-87 device authentication -- Fresh ML-KEM-1024 exchange for each connection's WireGuard PSK -- Secure Enclave-backed identities on supported Macs -- SSH, Mosh, SOCKS5, and TCP/UDP forwarding -- macOS, Linux, and FreeBSD builds +QuantumCat (`qcat`) connects two devices over WireGuard so you can SSH, run Mosh, +or forward individual services without a Tailscale account, a coordination +server, or an inbound public port. Peers authenticate with ML-DSA-87 and use a +fresh ML-KEM-1024 exchange to derive each session's WireGuard preshared key. +They meet through a DERP relay and switch to direct UDP when possible. The relay +can carry encrypted traffic but cannot impersonate a paired device or decrypt the tunnel. > [!WARNING] -> QuantumCat is an early implementation of [DESIGN.md](DESIGN.md), not a security-audited release. The bootstrap protocol should receive independent cryptographic review before it protects sensitive production traffic. - -## What does it look like? - -Pair two devices once, then use normal tools through the encrypted tunnel. +> QuantumCat is experimental. Its bootstrap protocol needs independent cryptographic +> review before use with sensitive production traffic. -### SSH +## Install -On your laptop: +Homebrew provides `qcat` for Apple Silicon with macOS 26+ and for x86-64 or ARM64 Linux. ```sh -qcat identity init --name laptop > laptop.qpeer +brew install ekarulf/tap/qcat ``` -On the server: +FreeBSD amd64 users can install a release archive. Archives are also available +for macOS and Linux. Install the same version on both devices. -```sh -qcat identity init --name outpost -qcat peer add laptop laptop.qpeer -qcat serve --tcp 22=127.0.0.1:22 --export outpost.qpeer -``` +
+Install from a release archive -Back on the laptop: +Download your archive and the matching `SHA256SUMS` from [GitHub Releases](https://github.com/ekarulf/quantumcat/releases). -```sh -qcat peer add outpost outpost.qpeer -qcat connect outpost 22 -``` +| Platform | Archive | +| --- | --- | +| Apple Silicon, macOS 26+ | `qcat-darwin-arm64.tar.gz` | +| Linux x86-64 | `qcat-linux-amd64.tar.gz` | +| Linux ARM64 | `qcat-linux-arm64.tar.gz` | +| FreeBSD amd64 | `qcat-freebsd-amd64.tar.gz` | -Or make it transparent to OpenSSH: +In the download directory, use `shasum` to verify the macOS archive. -```sshconfig -Host outpost - HostName outpost - User alice - ProxyCommand /Users/alice/.local/bin/qcat connect outpost 22 +```sh +archive=qcat-darwin-arm64.tar.gz +awk -v file="$archive" '$2 == file' SHA256SUMS | shasum -a 256 -c ``` -Then: +On Linux or FreeBSD, set `archive` to the filename for your platform and check it with `sha256sum`. ```sh -ssh outpost +archive=qcat-linux-amd64.tar.gz +awk -v file="$archive" '$2 == file' SHA256SUMS | sha256sum -c ``` -No DNS record named `outpost` is required. SSH still performs its normal host-key and user authentication inside the QuantumCat tunnel. - -### Mosh - -Publish SSH plus the normal Mosh UDP range on the server: +After the check prints `OK`, extract the archive and install the binary. Make +sure `$HOME/.local/bin` is on your `PATH`. ```sh -qcat serve \ - --tcp 22=127.0.0.1:22 \ - --udp 60000:61000=127.0.0.1:60000 \ - --export outpost.qpeer +tar -xzf "$archive" +cd "${archive%.tar.gz}" +mkdir -p "$HOME/.local/bin" +install -m 755 qcat "$HOME/.local/bin/qcat" ``` -Then connect from the client: +On macOS, install the Secure Enclave helper from the same directory. ```sh -qcat mosh outpost +mkdir -p "$HOME/.local/libexec/qcat" +install -m 755 qcat-se "$HOME/.local/libexec/qcat/qcat-se" ``` -`qcat mosh` bootstraps through SSH, creates the UDP forwarding path, and launches `mosh-client`. - -### SOCKS5 proxy +Release checksums detect corruption. The macOS binaries are ad-hoc signed and +lack Developer ID signing and notarization. -Allow a destination on the server: +
-```sh -qcat serve --allow-target example.com:443 --export outpost.qpeer -``` +
+macOS helper discovery and permissions -Run a local SOCKS5 proxy on the client: +Homebrew installs `qcat-se` in the formula's private `libexec`. Restart running +qcat services after an upgrade, before `brew cleanup` removes the old version. -```sh -qcat socks --listen 127.0.0.1:1080 outpost -curl --socks5-hostname 127.0.0.1:1080 https://example.com/ -``` +For custom installs, qcat resolves its own executable at startup. If it lives +in `bin` or `sbin`, qcat searches the same prefix for `libexec/qcat/qcat-se`, +then `libexec/qcat-se`, then `sbin/qcat-se`. It also checks +beside the executable. It does not search `PATH` for the helper. An unprivileged process can select an absolute path with +`QCAT_ENCLAVE_HELPER` (legacy alias `QCAT_SE_HELPER`). Discovery skips missing +candidates and stops on an unsafe or broken one. -DNS resolution happens on the remote side. +The helper must be a regular executable owned by root or the current user. +Only its owner may have write permission. It also checks directory and symlink ownership and +permissions along the resolved path. For unprivileged installs it permits group-writable +directories shared by qcat and its helper, so the installation group is trusted +to replace both. These checks use POSIX mode bits. Root requires a root-owned +installation and ignores helper overrides. Set-ID processes cannot launch the helper. -### UDP forwarding +
-Publish a UDP service on the server: +## Pairing and first SSH connection -```sh -qcat serve --udp 60001=127.0.0.1:60001 --export outpost.qpeer -``` +This example connects a laptop to a server called `outpost` with SSH listening +on `127.0.0.1:22`. The name is a local alias. Each device keeps its own +`identity.json`. Exchange only the public `.qpeer` files over an authenticated +channel. Before importing a file, compare its full `PeerID` with the sender's +`qcat identity show` output out of band. Importing a peer on the server +authorizes it to use the services you publish. -Forward a client-side loopback port to it: +**On the laptop**, create an identity and send `laptop.qpeer` to the server. ```sh -qcat forward --udp outpost 60001:60001 +qcat identity init --name laptop > laptop.qpeer ``` -No public UDP listener is created on the server. - -## How it works - -QuantumCat deliberately separates **identity**, **reachability**, and **transport**. - -1. Each device has a long-lived ML-DSA identity. -2. Devices exchange public `.qpeer` descriptors through an authenticated out-of-band channel. -3. A fresh ML-KEM exchange authenticates the peer and derives a new WireGuard PSK. -4. Tailscale's `magicsock` machinery discovers direct paths and falls back to DERP when necessary. -5. Application traffic runs inside WireGuard. - -The DERP relay is not trusted for authentication or session confidentiality. - -Persistent identity compromise does not by itself reveal old session PSKs. - -For the full protocol and threat-model details, see: - -- [DESIGN.md](DESIGN.md) — architecture and rationale -- [PROTOCOL.md](PROTOCOL.md) — wire protocol and bootstrap details -- [third_party/tailcat/QUANTUMCAT.md](third_party/tailcat/QUANTUMCAT.md) — networking changes used by QuantumCat - -## Install - -Download the archive and `SHA256SUMS` from [GitHub Releases](https://github.com/ekarulf/quantumcat/releases). - -Current build targets: - -| Platform | Archive | -| --- | --- | -| Apple Silicon macOS 26+ | `qcat-darwin-arm64.tar.gz` | -| Linux x86-64 | `qcat-linux-amd64.tar.gz` | -| Linux ARM64 | `qcat-linux-arm64.tar.gz` | -| FreeBSD amd64 | `qcat-freebsd-amd64.tar.gz` | - -Verify the archive before extracting it. `SHA256SUMS` lists every archive, so -select the line for the one you downloaded: +**On the server**, create its identity, import the laptop, and publish SSH. ```sh -# macOS -grep qcat-darwin-arm64.tar.gz SHA256SUMS | shasum -a 256 -c - -# Linux / FreeBSD -grep qcat-linux-amd64.tar.gz SHA256SUMS | sha256sum -c +qcat identity init --name outpost +qcat peer add laptop laptop.qpeer +qcat serve --tcp 22=127.0.0.1:22 --export outpost.qpeer ``` -Both print `OK` and exit 0. A mismatch, or a filename that matches no line, -exits non-zero. +Leave `qcat serve` running and send `outpost.qpeer` back to the laptop. The +file exported by `serve` includes the endpoint the laptop needs to connect. -Then install `qcat` somewhere on your `PATH`, for example: +**Back on the laptop**, import the server and connect. Replace `alice` with +your SSH username on the server. ```sh -mkdir -p "$HOME/.local/bin" -install -m 755 qcat "$HOME/.local/bin/qcat" +qcat peer add outpost outpost.qpeer +ssh -o 'ProxyCommand=qcat connect outpost %p' alice@outpost ``` -On macOS, install `qcat-se` outside your `PATH`: +SSH still checks the server's host key and authenticates your login. To use +`ssh outpost` and `qcat mosh outpost`, save the alias in `~/.ssh/config`. -```sh -mkdir -p "$HOME/.local/libexec/qcat" -install -m 755 qcat-se "$HOME/.local/libexec/qcat/qcat-se" +```sshconfig +Host outpost + User alice + ProxyCommand qcat connect outpost %p ``` -macOS binaries are currently ad-hoc signed rather than Developer ID signed/notarized. Checksums protect against accidental corruption; they are not publisher signatures. +## Mosh, forwarding, and SOCKS5 -### Homebrew and other package layouts +For each service you want, add its flags to the server's `qcat serve` command. Keep +`--tcp 22=127.0.0.1:22` for SSH. Use `--export` only when writing a new +descriptor file. -For a Homebrew formula, install the two binaries separately: +| Use | Additional server flags | Laptop command | +| --- | --- | --- | +| Mosh | `--udp 60000:61000=127.0.0.1:60000` | `qcat mosh outpost` | +| HTTP on server port 8080 | `--allow-target 127.0.0.1:8080` | `qcat forward outpost 18080:127.0.0.1:8080` | +| DNS over UDP on server port 53 | `--udp 1053=127.0.0.1:53` | `qcat forward --udp outpost 1053:1053` | +| SOCKS5 for `example.com:443` | `--allow-target example.com:443` | `qcat socks --listen 127.0.0.1:1080 outpost` | -```ruby -bin.install "qcat" -libexec.install "qcat-se" -``` - -Homebrew keeps `libexec` private to the formula instead of linking it into the -global `bin` or `sbin`. Prefer it to `sbin`, which Homebrew links and which may -already be on the user's `PATH`. No wrapper or environment variable is needed. - -`qcat` resolves its own executable first, so a Homebrew `bin/qcat` or -`opt/quantumcat/bin/qcat` symlink finds the helper in the same versioned keg. -That location is pinned at process startup; restart running services after an -upgrade, before Homebrew removes their old keg. -When `qcat` is in a `bin` or `sbin` directory, discovery checks these paths in -order under that installation prefix: - -1. `libexec/qcat/qcat-se` -2. `libexec/qcat-se` -3. `sbin/qcat-se` -4. `qcat-se` beside `qcat` (also the only default for other executable locations) - -Adjacent release-archive and `make helper` layouts remain supported. The helper -is never searched for on `PATH`. A missing candidate allows the next layout; -an existing but unsafe or broken candidate is an error rather than a fallback. -For a custom location, an unprivileged process may set an absolute -`QCAT_ENCLAVE_HELPER` path (`QCAT_SE_HELPER` remains a legacy alias). - -Helper symlinks are allowed only after validating every traversed directory and -link and the final executable. The canonical target is then executed. The helper -must be a regular executable owned by root or the current user, never writable -by group or others. Directory and link ownership must also be trusted. - -For an ordinary unprivileged invocation, group-writable directories shared by -the resolved `qcat` and helper paths are allowed to accommodate Homebrew's -admin-group-managed prefixes. This explicitly trusts that installation's group -to replace both binaries, including helpers started by an already-running -`qcat`. Helper-only group-writable directories and non-sticky world-writable -directories are rejected. These are POSIX owner/mode checks, not an ACL audit. - -Set-ID invocations (different real/effective user or group IDs) cannot start a -helper. Ordinary root invocations, including `sudo`, ignore both environment -overrides and disable the shared-directory exception. Root will not run a helper -from a normal user-owned Homebrew keg, even if the helper file itself is root-owned. -For a root-run service, install the helper in a root-owned installation with -write access restricted to root. Identity and peer-store symlink and permission -checks are unchanged. - -Secure Enclave long-lived private keys remain non-exportable. Helper-path checks -protect which code can invoke signing operations and use the process's OS -privileges; they do not change that key-storage design. - -## Pairing - -Configuration defaults to: - -```text -~/.config/qcat -``` +Mosh uses the SSH alias above to start `mosh-server` on the server, then runs +`mosh-client` on the laptop. Install Mosh on both. -Create a device identity: +The HTTP example is reachable at `http://127.0.0.1:18080/` on the laptop, and +the DNS forward listens on `127.0.0.1:1053`. Any local process can use a +forwarding or SOCKS5 listener while it is open. To use SOCKS5 with DNS +resolution on the server, run the following in a second terminal. ```sh -qcat identity init --name laptop > laptop.qpeer +curl --socks5-hostname 127.0.0.1:1080 https://example.com/ ``` -Only exchange `.qpeer` files. **Never copy `identity.json` between machines.** +## Operating a server -Import a peer: +For a persistent SSH and Mosh server, adapt the service template for +[macOS launchd](deploy/macos/com.quantumcat.server.plist), +[Linux systemd --user](deploy/systemd/qcat.service), or +[FreeBSD rc.d](deploy/freebsd/qcat). The forwarding process runs unprivileged. -```sh -qcat peer add outpost outpost.qpeer -``` +### Peers and revocation -Inspect or revoke peers: +The default configuration directory is `~/.config/qcat`. Supported Macs +default to Secure Enclave identity and ephemeral KEM keys. Linux and FreeBSD +store software identities here, so a backup of the directory includes private +key material. ```sh qcat peer list -qcat peer show outpost -qcat peer remove outpost +qcat peer show laptop ``` -Removing a server locally stops running `connect`, `forward`, `socks`, and -`mosh` clients paired with it. They check the pinned server identity every -second, before sending bootstrap messages, and when bootstrap completes. -A missing, unreadable, or replaced descriptor cancels the session within one -polling interval plus local scheduling and filesystem latency. Connecting to a -replacement server requires a new command. To revoke a client's authorization -on a remote server, remove the client from that server's pairing store. - -Importing a peer grants authorization, so transfer peer descriptors over an authenticated channel and compare full PeerIDs out of band. - -## Running a persistent server +Run `qcat peer remove laptop` **on the server** to revoke the laptop's access and +close its tunnels. Removing `outpost` on the laptop stops local clients paired +with that server. -A typical SSH + Mosh server looks like this: +### Status and shutdown ```sh -qcat serve \ - --tcp 22=127.0.0.1:22 \ - --udp 60000:61000=127.0.0.1:60000 +qcat status # show locally managed sessions as JSON +qcat down outpost # stop managed client sessions for outpost +qcat down serve # stop the local server ``` -QuantumCat includes service templates for: - -- macOS `launchd` -- Linux `systemd --user` -- FreeBSD `rc.d` - -These run unprivileged for forwarding mode and do not expose public TCP/UDP listeners for the forwarded services. - -The repository contains ready-to-adapt examples under [`deploy/`](deploy/). +On current `main`, each entry in the session's `Peer` map reports its send path. -## Migrating from OS TUN mode +| `Path` | Meaning | +| --- | --- | +| `direct` | The selected UDP endpoint is in `CurAddr`. | +| `derp` | The next send uses DERP. Path discovery may also try UDP. | +| `peer-relay` | The selected UDP relay is in `PeerRelay`. | +| `unknown` | There is too little information to identify the path yet. | -`qcat serve --tun` and `qcat up` have been removed. For SSH, publish port 22 with `qcat serve --tcp 22=127.0.0.1:22` -and use `qcat connect PEER 22` as the SSH ProxyCommand. For other services, -use TCP/UDP forwarding or SOCKS5. These modes reuse existing pairings. +`Relay` names the peer's home DERP region even on a direct path. `LastHandshake` +records the last successful WireGuard handshake. A session with no running +backend reports `null`. An empty result (`{}`) means there are no managed sessions. -## Status and shutdown +For transport logs on stderr, add `--verbose` before positional arguments, +for example `qcat connect --verbose outpost 22`. Clients need DERP to renew +even on direct paths. If renewal fails for the full one-hour lease, the server +removes the tunnel and existing application connections may need restarting. -```sh -qcat status -qcat down outpost -qcat down serve -``` +### Upgrading older installations -`qcat status` prints JSON keyed by running session. Each entry in a session's `Peer` map -has a `Path` field for the tunnel's current send path. - -| Path | Meaning | -| --- | --- | -| `direct` | qcat has selected the UDP endpoint in `CurAddr`. | -| `derp` | qcat selects the DERP fallback for the next send, even if the peer is idle. It may also try UDP during path discovery. | -| `peer-relay` | The transport reports a selected UDP peer relay in `PeerRelay`. | -| `unknown` | The snapshot has too little information to identify a path, for example before the first send. | - -`CurAddr` is an empty string when there is no selected direct endpoint. -`Relay` identifies the peer's home DERP region even when its path is direct. -`LastHandshake` records the last successful WireGuard handshake. A session with no -running backend reports `null`. If no sessions are running, the result is `{}`. - -Client connections periodically re-authenticate with a fresh signed ML-KEM exchange and refresh paths after sleep or network changes. -Renewal requires the bootstrap DERP relay even when application traffic is direct. -If the relay stays unavailable through the one-hour server lease, the server -removes the tunnel. A healthy direct path does not extend that lease. Recovery -can bootstrap through DERP again; existing application flows may need restarting. +Both ends need compatible bootstrap versions. If your identity predates +identity-file version 3, reinitialize it and re-pair the devices. +Former `qcat up` and `serve --tun` users can reuse compatible pairings with +SSH, forwarding, or SOCKS5. ## Build from source -Requires Go 1.27.4 or newer. +Use Go 1.27.4 or newer. On a supported Mac, also run `make helper` to build the +Swift helper beside `bin/qcat`. Run `./bin/qcat debug` to check its capabilities. ```sh make build -``` - -`qcat version` reports the build. Release archives from GitHub Releases name -their tag; anything built from a checkout reports `devel` plus the commit hash, -commit time, and whether the tree was modified, which the Go toolchain records -automatically. To stamp a tag into a local build, set `VERSION`: - -```sh -make build VERSION=v0.1.0 -``` - -Use `--verbose` on `serve`, `forward`, `socks`, `connect`, or `mosh` to -write transport diagnostics, including `portmapper:` messages, to stderr. -Place it before positional arguments, for example -`qcat serve --verbose --tcp 22=127.0.0.1:22` or -`qcat connect --verbose outpost 22`. Logging stays quiet by default. - -On supported Apple Silicon Macs: - -```sh -make helper -./bin/qcat debug -``` - -macOS defaults to Secure Enclave identities and ephemeral KEM keys. Linux and FreeBSD use software-backed keys. On macOS, capability failures are errors rather than silent downgrade to software keys. - -Run the test suite with: - -```sh +./bin/qcat version make test go vet ./... ``` -## Security model, in one paragraph - -QuantumCat trusts explicitly paired device identities, not relay infrastructure. ML-DSA authenticates the devices; fresh ML-KEM material is mixed into each WireGuard session as a PSK; WireGuard protects application traffic; DERP may relay packets but cannot authenticate as a peer or decrypt the session. Peer removal revokes authorization and active sessions are torn down shortly afterward. Private identity material stays local to each machine. On Linux and FreeBSD the software identity is stored in the config directory, so backing up that directory also backs up the private identity. A `qcat forward` or `qcat socks` listener grants tunnel access to every local process and should not be left running on a multi-user host. - -For the details and caveats, read [DESIGN.md](DESIGN.md) and [PROTOCOL.md](PROTOCOL.md). - -Before publishing a release, validate the packaged Secure Enclave helper on -Apple Silicon using the [release checklist](docs/RELEASING.md). - -## Project status - -QuantumCat is experimental. The implementation includes automated tests for authentication tampering, replay, identity/source binding, PSK freshness, forwarding policy, revocation, TCP/UDP transport, fragmentation, storage permissions, and local runtime control, but that is not a substitute for independent review. - -Current `main` intentionally breaks compatibility with earlier builds: it uses -Go's standard-library ML-DSA/ML-KEM implementations, SHA-384 bootstrap -primitives, SHA-512/256 PeerIDs, identity-file version 3, and a nonce-blinded -client peer tag in place of the transmitted client PeerID. Reinitialize -identities and re-pair peers when upgrading. - -PeerIDs stay stable locally; they are simply no longer sent over the DERP -bootstrap path, so a relay operator that does not already know a client's PeerID -cannot use it to link separate client instances. An operator that *does* know a -candidate PeerID can still recompute the tag and test it, and the client's source -IP remains visible regardless. This is metadata hygiene, not anonymity — see -[DESIGN.md](DESIGN.md) §22.8 for what it does and does not provide. - -Contributions, testing on real networks, protocol review, and security analysis are welcome. +Local builds report `devel` and the commit. Use `make build VERSION=vX.Y.Z` +to stamp a release version. -## License +## Further reading -See [LICENSE](LICENSE). +- [Design and threat model](DESIGN.md) — what pairing protects and what a relay can observe. +- [Bootstrap protocol](PROTOCOL.md) — signed key exchange, key confirmation, and renewal. +- [Tailcat integration](third_party/tailcat/QUANTUMCAT.md) — changes to the underlying transport. +- [Release checklist](docs/RELEASING.md) — validation of the packaged helper on Apple Silicon. +- [Apache 2.0 license](LICENSE). From 653ff8c2f6ba1be37bc75946e51fb9fae748f3c8 Mon Sep 17 00:00:00 2001 From: Erik Karulf Date: Thu, 3 Dec 2026 22:33:57 -0600 Subject: [PATCH 2/3] Explain QuantumCat in plain language and separate protocol details --- README.md | 45 +++++++++++++++++++++++++++++++-------------- 1 file changed, 31 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index fc8bdc2..a58a729 100644 --- a/README.md +++ b/README.md @@ -6,15 +6,19 @@

-QuantumCat (`qcat`) connects two devices over WireGuard so you can SSH, run Mosh, -or forward individual services without a Tailscale account, a coordination -server, or an inbound public port. Peers authenticate with ML-DSA-87 and use a -fresh ML-KEM-1024 exchange to derive each session's WireGuard preshared key. -They meet through a DERP relay and switch to direct UDP when possible. The relay -can carry encrypted traffic but cannot impersonate a paired device or decrypt the tunnel. +**QuantumCat connects your laptop privately to another computer.** Pair it with +your home server, for example, and you can log in or use a service on that +server without opening a port on your router. + +QuantumCat looks for a fast, direct connection between the two computers. When +the network blocks a direct connection, a relay carries the encrypted traffic. + +QuantumCat uses modern post-quantum cryptography to verify both devices and +protect their connection. On supported Macs, the Secure Enclave lets the Mac +prove its identity without exposing its private identity key, even to QuantumCat. > [!WARNING] -> QuantumCat is experimental. Its bootstrap protocol needs independent cryptographic +> QuantumCat is experimental. Its connection protocol needs independent security > review before use with sensitive production traffic. ## Install @@ -175,10 +179,8 @@ For a persistent SSH and Mosh server, adapt the service template for ### Peers and revocation -The default configuration directory is `~/.config/qcat`. Supported Macs -default to Secure Enclave identity and ephemeral KEM keys. Linux and FreeBSD -store software identities here, so a backup of the directory includes private -key material. +The default configuration directory is `~/.config/qcat`. On Linux and FreeBSD, +a backup of this directory includes the device's private identity key. ```sh qcat peer list @@ -222,6 +224,24 @@ identity-file version 3, reinitialize it and re-pair the devices. Former `qcat up` and `serve --tun` users can reuse compatible pairings with SSH, forwarding, or SOCKS5. +## Technical details + +- **Network paths.** The devices first contact each other through a DERP relay. + Tailscale's `magicsock` tests UDP paths so traffic can move to a direct link. + WireGuard encrypts application traffic on either path. The relay can see + connection metadata but cannot read the traffic. Pairing requires no + Tailscale account or coordination server. +- **Post-quantum cryptography.** Each device signs the handshake with its + ML-DSA-87 identity key. A fresh ML-KEM-1024 exchange supplies the secret + used to derive a WireGuard preshared key for the session. +- **Key storage.** On Apple silicon Macs running macOS 26 or later, QuantumCat + defaults to the Secure Enclave for identity signing and for the client's + temporary ML-KEM private key. Linux and FreeBSD use software-backed keys. + +See the [wire protocol](PROTOCOL.md) for the handshake and renewal sequence, +the [design and threat model](DESIGN.md) for what a relay can observe, and the +[Tailcat integration notes](third_party/tailcat/QUANTUMCAT.md) for transport changes. + ## Build from source Use Go 1.27.4 or newer. On a supported Mac, also run `make helper` to build the @@ -239,8 +259,5 @@ to stamp a release version. ## Further reading -- [Design and threat model](DESIGN.md) — what pairing protects and what a relay can observe. -- [Bootstrap protocol](PROTOCOL.md) — signed key exchange, key confirmation, and renewal. -- [Tailcat integration](third_party/tailcat/QUANTUMCAT.md) — changes to the underlying transport. - [Release checklist](docs/RELEASING.md) — validation of the packaged helper on Apple Silicon. - [Apache 2.0 license](LICENSE). From 4755eff84071208e246d5448cb76d18567adf6d4 Mon Sep 17 00:00:00 2001 From: Erik Karulf Date: Thu, 3 Dec 2026 22:38:14 -0600 Subject: [PATCH 3/3] Use my-server consistently in README examples --- README.md | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index a58a729..4d63ba6 100644 --- a/README.md +++ b/README.md @@ -104,7 +104,7 @@ installation and ignores helper overrides. Set-ID processes cannot launch the he ## Pairing and first SSH connection -This example connects a laptop to a server called `outpost` with SSH listening +This example connects a laptop to a server called `my-server` with SSH listening on `127.0.0.1:22`. The name is a local alias. Each device keeps its own `identity.json`. Exchange only the public `.qpeer` files over an authenticated channel. Before importing a file, compare its full `PeerID` with the sender's @@ -120,29 +120,29 @@ qcat identity init --name laptop > laptop.qpeer **On the server**, create its identity, import the laptop, and publish SSH. ```sh -qcat identity init --name outpost +qcat identity init --name my-server qcat peer add laptop laptop.qpeer -qcat serve --tcp 22=127.0.0.1:22 --export outpost.qpeer +qcat serve --tcp 22=127.0.0.1:22 --export my-server.qpeer ``` -Leave `qcat serve` running and send `outpost.qpeer` back to the laptop. The +Leave `qcat serve` running and send `my-server.qpeer` back to the laptop. The file exported by `serve` includes the endpoint the laptop needs to connect. **Back on the laptop**, import the server and connect. Replace `alice` with your SSH username on the server. ```sh -qcat peer add outpost outpost.qpeer -ssh -o 'ProxyCommand=qcat connect outpost %p' alice@outpost +qcat peer add my-server my-server.qpeer +ssh -o 'ProxyCommand=qcat connect my-server %p' alice@my-server ``` SSH still checks the server's host key and authenticates your login. To use -`ssh outpost` and `qcat mosh outpost`, save the alias in `~/.ssh/config`. +`ssh my-server` and `qcat mosh my-server`, save the alias in `~/.ssh/config`. ```sshconfig -Host outpost +Host my-server User alice - ProxyCommand qcat connect outpost %p + ProxyCommand qcat connect my-server %p ``` ## Mosh, forwarding, and SOCKS5 @@ -153,10 +153,10 @@ descriptor file. | Use | Additional server flags | Laptop command | | --- | --- | --- | -| Mosh | `--udp 60000:61000=127.0.0.1:60000` | `qcat mosh outpost` | -| HTTP on server port 8080 | `--allow-target 127.0.0.1:8080` | `qcat forward outpost 18080:127.0.0.1:8080` | -| DNS over UDP on server port 53 | `--udp 1053=127.0.0.1:53` | `qcat forward --udp outpost 1053:1053` | -| SOCKS5 for `example.com:443` | `--allow-target example.com:443` | `qcat socks --listen 127.0.0.1:1080 outpost` | +| Mosh | `--udp 60000:61000=127.0.0.1:60000` | `qcat mosh my-server` | +| HTTP on server port 8080 | `--allow-target 127.0.0.1:8080` | `qcat forward my-server 18080:127.0.0.1:8080` | +| DNS over UDP on server port 53 | `--udp 1053=127.0.0.1:53` | `qcat forward --udp my-server 1053:1053` | +| SOCKS5 for `example.com:443` | `--allow-target example.com:443` | `qcat socks --listen 127.0.0.1:1080 my-server` | Mosh uses the SSH alias above to start `mosh-server` on the server, then runs `mosh-client` on the laptop. Install Mosh on both. @@ -188,14 +188,14 @@ qcat peer show laptop ``` Run `qcat peer remove laptop` **on the server** to revoke the laptop's access and -close its tunnels. Removing `outpost` on the laptop stops local clients paired +close its tunnels. Removing `my-server` on the laptop stops local clients paired with that server. ### Status and shutdown ```sh qcat status # show locally managed sessions as JSON -qcat down outpost # stop managed client sessions for outpost +qcat down my-server # stop managed client sessions for my-server qcat down serve # stop the local server ``` @@ -213,7 +213,7 @@ records the last successful WireGuard handshake. A session with no running backend reports `null`. An empty result (`{}`) means there are no managed sessions. For transport logs on stderr, add `--verbose` before positional arguments, -for example `qcat connect --verbose outpost 22`. Clients need DERP to renew +for example `qcat connect --verbose my-server 22`. Clients need DERP to renew even on direct paths. If renewal fails for the full one-hour lease, the server removes the tunnel and existing application connections may need restarting.