How the encryption works
Traversal and Traversal Host connect your own devices directly. Everything they send each other (the picture, sound, pointer, keys and clipboard) is encrypted with keys that only those two devices have. There is no account and no server of ours in between.
Finding your Mac
On your local network, Traversal finds Macs running Traversal Host with Bonjour, using the service type _lightpath._tcp. The Bonjour record carries the Mac's name, a short fingerprint of its public key, the protocol version and a short token made by hashing the Mac's hardware ID (never the ID itself). None of these are secret keys. You can also connect by address, for example over Tailscale.
Keys
- Each iPhone or iPad makes its own Curve25519 key pair once and keeps it in the iOS Keychain.
- Each Mac makes its own Curve25519 key pair once and keeps it in Traversal Host's settings folder, readable only by your Mac user account.
- All cryptography uses Apple's CryptoKit framework, which is part of iOS and macOS. Traversal does not include its own implementation of any algorithm.
Pairing and connecting
Every connection starts with a handshake over TCP:
- The device sends a fresh one-time Curve25519 key, a random value, its long-term public key and its name.
- The Mac answers with the same from its side, and says whether it needs a PIN.
- Both sides combine four Curve25519 key agreements (one-time with one-time, one-time with long-term, long-term with one-time, and long-term with long-term). The first time a device pairs, the 6-digit PIN shown on the Mac is mixed in too.
- From that, HKDF with SHA-256 makes four separate 256-bit keys, one for each direction of the control channel and of the media stream. A SHA-256 hash of the whole handshake is used as the salt, so any change to the handshake gives different keys.
- Each side then proves it has the same keys by sending an encrypted confirmation. A wrong PIN fails here.
After pairing, the Mac remembers the device's public key and the device remembers the Mac's. Later connections skip the PIN. If a Mac ever presents a different key, the device refuses to connect and asks you to forget the Mac and pair again, so another computer can't pretend to be yours.
A new device can only pair from the same local network as the Mac or from a Tailscale address. From anywhere else, only devices that are already paired can connect.
Only one PIN guess is checked per connection attempt. After too many wrong guesses the Mac refuses attempts for a while and makes a new PIN.
The stream
- Control messages (input, clipboard, settings) travel over TCP. Video and sound travel over UDP.
- Every message is encrypted and authenticated with AES-GCM using a 256-bit key and a counter as the nonce. A message that has been changed, or replayed on the control channel, is rejected.
- Default ports are 47800 (TCP) and 47801 (UDP).
What this does not cover
- Anyone who can unlock your iPhone, iPad or Mac can use Traversal on it.
- Traversal shows whatever is on your Mac's screen. Lock your Mac or disconnect when you don't want it shown.
- Tailscale, which you use to reach your Mac from away, has its own security, run by Tailscale Inc.
Found a security problem? Please email hushuhashaeboss@gmail.com with "Security" in the subject.