Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

About the security model

Tetheron carries your notifications, messages and files between two devices, and it can place calls and send texts in your name. Each device has its own key, the devices exchange keys once while you watch, and afterwards each accepts only the other’s key. No account, certificate authority or server is involved.

Identities and pinned keys

Each device generates a long-lived ECDSA P-256 key pair and a self-signed certificate for it. On the phone the key is created in AndroidKeyStore, in secure hardware where the phone has it, and cannot be exported. On the desktop the key is a file in the daemon’s data directory that only your user can read.

A device’s device id is the SHA-256 hash of its public key, written as 64 hexadecimal characters. Nothing else in the certificate counts. Tetheron ignores the certificate’s dates, names and chain, so there is no expiry to handle and no dependence on the clock.

Every connection is TLS 1.3 with a certificate on both ends. When a connection opens, each side computes the id of the key the peer presented and looks it up in its list of trusted devices. If the id is in the list, the session is paired and every feature is available. If it is not, the session is unpaired: it may say hello, keep itself alive and run the pairing exchange, and every other message is ignored.

Storing the peer’s key and accepting only that key is called pinning. A new key is a new device.

P-256 was chosen over Ed25519 because AndroidKeyStore has provided hardware-backed P-256 on every device since Android 6, while its Ed25519 support is recent and uneven across manufacturers. ADR-0003 has the full comparison.

Pairing

Pairing is the one moment where a person decides. The threat at that moment is an attacker on the same network who answers before the real device does, or who sits between the two devices and relays their traffic. Both ways to pair are built to defeat that attacker. Pair and unpair devices has the steps, and the exact computation is in the wire protocol reference.

The six-digit code

Each side sends the other 32 random bytes. Both sides then hash the two device ids and the two random values together and reduce the result to six digits, a short authentication string (SAS). Each device shows the digits, and you confirm on both that they match.

An attacker in the middle has a different key from the real peer, so the two devices hash different ids and show different digits. The chance of a match is one in a million for each attempt. Only one pairing runs at a time, it times out after 60 seconds, and a failed attempt shows you two codes that differ.

Most tools offer a key fingerprint of 64 characters to compare. That is stronger on paper, but people skip it. Six digits are short enough to compare. The cost is that the protection depends on you looking: if the codes differ and you confirm anyway, you have paired with the attacker.

The QR code

The desktop shows a QR code that contains its device id, its addresses and a random secret that is valid for five minutes and for one use. The phone scans the code, connects, and proves that it knows the secret by sending a keyed hash (HMAC) of its own device id. The desktop checks the proof and both sides pair without a prompt.

The secret travels from screen to camera and never over the network, so a network attacker cannot produce the proof. The phone learned the desktop’s device id from the QR code and closes the connection if the device that answers has a different id.

The QR code does not protect against someone who can see your screen during those five minutes. Treat the code like a password while it is displayed.

What an attacker on your network can and cannot do

Assume someone else is on your Wi-Fi, or controls the router. They can:

  • See that Tetheron is in use. Discovery announces each device’s name and device id on the local network. You can switch the announcements off, and paired devices still reconnect through the addresses they remember.
  • See when the devices talk and how much, though not what.
  • Connect to either device as a stranger. Pairing has to start somewhere, so the TLS handshake and the first messages are reachable by anyone on the network. A stranger can ask to pair, and you will see a pairing request you did not start. Reject it.
  • Block or disturb the connection.

Without your key or a mistake during pairing, they cannot:

  • Read or change what the devices send each other.
  • Pretend to be your phone or your desktop after pairing. A different key is a different device and gets an unpaired session, which carries no feature.
  • Make the devices fall back to something weaker. There is no plaintext mode and no TLS version below 1.3.

Discovery messages are not trusted. An announcement is a hint about where to dial, and who answers is decided by the key in the TLS handshake.

What is stored where

