Hybrid KEM - Kyber & X25519
In addition to the sole use of Kyber KEM, a hybrid mechanism using X25519 can be devised that acts as a drop-in replacement for Kyber KEM. In this case, a PQC algorithm is merged with a classic key establishment algorithm. The basis is the enhancement of the Kyber KEM encapsulation and decapsulation algorithms as follows.
When using the hybrid KEX algorithm, instead of the sole KEM encapsulation and decapsulation operations, the hybrid variants that are outlined in the subsequent subsections are used. In addition, the Kyber KEX data along with the X25519 data is exchanged in the same manner as outlined for the standalone Kyber KEX. Thus, the KEX operation is not re-iterated here.
The presented algorithm ensures that even if one algorithm is compromised, the resulting shared secret is still cryptographically strong and compliant with the strength of the uncompromised algorithm. However, it is to be noted that Kyber may have a cryptographic strength of up to 256 bits when using Kyber 1024. On the other hand, the cryptographic strength of X25519 is significantly lower - between 80 and 128 bits - depending on the analysis approach.
Hybrid KEM Key Generation
As part of the hybrid KEM key generation, the following steps are performed:
Both public keys and both secret keys are maintained together so that every time the hybrid KEM requires a public key, the Kyber and X25519 public keys are provided. The same applies to the secret keys.
Thus the following holds:
Both, pk_hybrid and sk_hybrid are the output of the hybrid KEM key generation operation.
Hybrid KEM Encapsulation
The hybrid KEM encapsulation applies the following steps using the input of the hybrid KEM public key pk_hybrid:
The data ct_hybrid is to be shared with the peer that performs the decapsulation operation.
On the other hand ss_hybrid is the raw shared secret obtained as part of the encapsulation operation and must remain secret. It is processed with a KDF as outlined in section Hybrid KEM Shared Secret Derivation below.
Hybrid KEM Decapsulation
The hybrid KEM decapsulation applies the following steps using the input of the hybrid KEM secret key sk_hybrid and the public data resulting from the hybrid KEM encapsulation operation ct_hybrid.
The operation returns the following data:
The data of ss_hybrid is the raw shared secret obtained as part of the encapsulation operation and must remain secret - it is the same data as calculated during the encapsulation step. It is processed with a KDF as outlined in the section Hybrid KEM Shared Secret Derivation below.
Hybrid KEM Shared Secret Derivation
To obtain a shared secret of arbitrary length that can be used as key material, a key derivation function is used as allowed by SP800-56C rev 2 section 2:
Considering that Kyber uses SHAKE / SHA-3 in its internal processing, the selected KDF is KMAC256 as defined in SP800-108 rev 1. KMAC is invoked as follows:
KMAC256(K = ss_hybrid,
X = ct_hybrid,
L = requested SS length,
S = "Kyber X25519 KEM SS")
When considering the structure of ss_hybrid and ct_hybrid, the KDF operates on the following specific data:
KMAC256(K = ss_kyber || ss_x25519,
X = ct_kyber || pk_x25519_e,
L = requested SS length,
S = "Kyber X25519 KEM SS")
The KMAC customization string S is selected arbitrarily and can contain any string including the NULL string.
The result of the KDF is intended to be usable as key material for other cryptographic operations. That derived key material now contains the individual security strengths of both Kyber and X25519. Both algorithms are used such that any security break of either algorithm will not impact the strength of the resulting shared secret of the respective other. By concatenating the individual shared secret values as input into the KDF, the result of the KDF will have the security strength of one algorithm even if the respective other algorithm is broken.
Hybrid KEX Algorithm
Using the hybrid KEM algorithm outlined in the preceding subsections, the hybrid KEX algorithm as specified in the documentation of the secure connection approach can be obtained by the following considerations: use of the Kyber KEX approach outlined at the beginning, but apply the following changes:
This implies that the hybrid KEM as well as the hybrid KEX algorithms are usable as a direct drop-in replacement for the standalone Kyber algorithm use case. The only difference is that the resulting data is larger as it contains the X25519 data as well.
You can download a PDF version of the process here.
An implementation of both hybrid KEM and hybrid KEX is provided here.