A key encapsulation mechanism, or KEM, lets two peers end up with the same secret without ever putting that secret on the wire. One peer uses the other’s public key to produce both the secret and a ciphertext. The other peer uses its private key to recover the same secret from that ciphertext.
That’s the job of ML-KEM in post-quantum cryptography. It handles the moment before encrypted traffic can flow, when the peers need shared key material but don’t have any yet. It doesn’t encrypt the application data, and it doesn’t tell you who you’re talking to.
The ciphertext travels. The shared secret doesn’t.
Imagine a client connecting to a service. The service generates a key pair and makes its public key available to the client. The client runs encapsulation with that public key and fresh randomness. It keeps the resulting shared secret and sends the ciphertext back. The service runs decapsulation with the ciphertext and its private key. If the exchange works as intended, it gets the secret the client already holds.
A KEM ciphertext isn’t an encrypted request body. The client doesn’t hand the KEM a message to hide or even a session key it has picked out. The encapsulation operation produces the secret and the ciphertext together. The protocol then uses that secret to derive the keys that protect its traffic.
A KEM gives both sides the same starting secret. The rest of the protocol determines who shares it and how it protects traffic.
Anyone with the public key can encapsulate a fresh secret against it. That doesn’t let them recover the secret from someone else’s exchange. It does mean the KEM alone can’t protect a client that accepts a substituted public key: the client could establish a perfectly good secret with the wrong peer. That’s why an authenticated protocol needs to tie the exchange to the intended identity.
The post-quantum standards do different jobs
The names look similar, but they’re not interchangeable. The distinction is easier to remember if you ask what each operation gives back:
- ML-KEM gives peers shared key material. It addresses the risk that a future quantum computer could break a vulnerable key exchange and help someone decrypt traffic they record today.
- ML-DSA and SLH-DSA produce digital signatures. A verifier uses the signer’s public key to check that a message was signed by the holder of the corresponding private key. Verification doesn’t give the peers a shared secret.
Where you meet a KEM in practice
If you build backend services, you’re more likely to meet ML-KEM in a TLS library or proxy’s handshake configuration than in application code. In a hybrid key exchange, the handshake combines an ML-KEM secret with a secret from a conventional key exchange before deriving traffic keys. When you’re checking what a connection actually uses, look at the negotiated key exchange, not just the certificate’s signature algorithm. Those settings answer different questions.




