RFC 9936: Use of ML-KEM in the Cryptographic Message Syntax (CMS)
- J. Prat,
- M. Ounsworth,
- D. Van Geest
Abstract
Module
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) 2026 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
The Module
[RFC9629] defines the KEMRecipient
1.1. Conventions and 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. ML-KEM
ML-KEM is a lattice-based KEM using Module Learning with Errors as its underlying primitive, which is a structured lattices variant that offers good performance and relatively small and balanced key and ciphertext sizes. ML-KEM was standardized with three parameter sets: ML-KEM-512, ML-KEM-768, and ML-KEM-1024. The parameters for each of the security levels were chosen to be at least as secure as a generic block cipher of 128, 192, or 256 bits, respectively. Appendix B provides more information on ML-KEM security levels and sizes.¶
All KEM algorithms provide three functions: KeyGen(), Encapsulate(), and Decapsulate().¶
The following summarizes these three functions for the ML-KEM algorithm, referencing corresponding functions in [FIPS203]:¶
- KeyGen() -> (ek, dk):
-
Generate the public encapsulation key (ek) and a private decapsulation key (dk). [FIPS203] specifies two formats for an ML-KEM private key: a 64-octet seed (d,z) and an (expanded) private decapsulation key (dk). Algorithm 19 (
ML-KEM.KeyGen()) from [FIPS203] generates the public encapsulation key (ek) and the private decapsulation key (dk). As an alternative, when a seed (d,z) is generated first and then the seed is expanded to get the keys, algorithm 16 (ML) from [FIPS203] expands the seed to ek and dk. See Section 6 of [RFC9935] for private key encoding considerations.¶-KEM .Key Gen _internal (d,z ) - Encapsulate(ek) -> (c, ss):
-
Given the recipient's public key (ek), produce both a ciphertext (c) to be passed to the recipient and a shared secret (ss) for use by the originator. Algorithm 20 (
ML) from [FIPS203] is the encapsulation function for ML-KEM.¶-KEM .Encaps (ek ) - Decapsulate(dk, c) -> ss:
-
Given the private key (dk) and the ciphertext (c), produce the shared secret (ss) for the recipient. Algorithm 21 (
ML) from [FIPS203] is the decapsulation function for ML-KEM. If the private key is stored in seed form,-KEM .Decaps (dk,c ) MLmay be needed as a first step to compute dk. See Section 8 of [RFC9935] for consistency considerations if the private key was stored in both seed and expanded formats.¶-KEM .Key Gen _internal (d,z )
All security levels of ML-KEM use SHA3-256, SHA3-512, SHAKE128, and SHAKE256 internally.¶
2. Use of the ML-KEM Algorithm in the CMS
The ML-KEM algorithm MAY be employed for one or more recipients in the CMS enveloped-data content type [RFC5652], the CMS authenticated
Processing ML-KEM with KEMRecipient
2.1. RecipientInfo Conventions
When the ML-KEM algorithm is employed for a recipient, the RecipientInfo alternative for that recipient MUST be Other
The fields of the KEMRecipient
- version
- The syntax version number; it MUST be 0.¶
- rid
- Identifies the recipient's certificate or public key.¶
- kem
- Identifies the KEM algorithm; it MUST contain one of id
-alg -ml -kem -512, id -alg -ml -kem -768, or id -alg -ml -kem -1024 . These identifiers are reproduced in Section 3.¶ - kemct
- The ciphertext produced for this recipient.¶
- kdf
- Identifies the key derivation algorithm. Note that the Key Derivation Function (KDF) used for CMS RecipientInfo process MAY be different than the KDF used within the ML-KEM algorithm. Implementations MUST support the HMAC-based Key Derivation Function (HKDF) [RFC5869] with SHA-256 [FIPS180] using the id
-alg -hkdf -with -sha256 KDF object identifier (OID) [RFC8619]. As specified in [RFC8619], the parameter field MUST be absent when this OID appears within the ASN.1 type Algorithm Identifier . Implementations MAY support other KDFs as well.¶ - kekLength
- The size of the key-encryption key in octets.¶
- ukm
- Optional input to the KDF. The secure use of ML-KEM in CMS does not depend on the use of a ukm value, so this document does not place any requirements on this value. See Section 3 of [RFC9629] for more information about the ukm parameter.¶
- wrap
- Identifies a key-encryption algorithm used to encrypt the content
-encryption key. Implementations supporting ML-KEM-512 MUST support the AES-Wrap-128 [RFC3394] key-encryption algorithm using the id-aes128-wrap key-encryption algorithm OID [RFC3565]. Implementations supporting ML-KEM-768 or ML-KEM-1024 MUST support the AES-Wrap-256 [RFC3394] key-encryption algorithm using the id-aes256-wrap key-encryption algorithm OID [RFC3565]. Implementations MAY support other key-encryption algorithms as well.¶
Appendix C contains an example of establishing a content
2.2. Underlying Components
When ML-KEM is employed in the CMS, the underlying components used within the KEMRecipient
If underlying components other than those specified in Section 2.1 are used, then the following table gives the minimum requirements on the components used with ML-KEM in the KEMRecipient
(*) In the case of AES Key Wrap, a 256-bit key is typically used because AES-192 is not as commonly deployed.¶
2.2.1. Use of the HKDF-Based Key Derivation Function
The HKDF function is a composition of the HKDF-Extract and HKDF-Expand functions.¶
When used with KEMRecipient
2.3. Certificate Conventions
[RFC5280] specifies the profile for using X.509 certificates in Internet applications. A recipient static public key is needed for ML-KEM and the originator obtains that public key from the recipient's certificate. The conventions for carrying ML-KEM public keys are specified in [RFC9935].¶
2.4. SMIME Capabilities Attribute Conventions
Section 2.5.2 of [RFC8551] defines the SMIMECapabiliti
The SMIMECapability SEQUENCE representing the ML-KEM algorithm MUST include one of the ML-KEM OIDs in the capabilityID field. When one of the ML-KEM OIDs appears in the capabilityID field, the parameters MUST NOT be present.¶
3. Identifiers
All identifiers used to indicate ML-KEM within the CMS are defined in [CSOR] and [RFC8619]; they are reproduced here for convenience:¶
4. Security Considerations
The Security Considerations sections of [RFC9935] and [RFC9629] apply to this specification as well.¶
For ongoing discussions of ML-KEM-specific security considerations, refer to [MLKEM-SEC-CONS].¶
Implementations MUST protect the ML-KEM private key, the key-encryption key, the content
Additional considerations related to key management may be found in [NIST
The generation of private keys relies on random numbers, as does the encapsulation function of ML-KEM. The use of inadequate pseudorandom number generators (PRNGs) to generate these values can result in little or no security. In the case of key generation, a random 32-byte seed is used to deterministical
ML-KEM encapsulation and decapsulation only outputs a shared secret and ciphertext. Implementations MUST NOT use intermediate values directly for any purpose.¶
Implementations SHOULD NOT reveal information about intermediate values or calculations, whether by timing or other "side channels"; otherwise, an opponent may be able to determine information about the keying data and/or the recipient's private key. Although not all intermediate information may be useful to an opponent, it is preferable to conceal as much information as is practical, unless analysis specifically indicates that the information would not be useful to an opponent.¶
Generally, good cryptographic practice employs a given ML-KEM key pair in only one scheme. This practice avoids the risk that vulnerability in one scheme may compromise the security of the other and may be essential to maintain provable security.¶
Parties can gain assurance that implementations are correct through formal implementation validation, such as the NIST Cryptographic Module Validation Program (CMVP) [CMVP].¶
5. IANA Considerations
For the ASN.1 Module in Appendix A, IANA has assigned an OID for the module identifier (84) with a description of "id
6. References
6.1. Normative References
- [CSOR]
-
NIST, "Computer Security Objects Register (CSOR)", , <https://
csrc >..nist .gov /projects /computer -security -objects -register /algorithm -registration - [FIPS180]
-
NIST, "Secure Hash Standard", NIST FIPS 180-4, DOI 10
.6028 , , <https:///NIST .FIPS .180 -4 nvlpubs >..nist .gov /nistpubs /FIPS /NIST .FIPS .180 -4 .pdf - [FIPS203]
-
NIST, "Module
-Lattice , NIST FIPS 203, DOI 10-Based Key -Encapsulation Mechanism Standard" .6028 , , <https:///NIST .FIPS .203 doi >..org /10 .6028 /NIST .FIPS .203 - [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 - [RFC3394]
-
Schaad, J. and R. Housley, "Advanced Encryption Standard (AES) Key Wrap Algorithm", RFC 3394, DOI 10
.17487 , , <https:///RFC3394 www >..rfc -editor .org /info /rfc3394 - [RFC3565]
-
Schaad, J., "Use of the Advanced Encryption Standard (AES) Encryption Algorithm in Cryptographic Message Syntax (CMS)", RFC 3565, DOI 10
.17487 , , <https:///RFC3565 www >..rfc -editor .org /info /rfc3565 - [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 - [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 - [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 - [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 - [RFC8411]
-
Schaad, J. and R. Andrews, "IANA Registration for the Cryptographic Algorithm Object Identifier Range", RFC 8411, DOI 10
.17487 , , <https:///RFC8411 www >..rfc -editor .org /info /rfc8411 - [RFC8551]
-
Schaad, J., Ramsdell, B., and S. Turner, "Secure
/Multipurpose Internet Mail Extensions (S/MIME) Version 4.0 Message Specification" , RFC 8551, DOI 10.17487 , , <https:///RFC8551 www >..rfc -editor .org /info /rfc8551 - [RFC8619]
-
Housley, R., "Algorithm Identifiers for the HMAC-based Extract
-and , RFC 8619, DOI 10-Expand Key Derivation Function (HKDF)" .17487 , , <https:///RFC8619 www >..rfc -editor .org /info /rfc8619 - [RFC9629]
-
Housley, R., Gray, J., and T. Okubo, "Using Key Encapsulation Mechanism (KEM) Algorithms in the Cryptographic Message Syntax (CMS)", RFC 9629, DOI 10
.17487 , , <https:///RFC9629 www >..rfc -editor .org /info /rfc9629 - [RFC9935]
-
Turner, S., Kampanakis, P., Massimo, J., and B. E. Westerbaan, "Internet X.509 Public Key Infrastructure - Algorithm Identifiers for the Module
-Lattice , RFC 9935, DOI 10-Based Key -Encapsulation Mechanism (ML-KEM)" .17487 , , <https:///RFC9935 www >..rfc -editor .org /info /rfc9935 - [X680]
-
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
6.2. Informative References
- [CMVP]
-
NIST, "Cryptographic Module Validation Program (CMVP)", , <https://
csrc >..nist .gov /projects /cryptographic -module -validation -program - [IKEv2-MLKEM]
-
Kampanakis, P., "Post-quantum Key Exchange with ML-KEM in the Internet Key Exchange Protocol Version 2 (IKEv2)", Work in Progress, Internet-Draft, draft
-ietf , , <https://-ipsecme -ikev2 -mlkem -04 datatracker >..ietf .org /doc /html /draft -ietf -ipsecme -ikev2 -mlkem -04 - [MLKEM-SEC-CONS]
-
Fluhrer, S., Dang, Q., Mattsson, J. P., Milner, K., and D. Shiu, "ML-KEM Security Considerations", Work in Progress, Internet-Draft, draft
-sfluhrer , , <https://-cfrg -ml -kem -security -considerations -04 datatracker >..ietf .org /doc /html /draft -sfluhrer -cfrg -ml -kem -security -considerations -04 - [NIST-PQ]
-
NIST, "Post-Quantum Cryptography (PQC)", , <https://
csrc >..nist .gov /projects /post -quantum -cryptography - [NIST
.SP .800 -57pt1r5] -
Barker, E., "Recommendation for Key Management: Part 1 - General", NIST SP 800-57pt1r5, DOI 10
.6028 , , <https:///NIST .SP .800 -57pt1r5 nvlpubs >..nist .gov /nistpubs /Special Publications /NIST .SP .800 -57pt1r5 .pdf - [RFC9690]
-
Housley, R. and S. Turner, "Use of the RSA-KEM Algorithm in the Cryptographic Message Syntax (CMS)", RFC 9690, DOI 10
.17487 , , <https:///RFC9690 www >..rfc -editor .org /info /rfc9690
Appendix A. ASN.1 Module
This appendix includes the ASN.1 module [X680] for ML-KEM. This module imports objects from [RFC5911], [RFC9629], [RFC8619], and [RFC9935].¶
Appendix B. Parameter Set Security and Sizes
Instead of defining the strength of a quantum algorithm using the imprecise notion of bits of security, NIST has defined security levels by picking a reference scheme, which is expected to offer notable levels of resistance to both quantum and classical attacks. To wit, a KEM algorithm that achieves NIST Post-Quantum Cryptography (PQC) security must require computational resources to break IND-CCA2 security comparable or greater than that required for key search on AES-128, AES-192, and AES-256 for Levels 1, 3, and 5, respectively. Levels 2 and 4 use collision search for SHA-256 and SHA-384 as reference.¶
Appendix C. ML-KEM CMS Authenticated-Enveloped-Data Example
This example shows the establishment of an AES-128 content
In real-world use, the originator would encrypt the content- encryption key in a manner that would allow decryption with their own private key as well as the recipient's private key. This is omitted in an attempt to simplify the example.¶
C.1. Originator CMS Processing
Alice obtains Bob's ML-KEM-512 public key:¶
Bob's ML-KEM-512 public key has the following key identifier:¶
Alice generates a shared secret and ciphertext using Bob's ML-KEM-512 public key:¶
Shared secret:¶
Ciphertext:¶
Alice encodes the CMSORIfor
Alice derives the key-encryption key from the shared secret and CMSORIfor
Alice randomly generates a 128-bit content
Alice uses AES-128-KEYWRAP to encrypt the content
Alice encrypts the padded content using AES-128-GCM with the content
The Base64-encoded result is:¶
This result decodes to:¶
C.2. Recipient CMS Processing
Bob's ML-KEM-512 private key:¶
Bob decapsulates the ciphertext in the KEMRecipient
Acknowledgements
This document borrows heavily from [RFC9690], [FIPS203], [RFC9935], and [IKEv2-MLKEM]. Thanks go to the authors of those documents. "Copying always makes things easier and less error prone." - [RFC8411].¶
Thanks to Carl Wallace, Jonathan Hammel, and Sean Turner for
the detailed review and Carl Wallace and Philippe Cece for interoperabilit