End-to-end encryption

How Foldpair works: encryption and the relay

Follow a change from one device to another: what is encrypted, what the relay can see, how keys are exchanged, and where end-to-end encryption does not apply.

The practical flow

Foldpair keeps the working copy of a synced folder on the participating devices. The relay helps those devices exchange protected payloads when they are not on the same network; it is not the permanent home of the folder.

  1. You choose the devices and folder that should participate.
  2. Folder and clipboard content is encrypted on the sending device before relay transport.
  3. The authenticated temporary relay routes or briefly holds ciphertext while the other device is unavailable.
  4. The receiving device verifies, decrypts, and applies the content locally with keys held by participating devices.

For the complete flow, read how Foldpair works. For the exact content and metadata boundaries, continue to the security model. The Learn library contains practical setup and comparison guides.

The one-sentence version

Your files and clipboard are encrypted on your device with keys held only by the participating devices. For synced folders, clipboard and Send, our relay stores contents it has no way to open — even if the relay itself were seized or compromised. (Share-links work differently; see below.)

What “end-to-end” means here, concretely

Encryption and decryption happen on the endpoints — your devices. The server in the middle (we call it the relay) receives file contents that are already encrypted and forwards or briefly stores them. It is never given a folder or account key, so it cannot read your files, and neither can anyone who later gets hold of the relay or its disks. It does see metadata such as file names and sizes; see below.

What is — and isn’t — end-to-end encrypted

We’d rather you trust us because we’re precise than because we wave the word “encrypted” around. So, plainly:

PathEnd-to-end?How
Synced foldersYesFile contents encrypted on-device before upload (AES-256-GCM, framed streaming) when folder encryption is enabled, which the desktop app does by default for folders you own once every device in the folder supports it; a folder where it was never enabled, or whose devices do not all support it, syncs as plaintext. The relay holds ciphertext only until all participating devices acknowledge delivery or the plan retention window expires (24 hours Free, 7 days Pro, 30 days Team).
Clipboard syncYesEach clipboard item sealed on-device under your account key.
Send to a device or contactYesThe file is encrypted on your device before it leaves, sealed to the recipient’s keys (the receiving device’s key for your own devices, the contact’s account key for a contact). The relay holds the encrypted file until the other side collects it, and deletes it once it is picked up or after 7 days. If the app cannot encrypt, the send fails; it never falls back to plaintext. In the desktop app, the first send to a contact trusts the key it sees (the mobile apps ask you to verify it first); if that key later changes, sending stops until you check the security code.
Browser share-linksYes*The file is encrypted on your device before upload. The key travels only in the part of the link after #, which browsers never send to the relay, and the recipient’s browser decrypts the file. Anyone who has the full link can open it, so share it carefully. The encrypted file stays on the relay until the link expires or you revoke it.

* Links created by older versions of the app, before share-links were encrypted, are not end-to-end; the download page says so when you open one. Every new link is end-to-end. The page that decrypts a share-link is served by our own servers, so a share-link is only as safe as that page; for a file that must stay protected even if our servers were compromised, use Send or a synced folder.

Efficiency note: binary delta transfer applies only to folders without end-to-end encryption. The desktop app turns end-to-end encryption on automatically for folders the device owns, and for those folders each changed file is re-encrypted and uploaded in full.

The building blocks

Everything below is built on standard, vetted platform cryptography (.NET’s AesGcm, ECDiffieHellman, and HKDF). There is no home-grown cipher, no custom curve, no hand-rolled key schedule. The raw key-agreement secret is never used as a key directly — it always passes through HKDF first.

PurposePrimitive
Bulk content encryptionAES-256-GCM (256-bit keys, 96-bit nonces, 128-bit auth tags)
Large filesFramed streaming AEAD (STREAM construction, in the spirit of age / libsodium secretstream)
Device identityStatic ECDH key pair on NIST P-256
Key distributionStatic-ephemeral ECDH → HKDF-SHA256 → AES-256-GCM key-wrap (a “sealed envelope”)
Key storageOS secure store — Windows DPAPI, macOS Keychain, Linux Secret Service — plus a user-only file that the local sync agent reads

How a file is encrypted

Framing lets Foldpair encrypt large files with bounded memory and verify each frame before applying its contents. So Foldpair encrypts a file as a sequence of independent 1 MiB frames, each with its own fresh random nonce and authentication tag:

[magic "TBE1"][version][alg][frame size]
per frame:  [nonce 12B][isLast][len][ciphertext][tag 16B]

Clipboard items are small, so they use the same cipher in a single-shot form (markers TBC1/TBC2), each sealed under your account key and bound to its account and event id.

How the keys reach your devices — without the server seeing them

Encryption is only as good as key handling. The hard part is getting the symmetric content key from a device that has it to your other device, through a server you don’t want to trust. Foldpair does this with sealed envelopes:

  1. Every device generates a P-256 key pair on first run. The private half is written to the OS secure store and never leaves the device — not to the server, not to logs, not to an environment variable. Only the public half is registered with the relay.
  2. To share a folder key with another of your devices, the sending device does an ephemeral ECDH against that device’s public key, runs the result through HKDF-SHA256 to derive a one-time wrapping key, and AES-256-GCM-wraps the content key under it.
  3. The relay stores this sealed envelope and hands it to the recipient device. Only the device holding the matching private key can re-derive the wrapping key and open it. The relay sees an opaque blob.
shared = ECDH(ephemeral_private, recipient_public)
wrapKey = HKDF-SHA256(shared, salt = folderId, info = "foldpair-folder-key-e2e-v1")
envelope = AES-256-GCM(wrapKey).seal(folderKey,
              bound to: folderId, key version, ephemeral pubkey, recipient device id)

Each wrap uses a fresh ephemeral key pair, folder and account channels use different HKDF labels so their envelopes can never be confused, and the recipient device id is bound in — so if the server ever misrouted an envelope to the wrong device, it would fail to open rather than leak.

Fail-closed by design

Encryption never silently downgrades

Once a folder is end-to-end encrypted, a device will encrypt the upload or hold it — it will never fall back to sending plaintext. If for any reason a device couldn’t encrypt (say it didn’t yet hold the folder key), the file waits rather than leaking to the relay in the clear. The only way you get a plaintext blob is a folder that was never encrypted to begin with.

What the relay can — and can’t — see

End-to-end encryption protects contents. It does not hide all metadata from the relay:

For end-to-end encrypted transfers, the relay never sees

  • × Your file contents
  • × Your clipboard contents
  • × Your encryption keys
  • × The key inside a share-link (browsers never send the part after #)

The relay does see (metadata)

  • · The exact size of each file and a fingerprint (hash) of its contents
  • · File and folder names and paths; which account/folder/device, and when
  • · Delivery status and device presence
  • · Each device’s public key

If hiding the existence and timing of a transfer from the infrastructure is part of your threat model, no relay-based tool — ours included — fully solves that. The content protection described here does not hide that metadata.

Honest limitations

Links made by older app versions are not end-to-end (explained above). Metadata is visible to the relay. And like any client software, end-to-end encryption protects you in transit and at rest on our infrastructure — it does not protect a device that is itself compromised. We’ll keep this page updated as the design evolves, and we welcome scrutiny.

Want to verify, not trust?

Good instinct. The format markers (TBE1 for synced files, TBC1/TBC2 for clipboard, TBM1 for sent files, TBSL1 (key: #tbsl1) for share-link files), the AES-256-GCM / P-256 / HKDF-SHA256 choices, and the sealed-envelope construction above are the whole story — there is no secret second channel. If you’re evaluating Foldpair for sensitive use and want the deeper design notes or to discuss a security review, get in touch.