KEM

A public key method for agreeing a shared secret, where one side generates a random secret and sends it locked so that only the other side's private key can open it.

In more detail

KEM stands for key encapsulation mechanism. It has three steps: the receiver generates a key pair, the sender runs encapsulate against the public key to get a shared secret plus a ciphertext, and the receiver runs decapsulate on the ciphertext to recover the same secret. The shared secret then keys a fast symmetric cipher such as AES. ML-KEM is the standard post-quantum example.

Examples

openssl pkeyutl -encap -pubin -inkey bob.pub -secret alice.bin -out ct.bin
openssl pkeyutl -decap -inkey bob.key -in ct.bin -secret bob.bin

Related terms

Taught in

References