Hikarisend

How peer-to-peer file transfer works

Most file-sharing services upload your file to a server and let the other person download it from there. Peer-to-peer transfer skips the stored copy: the file travels from one device to the other while both are online. Here is what happens behind the 6-digit key, in plain terms.

Upload-and-download vs. device-to-device

With a cloud link, your file is copied to the provider's servers and stays there until it expires or is deleted. That's useful when the other person isn't online yet, but it means a copy of your file exists somewhere else, and the upload and the download each take time.

With a direct transfer, both devices are online at the same time and the data goes straight from sender to receiver. Nothing is waiting on a server afterwards — when the transfer ends, the files exist only on the two devices.

Step 1: finding each other

Two devices on the internet can't simply call each other; they don't know each other's addresses, and home routers hide devices behind a shared address. So a small server acts as an introducer. When you press Send, the server creates a random 6-digit key. When the other device enters that key, the server knows the two belong together and passes a few short setup messages between them: what kind of connection each supports and which network addresses might reach it.

This is called signaling. The server only relays these setup messages — never the files.

Step 2: getting through routers

Each device then asks a STUN server, “what does my address look like from the outside?”, and the two devices try the possible routes to each other. On the same Wi-Fi, they usually connect over the local network. Across the internet, most home routers allow the connection once both sides have tried at the same time.

Some networks — many offices, schools and mobile carriers — block that. In that case the devices use a TURN relay: a server that forwards the data between them. The data is still encrypted end to end, so the relay passes along packets it can't read, and doesn't keep them.

Step 3: the encrypted channel

Hikarisend uses WebRTC, the same technology browsers use for video calls. The two devices open a data channel encrypted with DTLS, with keys created on the two devices for that one session. The file is cut into small pieces, sent in order and put back together on the receiving device, which saves it when the last piece arrives.

What the server does see

The introducer can't help two devices connect without some information. It handles the key, the device names shown on screen (such as “iPhone · Safari”) and the network addresses in the setup messages, and it limits how often keys can be tried, to stop people guessing them. These are deleted when the transfer ends or the key expires; the hosting provider also keeps short-lived request logs. The privacy policy lists every item.

Trade-offs

What protects your files, and what our server can and can't see: How Hikarisend protects your files

More guides: All guides