RFC 9629: Using Key Encapsulation Mechanism (KEM) Algorithms in the Cryptographic Message Syntax (CMS)
- R. Housley,
- J. Gray,
- T. Okubo
Abstract
The Cryptographic Message Syntax (CMS) supports key transport and key agreement algorithms. In recent years, cryptographers have been specifying Key Encapsulation Mechanism (KEM) algorithms, including quantum-secure KEM algorithms. This document defines conventions for the use of KEM algorithms by the originator and recipients to encrypt and decrypt CMS content. This document updates RFC 5652.¶
Status of This Memo
This is an Internet Standards Track document.¶
This document is a product of the Internet Engineering Task Force (IETF). It represents the consensus of the IETF community. It has received public review and has been approved for publication by the Internet Engineering Steering Group (IESG). Further information on Internet Standards is available in Section 2 of RFC 7841.¶
Information about the current status of this document, any
errata, and how to provide feedback on it may be obtained at
https://
Copyright Notice
Copyright (c) 2024 IETF Trust and the persons identified as the document authors. All rights reserved.¶
This document is subject to BCP 78 and the IETF Trust's Legal
Provisions Relating to IETF Documents
(https://
1. Introduction
This document updates "Cryptographic Message Syntax (CMS)" [RFC5652].¶
The CMS enveloped-data content type
[RFC5652] and the CMS authenticated
A KEM algorithm is a one-pass
The KEMRecipient
In this environment, security depends on three things. First, the KEM algorithm must be secure against adaptive chosen ciphertext attacks. Second, the key-encryption algorithm must provide confidentiality and integrity protection. Third, the choices of the KDF and the key-encryption algorithm need to provide the same level of security as the KEM algorithm.¶
A KEM algorithm provides three functions:¶
- KeyGen() -> (pk, sk):
- Generate the public key (pk) and a private key (sk).¶
- Encapsulate(pk) -> (ct, ss):
- Given the recipient's public key (pk), produce a ciphertext (ct) to be passed to the recipient and shared secret (ss) for the originator.¶
- Decapsulate(sk, ct) -> ss:
- Given the private key (sk) and the ciphertext (ct), produce the shared secret (ss) for the recipient.¶
To support a particular KEM algorithm, the CMS originator MUST implement the KEM Encapsulate() function.¶
To support a particular KEM algorithm, the CMS recipient MUST implement the KEM KeyGen() function and the KEM Decapsulate() function. The recipient's public key is usually carried in a certificate [RFC5280].¶
1.1. Terminology
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all capitals, as shown here.¶
1.2. ASN.1
CMS values are generated using ASN.1 [X.680], which uses the Basic Encoding Rules (BER) and the Distinguished Encoding Rules (DER) [X.690].¶
1.3. CMS Version Numbers
As described in Section 1.3 of [RFC5652], the major data structures include a version number as the first item in the data structure. The version number is intended to avoid ASN.1 decode errors. Some implementations do not check the version number prior to attempting a decode, and then if a decode error occurs, the version number is checked as part of the error-handling routine. This is a reasonable approach; it places error processing outside of the fast path. This approach is also forgiving when an incorrect version number is used by the originator.¶
Whenever the structure is updated, a higher version number will be
assigned. However, to ensure maximum interoperabilit
2. KEM Processing Overview
KEM algorithms can be used with three CMS content types: the
enveloped-data content type [RFC5652], the authenticated
The originator randomly generates the CEK (or the CAEK), and then
all recipients obtain that key as an encrypted object within the KEMRecipient
A KEM algorithm and a key derivation function are used to securely
establish a pairwise symmetric KEK, which is used to encrypt
the originator
In advance, each recipient uses the KEM KeyGen() function to create a key pair. The recipient will often obtain a certificate [RFC5280] that includes the newly generated public key. Whether the public key is certified or not, the newly generated public key is made available to potential originators.¶
The originator establishes the CEK (or the CAEK) using these steps:¶
The recipient obtains the CEK (or the CAEK) using these steps:¶
3. KEM Recipient Information
This document defines KEMRecipient
The object identifier associated with KEMRecipient
The KEMRecipient
The fields of the KEMRecipient
version is the syntax version number. The version MUST be 0. The CMSVersion type is described in Section 10.2.5 of [RFC5652].¶
rid specifies the recipient's certificate or key that was used by
the originator with the KEM Encapsulate() function. The
Recipient
kem identifies the KEM algorithm, and any associated parameters, used
by the originator. The KEMAlgorithm
kemct is the ciphertext produced by the KEM Encapsulate() function for this recipient.¶
kdf identifies the key derivation function, and any associated parameters,
used by the originator to generate the KEK. The
Key
kekLength is the size of the KEK in octets. This value is one of the inputs to the key derivation function. The upper bound on the integer value is provided to make it clear to implementers that support for very large integer values is not needed. Implementations MUST confirm that the value provided is consistent with the key-encryption algorithm identified in the wrap field below.¶
ukm is optional user keying material. When the ukm value is provided,
it is used as part of the info structure described in Section 5 to
provide a context input to the key derivation function. For example, the
ukm value could include a nonce, application
wrap identifies a key-encryption algorithm used to encrypt the
CEK. The Key
encryptedKey is the result of encrypting the CEK or the
CAEK (the content
4. KEM Algorithm Identifier
The KEMAlgorithm
5. Key Derivation
This section describes the conventions of using the KDF to compute the
KEK for KEMRecipient
Many KDFs internally employ a one-way hash function. When this is
the case, the hash function that is used is indirectly indicated by
the Key
The KDF inputs are as follows:¶
IKM is the input keying material. It is a symmetric secret input to
the KDF. The KDF may use a hash function or an encryption algorithm
to generate a pseudorandom key. The algorithm used to derive the
IKM is dependent on the algorithm identified in the
Key
L is the length of the output keying material in octets. L is
identified in the kekLength of the KEMRecipient
info is contextual input to the KDF. The DER-encoded
CMSORIfor
The CMSORIfor
wrap identifies a key-encryption algorithm; the output of the key derivation function will be used as a key for this algorithm.¶
kekLength is the length of the KEK in octets; the output of the key derivation function will be exactly this size.¶
ukm is optional user keying material; see Section 3.¶
The KDF output is as follows:¶
OKM is the output keying material with the exact length of L octets. The OKM is the KEK that is used to encrypt the CEK or the CAEK.¶
An acceptable KDF MUST accept an IKM, L, and info as inputs. An acceptable
KDF MAY also accept a salt input value, which is carried as a parameter to
the Key
6. ASN.1 Modules
This section provides two ASN.1 modules [X.680]. The first ASN.1
module is an extension to the Algorithm
The first ASN.1 module uses EXPLICIT tagging, and the second ASN.1 module uses IMPLICIT tagging.¶
Both ASN.1 modules follow the conventions established in [RFC5911], [RFC5912], and [RFC6268].¶
7. Security Considerations
The security considerations discussed in [RFC5652] are applicable to this document.¶
To be appropriate for use with this specification, the KEM algorithm MUST
explicitly be designed to be secure when the public key is used many
times. For example, a KEM algorithm with a single-use public key is not
appropriate, because the public key is expected to be carried in a
long-lived certificate [RFC5280] and used over and over. Thus, KEM
algorithms that offer indistinguishab
The KDF SHOULD offer at least the security level of the KEM.¶
The choice of the key-encryption algorithm and the size of the KEK SHOULD be made based on the security level provided by the KEM. The key-encryption algorithm and the KEK SHOULD offer at least the security level of the KEM.¶
KEM algorithms do not provide data origin authentication; therefore, when
a KEM algorithm is used with the authenticated
Implementations MUST protect the KEM private key, the KEK, and the CEK (or the CAEK). Compromise of the KEM private key may result in the disclosure of all contents protected with that KEM private key. However, compromise of the KEK, the CEK, or the CAEK may result in disclosure of the encrypted content of a single message.¶
The KEM produces the IKM input value for the KDF. This IKM value MUST NOT
be reused for any other purpose. Likewise, any random value used by
the KEM algorithm to produce the shared secret or its encapsulation MUST NOT
be reused for any other purpose. That is, the originator MUST generate a
fresh KEM shared secret for each recipient in the KEMRecipient
Implementations MUST randomly generate content
If the cipher and key sizes used for the key-encryption algorithm and the
content
If the cipher and key sizes used for the key-encryption algorithm and the
content
If the cipher and key sizes used for the key-encryption algorithm and the
message
Implementers should be aware that cryptographic algorithms, including KEM algorithms, become weaker with time. As new cryptoanalysis techniques are developed and computing capabilities advance, the work factor to break a particular cryptographic algorithm will be reduced. As a result, cryptographic algorithm implementations should be modular, allowing new algorithms to be readily inserted. That is, implementers should be prepared for the set of supported algorithms to change over time.¶
8. IANA Considerations
For KEMRecipient
For the ASN.1 module defined in Section 6.1, IANA has
assigned the following OID in the "SMI Security for PKIX Module
Identifier" registry
For the ASN.1 module defined in Section 6.2, IANA has
assigned the following OID in the "SMI Security for S/MIME Module
Identifier
9. References
9.1. Normative References
- [RFC2119]
-
Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, DOI 10
.17487 , , <https:///RFC2119 www >..rfc -editor .org /info /rfc2119 - [RFC5083]
-
Housley, R., "Cryptographic Message Syntax (CMS) Authenticated
-Enveloped , RFC 5083, DOI 10-Data Content Type" .17487 , , <https:///RFC5083 www >..rfc -editor .org /info /rfc5083 - [RFC5280]
-
Cooper, D., Santesson, S., Farrell, S., Boeyen, S., Housley, R., and W. Polk, "Internet X.509 Public Key Infrastructure Certificate and Certificate Revocation List (CRL) Profile", RFC 5280, DOI 10
.17487 , , <https:///RFC5280 www >..rfc -editor .org /info /rfc5280 - [RFC5652]
-
Housley, R., "Cryptographic Message Syntax (CMS)", STD 70, RFC 5652, DOI 10
.17487 , , <https:///RFC5652 www >..rfc -editor .org /info /rfc5652 - [RFC5911]
-
Hoffman, P. and J. Schaad, "New ASN.1 Modules for Cryptographic Message Syntax (CMS) and S/MIME", RFC 5911, DOI 10
.17487 , , <https:///RFC5911 www >..rfc -editor .org /info /rfc5911 - [RFC5912]
-
Hoffman, P. and J. Schaad, "New ASN.1 Modules for the Public Key Infrastructure Using X.509 (PKIX)", RFC 5912, DOI 10
.17487 , , <https:///RFC5912 www >..rfc -editor .org /info /rfc5912 - [RFC8174]
-
Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words", BCP 14, RFC 8174, DOI 10
.17487 , , <https:///RFC8174 www >..rfc -editor .org /info /rfc8174 - [X.680]
-
ITU-T, "Information technology - Abstract Syntax Notation One (ASN.1): Specification of basic notation", ITU-T Recommendation X.680, ISO/IEC 8824-1:2021, , <https://
www >..itu .int /rec /T -REC -X .680 - [X.690]
-
ITU-T, "Information technology - ASN.1 encoding rules: Specification of Basic Encoding Rules (BER), Canonical Encoding Rules (CER) and Distinguished Encoding Rules (DER)", ITU-T Recommendation X.690, ISO/IEC 8825-1:2021, , <https://
www >..itu .int /rec /T -REC -X .690
9.2. Informative References
- [FO]
-
Fujisaki, E. and T. Okamoto, "Secure Integration of Asymmetric and Symmetric Encryption Schemes", Springer Science and Business Media LLC, Journal of Cryptology, vol. 26, no. 1, pp. 80-101, DOI 10
.1007 , , <https:///s00145 -011 -9114 -1 doi >..org /10 .1007 /s00145 -011 -9114 -1 - [HHK]
-
Hofheinz, D., Hövelmanns, K., and E. Kiltz, "A Modular Analysis of the Fujisaki
-Okamoto Transformation" , Springer International Publishing, Theory of Cryptography, TCC 2017, Lecture Notes in Computer Science, vol. 10677, pp. 341-371, Print ISBN 9783319704999, Online ISBN 9783319705002, DOI 10.1007 , , <https:///978 -3 -319 -70500 -2 _12 doi >..org /10 .1007 /978 -3 -319 -70500 -2 _12 - [RFC4086]
-
Eastlake 3rd, D., Schiller, J., and S. Crocker, "Randomness Requirements for Security", BCP 106, RFC 4086, DOI 10
.17487 , , <https:///RFC4086 www >..rfc -editor .org /info /rfc4086 - [RFC5869]
-
Krawczyk, H. and P. Eronen, "HMAC-based Extract
-and , RFC 5869, DOI 10-Expand Key Derivation Function (HKDF)" .17487 , , <https:///RFC5869 www >..rfc -editor .org /info /rfc5869 - [RFC6268]
-
Schaad, J. and S. Turner, "Additional New ASN.1 Modules for the Cryptographic Message Syntax (CMS) and the Public Key Infrastructure Using X.509 (PKIX)", RFC 6268, DOI 10
.17487 , , <https:///RFC6268 www >..rfc -editor .org /info /rfc6268
Acknowledgements
Our thanks to Burt Kaliski for his guidance and design review.¶
Our thanks to Carl Wallace for his careful review of the ASN.1 modules.¶
Our thanks to Hendrik Brockhaus, Jonathan Hammell, Mike Jenkins, David von Oheimb, Francois Rousseau, and Linda Dunbar for their careful reviews and thoughtful comments.¶