Security model

What protects your traffic, what each part of Peerlify can see and do, and where the trust boundaries are.

Updated · ·By Ivan Vyshniak

Nothing on this page changes with your selection.

This page describes how Peerlify protects traffic between your devices and what you are trusting when you use it. It describes the current implementation, including its limits.

In short

  • Traffic between two devices is encrypted and authenticated end to end with keys only those two devices hold. Relays and the control plane can't read or modify it.
  • Each device's private keys are created on the device and never sent anywhere.
  • The control plane is the root of trust: it tells each device which other devices belong to the network and what their public keys are. Someone who controlled it could add devices to your network.
  • The receiving device enforces the access policy on every new connection.

Device keys

When the service first starts, it creates two key pairs on the device:

KeyAlgorithmUsed for
Machine keyEd25519Proving the device's identity to the control plane.
Node keyNIST P-256Setting up encrypted sessions with other devices, and authenticating to relays.

Only the public keys leave the device. Keys aren't rotated automatically; they change only if the identity file in the device's state folder is deleted or can't be read, which creates a new device. See Device security for how they're stored.

Signing a device in

  1. Registration. The device sends its public keys. The control plane sends a random challenge, and the device signs it with its machine key.
  2. Sign-in. Through a browser link that a member approves, or with an auth key, the device signs a fresh challenge, and the control plane issues a session token.
  3. Session. The device presents the session token on every call to the control plane. It's valid for 180 days by default (see Devices) and is stored on the device.

Connections to the control plane use TLS and are validated against the operating system's trusted certificate authorities. If control-plane.peerlify.com can't be reached, the client falls back to a fixed IP address whose certificate fingerprint is built into the client. Release builds can't be configured to skip certificate validation.

Encryption between devices

Each pair of devices sets up its own encrypted session:

  • Handshake. The two devices exchange fresh ephemeral P-256 public keys. Each combines its own static node key and ephemeral key with the other device's static and ephemeral public keys (four Diffie–Hellman operations) and derives session keys with HKDF-SHA256. Only a device holding the expected node private key can derive the same keys. The design follows the Noise IK pattern but is Peerlify's own construction, not an implementation of the Noise Protocol Framework.
  • Transport. Packets are encrypted with AES-256-GCM, with a separate key for each direction. Each packet carries a counter; repeated or very old counters are rejected (an 8192-packet window).
  • New sessions are set up when either device restarts or a peer's key changes. There is no scheduled re-keying.

Each device learns the other's static public key from the control plane, not from the handshake.

When a packet arrives, the receiving device also checks that its source address belongs to the device whose session decrypted it, so one device can't send traffic pretending to be another.

What relays see and can do

Relays forward encrypted packets when devices can't connect directly. A relay:

  • sees the public IP addresses of the devices connected to it, their node public keys, which device each packet is from and to, and the size and timing of the packets it forwards;
  • can't read or alter your traffic, or forge packets from a device;
  • can drop, delay or replay packets, and could disrupt a session (though replayed data packets are rejected).

The TLS wrapping on relay connections is there so firewalls treat the traffic like web traffic. Clients don't verify the relay's certificate, and security doesn't depend on it.

What the control plane sees and can do

The control plane stores, for each device: its public keys, name, operating system and client version, its public IP address and the local addresses it offers for direct connections, its relay, and when it was last online. On Business and Enterprise plans, devices also report connection summaries for the activity logs: source and destination overlay addresses and ports, protocol, byte and packet counts, and whether the path was direct or relayed. Shadowing events are reported too. These are kept for 90 days.

It never receives private keys, session keys, or the contents of your traffic.

Because devices trust the control plane's list of members and keys, the control plane is the trust anchor. Its peer lists are delivered over TLS. Full snapshots are also signed with the control plane's key, which each device remembers for as long as its service runs.

Access control

The access policy is enforced by the device that receives a connection: the first packet of each new connection must match a rule. See How rules are evaluated for the exact behavior, including which reply packets are let through without a rule.

Every device in a network receives the name, address, public key and tags of every other approved device, whatever the access policy says. The policy controls who can connect, not who can see which devices exist.

A new network allows all traffic between its devices, and lets any device in the network shadow any other device, with control, after the person at that device accepts. Narrow both when you set the network up.

Exit points

Internet traffic sent through an exit point is encrypted between your device and the exit point. From the exit point onward it travels like any other internet traffic, and the exit device can see it, as any router could.

Shadowing

Shadowing requires the network's Allow shadowing setting and a matching rule. Rules can require the consent of the person at the device. Macs additionally require the person to turn shadowing on and grant macOS permissions. The viewer is identified by the device it runs on.

Not covered on this page

Compliance certifications, data residency and Peerlify's internal infrastructure are outside the scope of these docs. Contact Peerlify for that information.

Next steps

Was this page helpful?