# Device Pairing

> Learn how Cawide pairs your iPhone with your computer using QR codes, manual links, TLS 1.3 mutual authentication, and how to manage paired devices.

Source: https://cawide.dev/docs/pairing

Cawide pairs your iPhone with your computer using cryptographic key exchange over QUIC. A free Cawide account (Apple, Google, or email) is required to pair and use your own computer.

## How pairing works

When you pair a device, Cawide performs the following steps:

1. **Host secret generation**: The CLI generates a high-entropy, single-use pairing secret that remains valid for 5 minutes.
2. **Key exchange**: When your iPhone scans the QR code or opens the manual pairing link, the phone and computer exchange public keys.
3. **Mutual authentication**: Cawide establishes mutual TLS 1.3 authentication using Ed25519 keys. The phone stores the host public key, and the host authorizes the phone key.
4. **Immediate enforcement**: Relays only forward encrypted bytes. Unknown or unauthorized devices are disconnected immediately after the TLS handshake, before any data stream can be opened.

## Pairing your iPhone

To generate a pairing QR code in your terminal, run:

```bash
cawide pair
```

A QR code will display in your terminal window:

- Open the Cawide app on your iPhone and sign in with your free Cawide account.
- Tap **Pair New Host** and scan the QR code.
- Your computer will confirm the connection and register the device.

### Manual pairing link fallback

If your terminal emulator cannot display QR codes or if you are configuring a headless remote machine, the CLI outputs a pairing link directly below the QR code:

```text
Manual pairing link:
cawide://pair?host=...&secret=...
```

You can copy this link and paste it into the Cawide app on your iPhone to complete the handshake.

## Listing paired devices

To see all phones currently authorized to access your computer:

```bash
cawide devices
```

The output shows the device name, public key fingerprint, first paired date, and last seen timestamp:

```text
ID  NAME          KEY FINGERPRINT      LAST SEEN
1   Alex's iPhone  ed25519:8f3c...91a2  2 minutes ago
2   iPad Test      ed25519:12ab...77c3  5 days ago
```

## Revoking access

If you lose a phone or want to remove an authorized device, use `cawide revoke`:

```bash
cawide revoke <selector>
```

You can pass the device ID or the key fingerprint as the selector:

```bash
cawide revoke 1
cawide revoke ed25519:8f3c...91a2
```

Once revoked, the host closes any active connections from that device and rejects all future handshake attempts.

## Try without a computer

No computer at hand? Tap **Try Demo Machine** on the welcome screen or the machines screen. Cawide opens a temporary, isolated Linux sandbox with a live terminal and files. It ends on its own after a short session. No pairing and no account are needed.

