Host creates a pair code
It carries the host Noise static public key, fingerprint, a single-use code and transport routes. Codes expire after five minutes by default.
SECURITY MODEL
Phone and host always speak Noise NK end-to-end. The relay uses a second Noise NK handshake to authenticate hosts/clients and protect control frames; TLS is optional. Relay mode forwards application data as ciphertext and exposes only the routing metadata it needs.
opencode stays bound to 127.0.0.1. The host reads local service registration and keeps the opencode password; the phone never receives it.
| Observer | Direct | Relay |
|---|---|---|
| Phone ↔ host application data | Noise NK ciphertext | Noise NK ciphertext |
| Transport | ws://, LAN only | ws:// + Noise NK auth; optional wss:// TLS |
| Relay sees | — | room, subject identity, connect time, frame size |
| Relay cannot see | — | prompts, replies, tool I/O, file contents |
| opencode password | host only | host only |
It carries the host Noise static public key, fingerprint, a single-use code and transport routes. Codes expire after five minutes by default.
The phone displays the host fingerprint. Compare it with the computer output to avoid joining an impersonated host.
The host stores only a hash and the device scope. The phone stores the token in Android SecureStore.
X25519 ephemeral keys complete Noise NK. OCRP control frames and proxied payloads then travel inside protected records.
This model protects application data between phone and host. It does not defend a computer that is already compromised, nor does it hide routing metadata from the relay.
| Data | Location | Protection |
|---|---|---|
| Host Noise private key | ~/.config/ocremote/identity.json | mode 0600; never leaves the host |
| Device token | phone SecureStore; host stores a hash | revocable per device |
| Relay subject secret | phone SecureStore; relay stores a hash | long-lived until revoked |
| Relay phone invites | one-time phone invites | bound to a room, single-use, short lived |
| Relay Noise static key | data/relay-identity.json | mode 0600; public key fetched from /v1/info and pinned by the host |
| Optional TLS private key | Operator-provided certificate path | Only with wss; the relay does not generate a CA |
| Build | Application id | Optional TLS trust |
|---|---|---|
| Release | app.ocremote.android | Android system CA store |
| QA | app.ocremote.android.qa | system CA + development test CA |
Noise NK needs no CA and works in every build. Only when wss:// is enabled with a self-signed certificate must that CA be installed in the Android system store, or a public CA certificate used instead.