Key encapsulation mechanisms (KEMs) are a class of encryption techniques designed to secure symmetric cryptographic key material for transmission using asymmetric (public-key) algorithms. In practice, public key systems are clumsy to use in transmitting long messages. Instead they are often used to exchange symmetric keys, which are relatively short. The symmetric key is then used to encrypt the longer message.
The traditional approach to sending a symmetric key with public key systems is to first generate a random symmetric key and then encrypt it using the chosen public key algorithm. The recipient then decrypts the public key message to recover the symmetric key. As the symmetric key is generally short, padding is required for full security and proofs of security for padding schemes are often less than complete. KEMs simplify the process by generating a random element in the finite group underlying the public key system and deriving the symmetric key by hashing that element, eliminating the need for padding.
Example using RSA encryption
Using the same notation employed in the RSA system article, say Alice has transmitted her public key
To avoid such potential weakness, Bob first turns M into a larger integer
Alice can recover
Given
With KEM the process is simplified as follows:
Instead of generating a random symmetric key M, Bob first generates a random m,
Alice then recovers
Given
The KEM eliminates the complexity of the padding scheme and the proofs needed to show the padding is secure. p. 4 Note that while M can be calculated from m in the KEM approach, the reverse is not possible, assuming the key derivation function is one-way. An attacker who somehow recovers M cannot get the plaintext m. With the padding approach, he can. Thus KEM is said to encapsulate the key.
Note that if the same m is used to encapsulate keys for e or more recipients, and the receivers share the same exponent e, but different p, q, and n, then one can recover m via the Chinese remainder theorem. Thus, if key encapsulations for several recipients need to be computed, independent values m should be used.
Similar techniques are available for Diffie-Hellman encryption and other public key methods.