WhatPhoneDesktop
Own private keyAndroidKeyStore, not exportableA file in the daemon’s data directory, readable only by your user
Trusted peersA file in the app’s private storage: id, name and certificate of each paired desktopA file in the daemon’s data directory: id, name, kind and certificate of each paired phone
Synced contentStays where Android keeps it. The app reads it when askedA SQLite database per phone (messages, contacts, photo index, call log, transfers) and cached files (icons, thumbnails, attachments, fetched photos)
Received filesThe phone’s Downloads~/Downloads/Tether unless you change it

Configuration and files lists the exact paths.

Tetheron does not encrypt the desktop cache. It is protected by the permissions of your home directory, like your browser profile or your mail, and anyone who can read your files can read your cached messages.

Losing a key means losing the identity. If you reinstall the phone app or delete the desktop’s data directory, the device has a new key and must be paired again. The phone’s key cannot be backed up or moved to a new phone, which is also what makes it hard to steal.

What leaves your devices

Nothing goes to any server. Tetheron has no account, no telemetry and no push service, and the Android app contains no Google Play Services or Firebase code. Data travels only between the paired devices, over the path you gave them: your local network, or a VPN or mesh network if you entered a manual address.

A relay for use across the internet is planned. By design it forwards the encrypted TLS bytes between two paired devices and never ends the TLS connection, so it would see which device ids talk, when and how much, and nothing of the content. It is meant to be self-hosted and off until you configure it. See About discovery and connectivity.

Unpairing

Unpairing on either device removes the trust record there and tells the peer, which removes its record too.

If the peer is unreachable at that moment, trust is one-sided for a while. The device that unpaired remembers to send the unpair message the next time it meets the peer. A device that receives a feature message on an unpaired session answers with an unpair message once, and the side that still believed in the pairing then drops it. One-sided trust opens nothing in the meantime, because a device sends and accepts feature data only for a peer whose key is in its own list.

Unpairing does not delete the phone’s cached messages and photos from the desktop. Configuration and files says where they are.

The local boundary on the desktop

The daemon runs as your user, never as root, and offers its API on the D-Bus session bus. Any program that runs as you can call that API: read synced messages, send a text, start pairing. Such a program already has the same power over your files and your other applications, and Tetheron does not try to defend against it.

The extra trust in the enhanced tier

The enhanced tier adds a second, much larger grant: the phone authorises the desktop for adb. An adb authorisation gives the desktop a shell on the phone. That is far more than Tetheron uses, and it is a property of adb. Tetheron keeps its own use narrow in these ways:

  • The enhanced tier is opt-in, and the app says what the authorisation means before you give it.
  • By default the daemon uses its own adb server and its own adb key, apart from any adb you use for development.
  • The shell helper connects to a listener on the desktop’s loopback address. Any local program could connect there, so every connection must present a one-time token. The daemon hands the token to the helper on its standard input. A command line would be readable by other processes.
  • The helper applies permission grants from a fixed list. The desktop cannot send it arbitrary commands.
  • The helper runs as Android’s shell user. It cannot read the app’s private data, and the app has no way to make itself shell.
  • Root is never required and never used.

You can withdraw the authorisation at any time on the phone, under Developer options, with Revoke USB debugging authorisations. The normal tier keeps working.

Logging

People attach logs to bug reports. The project’s rule is that message contents, keys, the random values used in pairing and the pairing digits do not appear in the log at any level you would normally run. On the desktop they may appear only at the trace level, which is off unless you ask for it.

Limits

Tetheron does not defend against:

  • A compromised phone or desktop, or an attacker who has your login. Whoever controls a paired device controls the link.
  • Someone with physical access to an unlocked device.
  • Denial of service on the local network.
  • Weaknesses in what it builds on: Android’s notification and SMS permission model, and Bluetooth’s hands-free profile, which carries call audio.
  • Someone who confirms a pairing code without comparing it.

To report a vulnerability, use the private channel described in the security policy.