Foxcolab

Glossary

Key exchange

Definition

Key exchange: The process by which two parties come to share an encryption key, or each other's public keys, over a network others can observe. Key transport sends a chosen key locked to the recipient's public key; key agreement derives a key from both parties' contributions.

Also known askey establishmentkey agreementkey transportkey distribution

In short

Key exchange is the step that lets two parties share an encryption key, or each other's public keys, over a network anyone might be watching. Either one side picks a key and sends it locked to the other's public key (key transport), or both contribute to a key neither could set alone (key agreement). It only protects you if each side also checks who the other one really is.

Key takeaways

  • Key exchange gets a shared key to both parties without sending it in readable form.
  • In key transport, one side chooses the key and sends it locked to the other's public key.
  • In key agreement, both sides contribute, so neither can decide the key alone.
  • An exchange without identity checks lets a man in the middle set up a key with each side.
  • Safety codes, fingerprints and signatures are how apps confirm the right key arrived.

Last reviewed 30 November 2026

Key exchange is how two parties come to share an encryption key over a network that anyone might be watching, so they can encrypt to each other without ever sending the key in readable form. NIST's glossary, citing CNSSI 4009, calls it the "process of exchanging public keys (and other information) in order to establish secure communications" (NIST). It's the first step of every end-to-end encrypted conversation and every encrypted share.

Two ways to share a key#

NIST groups the methods under key establishment, done "either by transporting a key from one entity to another (key transport)" or by "generating a key from information shared by the entities (key agreement)" (NIST).

  • Key transport: one side picks a random key and sends it locked with the other side's public key. Only the matching private key opens it.
  • Key agreement: both sides send values that let each compute the same key, "so that no party can predetermine the value" (NIST). Someone watching sees the values but can't compute the key.

Both lean on public-key cryptography.

A worked example#

Ana (ana@example.com) shares an encrypted file with Ben (ben@example.com). Her device fetches Ben's public key, locks the file's key with it and uploads the locked copy. The server stores something it can't open. Ben's device unlocks the file's key with his private key. That's key transport.

What short definitions miss#

An exchange doesn't prove who you exchanged with. RFC 4949 walks through two parties setting up a key without checking each other: an attacker in the middle can "establish separate session keys with each of them" and quietly read and relay everything. That's a man-in-the-middle attack. If a server hands out public keys, a dishonest server could hand out its own. Safety codes, key fingerprints and signatures close the gap.

In Foxcolab#

Foxcolab does the key exchange on your device and gives you ways to check it. When you share a Foxcolab Drive file with a person, your device locks the file's key to their public key and signs the grant, and their device checks your signature before it unlocks anything. In Docs, Share locks the document's key for each person you add, and removing someone re-locks it with a new key. In Foxcolab Messenger, personal chats are end-to-end encrypted: open a contact, select Verify Encryption and compare the Security code with theirs, or Scan QR code. Mail from one Foxcolab user to another is end-to-end encrypted with the recipient's key, looked up as you write.

See how sharing works in Docs, or create a free account.

Keep exploring

All terms

Foxcolab

Private work tools, without the ads.

Mail, files, documents, spreadsheets and meetings in one account. Files, documents and spreadsheets are end-to-end encrypted.

Jump to