RFC 8696: Using Pre-Shared Key (PSK) in the Cryptographic Message Syntax (CMS)
- R. Housley
Abstract
The invention of a large-scale quantum computer would pose a serious challenge for the cryptographic algorithms that are widely deployed today. The Cryptographic Message Syntax (CMS) supports key transport and key agreement algorithms that could be broken by the invention of such a quantum computer. By storing communications that are protected with the CMS today, someone could decrypt them in the future when a large-scale quantum computer becomes available. Once quantum-secure key management algorithms are available, the CMS will be extended to support the new algorithms if the existing syntax does not accommodate them. This document describes a mechanism to protect today's communication from the future invention of a large-scale quantum computer by mixing the output of key transport and key agreement algorithms with a pre-shared key.¶
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) 2019 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 invention of a large-scale quantum computer would pose a serious challenge for the cryptographic algorithms that are widely deployed today [S1994]. It is an open question whether or not it is feasible to build a large-scale quantum computer and, if so, when that might happen [NAS2019]. However, if such a quantum computer is invented, many of the cryptographic algorithms and the security protocols that use them would become vulnerable.¶
The Cryptographic Message Syntax (CMS) [RFC5652][RFC5083] supports key transport and key agreement algorithms that could be broken by the invention of a large-scale quantum computer [C2PQ]. These algorithms include RSA [RFC8017], Diffie-Hellman [RFC2631], and Elliptic Curve Diffie-Hellman (ECDH) [RFC5753]. As a result, an adversary that stores CMS-protected communications today could decrypt those communications in the future when a large-scale quantum computer becomes available.¶
Once quantum-secure key management algorithms are available, the CMS will be extended to support them if the existing syntax does not already accommodate the new algorithms.¶
In the near term, this document describes a mechanism to protect
today's communication from the future invention of a large-scale
quantum computer by mixing the output of existing key transport and
key agreement algorithms with a pre-shared key (PSK). Secure
communication can be achieved today by mixing a strong PSK with the
output of an existing key transport algorithm, like RSA [RFC8017], or
an existing key agreement algorithm, like Diffie-Hellman [RFC2631] or
Elliptic Curve Diffie-Hellman (ECDH) [RFC5753]. A
security solution that is
believed to be quantum resistant can be achieved by using a PSK with
sufficient entropy along with a quantum
In addition, there may be other reasons for including a strong PSK besides protection against the future invention of a large-scale quantum computer. For example, there is always the possibility of a cryptoanalytic breakthrough on one or more classic public key algorithms, and there are longstanding concerns about undisclosed trapdoors in Diffie-Hellman parameters [FGHT2016]. Inclusion of a strong PSK as part of the overall key management offers additional protection against these concerns.¶
Note that the CMS also supports key management techniques based on
symmetric key-encryption keys and passwords, but they are not
discussed in this document because they are already quantum
resistant. The symmetric key-encryption key technique is quantum
resistant when used with an adequate key size. The password
technique is quantum resistant when used with a quantum
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 [X680], which uses the Basic Encoding Rules (BER) and the Distinguished Encoding Rules (DER) [X690].¶
1.3. Version Numbers
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; 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 sender.¶
Whenever the structure is updated, a higher version number will be
assigned. However, to ensure maximum interoperabilit
2. Overview
The CMS enveloped-data content type [RFC5652] and the CMS
authenticated
This specification defines two quantum
The content
When using a key transport algorithm:¶
When using a key agreement algorithm:¶
As specified in Section 6.2.5 of [RFC5652], recipient information for
additional key management techniques is represented in the
Other
The first key management technique, called "keyTransPSK" (see
Section 3), uses a key transport algorithm to transfer the key-derivation key from the sender to the recipient, and then the key-derivation key is mixed with the PSK using a KDF. The output of the
KDF is the key-encryption key, which is used for the encryption of
the content
The second key management technique, called "keyAgreePSK" (see
Section 4), uses a key agreement algorithm to establish a pairwise key-encryption
key. This pairwise key-encryption key is then mixed with the PSK using a
KDF to produce a second pairwise key-encryption key, which is then used to
encrypt the content
3. keyTransPSK
Per-recipient information using keyTransPSK is represented in the
Key
The id
The Key
The fields of the Key
4. keyAgreePSK
Per-recipient information using keyAgreePSK is represented in the
Key
The id
The fields of the Key
5. Key Derivation
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
Other KDFs internally employ an encryption algorithm. When this is
the case, the encryption that is used is indirectly indicated by the
Key
A KDF has several input values. This section describes the
conventions for using the KDF to compute the key-encryption key for
Key
The KDF inputs are:¶
The fields of type CMSORIfor
The KDF output is:¶
An acceptable KDF MUST accept IKM, L, and info inputs; an acceptable
KDF MAY also accept salt and other inputs. All of these inputs MUST
influence the output of the KDF. If the KDF requires a salt or other
inputs, then those inputs MUST be provided as parameters of the
Key
6. ASN.1 Module
This section contains the ASN.1 module for the two key management techniques defined in this document. This module imports types from other ASN.1 modules that are defined in [RFC5912] and [RFC6268].¶
7. Security Considerations
The security considerations related to the CMS enveloped-data
content type in [RFC5652] and the security considerations related to
the CMS authenticated
Implementations of the key derivation function must compute the
entire result, which, in this specification, is a key-encryption key,
before outputting any portion of the result. The resulting key-encryption key must be protected. Compromise of the key-encryption
key may result in the disclosure of all content
Implementations must protect the PSK, key transport private key, agreement private key, and key-derivation key. Compromise of the PSK will make the encrypted content vulnerable to the future invention of a large-scale quantum computer. Compromise of the PSK and either the key transport private key or the agreement private key may result in the disclosure of all contents protected with that combination of keying material. Compromise of the PSK and the key-derivation key may result in the disclosure of all contents protected with that combination of keying material.¶
A large-scale quantum computer will essentially negate the security
provided by the key transport algorithm or the key agreement
algorithm, which means that the attacker with a large-scale quantum
computer can discover the key-derivation key. In addition, a large-scale quantum computer effectively cuts the security provided by a
symmetric key algorithm in half. Therefore, the PSK needs at least
256 bits of entropy to provide 128 bits of security. To match that
same level of security, the key derivation function needs to be
quantum resistant and produce a key-encryption key that is at least
256 bits in length. Similarly, the content
When using a PSK with a key transport or a key agreement algorithm, a
key-encryption key is produced to encrypt the content
The selection of the key-derivation function imposes an upper bound on the strength of the resulting key-encryption key. The strength of the selected key-derivation function should be at least as strong as the key-encryption algorithm that is selected. NIST SP 800-56C Revision 1 [NIST2018] offers advice on the security strength of several popular key-derivation functions.¶
Implementers should not mix quantum
Implementers should not send the same content in different messages,
one using a quantum
This specification does not require that PSK be known only by the sender and recipients. The PSK may be known to a group. Since confidentiality depends on the key transport or key agreement algorithm, knowledge of the PSK by other parties does not inherently enable eavesdropping. However, group members can record the traffic of other members and then decrypt it if they ever gain access to a large-scale quantum computer. Also, when many parties know the PSK, there are many opportunities for theft of the PSK by an attacker. Once an attacker has the PSK, they can decrypt stored traffic if they ever gain access to a large-scale quantum computer in the same manner as a legitimate group member.¶
Sound cryptographic key hygiene is to use a key for one and only one purpose. Use of the recipient's public key for both the traditional CMS and the PSK-mixing variation specified in this document would be a violation of this principle; however, there is no known way for an attacker to take advantage of this situation. That said, an application should enforce separation whenever possible. For example, a purpose identifier for use in the X.509 extended key usage certificate extension [RFC5280] could be identified in the future to indicate that a public key should only be used in conjunction with or without a PSK.¶
Implementations must randomly generate key-derivation keys as well as
content
Implementers should be aware that cryptographic algorithms become weaker with time. As new cryptanalysis techniques are developed and computing performance improves, the work factor to break a particular cryptographic algorithm will be reduced. Therefore, 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.¶
The security properties provided by the mechanisms specified in this
document can be validated using formal methods. A ProVerif proof in
[H2019] shows that an attacker with a large-scale quantum computer
that is capable of breaking the Diffie-Hellman key agreement
algorithm cannot disrupt the delivery of the content
8. Privacy Considerations
An observer can see which parties are using each PSK simply by
watching the PSK key identifiers. However, the addition of these key identifiers does not really weaken
the privacy situation. When key transport
is used, the Recipient
9. IANA Considerations
One object identifier for the ASN.1 module in Section 6 was assigned
in the "SMI Security for S/MIME Module Identifier
One new entry has been added in the "SMI Security for S/MIME Mail
Security
A new registry titled "SMI Security for S/MIME Other
Recipient Info Identifiers
Updates to the new registry are to be made according to the Specification Required policy as defined in [RFC8126]. The expert is expected to ensure that any new values identify additional RecipientInfo structures for use with the CMS. Object identifiers for other purposes should not be assigned in this arc.¶
Two assignments were made in the new "SMI Security for S/MIME Other Recipient
Info Identifiers
10. References
10.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 - [RFC5652]
-
Housley, R., "Cryptographic Message Syntax (CMS)", STD 70, RFC 5652, DOI 10
.17487 , , <https:///RFC5652 www >..rfc -editor .org /info /rfc5652 - [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 - [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 - [RFC8126]
-
Cotton, M., Leiba, B., and T. Narten, "Guidelines for Writing an IANA Considerations Section in RFCs", BCP 26, RFC 8126, DOI 10
.17487 , , <https:///RFC8126 www >..rfc -editor .org /info /rfc8126 - [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 - [X680]
- ITU-T, "Information technology -- Abstract Syntax Notation One (ASN.1): Specification of basic notation", ITU-T Recommendation X.680, .
- [X690]
- 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, .
10.2. Informative References
- [AES]
-
National Institute of Standards and Technology, "Advanced Encryption Standard (AES)", DOI 10
.6028 , NIST PUB 197, , <https:///NIST .FIPS .197 doi >..org /10 .6028 /NIST .FIPS .197 - [C2PQ]
-
Hoffman, P., "The Transition from Classical to Post-Quantum Cryptography", Work in Progress, Internet-Draft, draft
-hoffman , , <https://-c2pq -06 tools >..ietf .org /html /draft -hoffman -c2pq -06 - [FGHT2016]
-
Fried, J., Gaudry, P., Heninger, N., and E. Thome, "A kilobit hidden SNFS discrete logarithm computation", Cryptology ePrint Archive Report 2016/961, , <https://
eprint >..iacr .org /2016 /961 .pdf - [H2019]
-
Hammell, J., "Subject: [lamps] WG Last Call for draft
-ietf , message to the IETF mailing list, , <https://-lamps -cms -mix -with -psk"" mailarchive >..ietf .org /arch /msg /spasm /_6d _4jp3s Opr Anb U2fp _yp _-6 -k - [IANA]
-
IANA, "Structure of Management Information (SMI) Numbers (MIB Module Registrations)", , <https://
www >..iana .org /assignments /smi -numbers - [NAS2019]
-
National Academies of Sciences, Engineering, and Medicine, "Quantum Computing: Progress and Prospects", DOI 10.17226/25196, , <https://
doi >..org /10 .17226 /25196 - [NIST2018]
-
Barker, E., Chen, L., and R. Davis, "Recommendation for Key-Derivation Methods in Key
-Establishment , NIST Special Publication 800-56C Revision 1, , <https://Schemes" nvlpubs >..nist .gov /nistpubs /Special Publications /NIST .SP .800 -56Cr1 .pdf - [RFC2631]
-
Rescorla, E., "Diffie-Hellman Key Agreement Method", RFC 2631, DOI 10
.17487 , , <https:///RFC2631 www >..rfc -editor .org /info /rfc2631 - [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 - [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 - [RFC5753]
-
Turner, S. and D. Brown, "Use of Elliptic Curve Cryptography (ECC) Algorithms in Cryptographic Message Syntax (CMS)", RFC 5753, DOI 10
.17487 , , <https:///RFC5753 www >..rfc -editor .org /info /rfc5753 - [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 - [RFC8017]
-
Moriarty, K., Ed., Kaliski, B., Jonsson, J., and A. Rusch, "PKCS #1: RSA Cryptography Specifications Version 2.2", RFC 8017, DOI 10
.17487 , , <https:///RFC8017 www >..rfc -editor .org /info /rfc8017 - [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 - [S1994]
- Shor, P., "Algorithms for Quantum Computation: Discrete Logarithms and Factoring", Proceedings of the 35th Annual Symposium on Foundations of Computer Science, pp. 124-134", .
Appendix A. Key Transport with PSK Example
This example shows the establishment of an AES-256 content
In real-world use, the originator would encrypt the key-derivation key in their own RSA public key as well as the recipient's public key. This is omitted in an attempt to simplify the example.¶
A.1. Originator Processing Example
The pre-shared key known to Alice and Bob, in hexadecimal, is:¶
The identifier assigned to the pre-shared key is:¶
Alice obtains Bob's public key:¶
Bob's RSA public key has the following key identifier:¶
Alice randomly generates a content
Alice randomly generates a key-derivation key:¶
Alice encrypts the key-derivation key in Bob's public key:¶
Alice produces a 256-bit key-encryption key with HKDF using
SHA-384; the secret value is the key-derivation key; and the 'info' is the DER-encoded CMSORIfor
The DER encoding of CMSORIfor
The HKDF output is 256 bits:¶
Alice uses AES-KEY-WRAP to encrypt the 256-bit content
Alice encrypts the content using AES-256-GCM with the content
The content plaintext is:¶
The resulting ciphertext is:¶
The resulting 12-octet authentication tag is:¶
A.2. ContentInfo and AuthEnvelopedData
Alice encodes the Auth
A.3. Recipient Processing Example
Bob's private key is:¶
Bob decrypts the key-derivation key with his RSA private key:¶
Bob produces a 256-bit key-encryption key with HKDF using SHA-384;
the secret value is the key-derivation key; and the 'info' is
the DER-encoded CMSORIfor
Bob uses AES-KEY-WRAP to decrypt the content
Bob decrypts the content using AES-256-GCM with the content
The 12-octet authentication tag is:¶
The received ciphertext content is:¶
The resulting plaintext content is:¶
Appendix B. Key Agreement with PSK Example
This example shows the establishment of an AES-256 content
In real-world use, the originator would treat themselves as an additional recipient by performing key agreement with their own static public key and the ephemeral private key generated for this message. This is omitted in an attempt to simplify the example.¶
B.1. Originator Processing Example
The pre-shared key known to Alice and Bob, in hexadecimal, is:¶
The identifier assigned to the pre-shared key is:¶
Alice randomly generates a content
Alice obtains Bob's static ECDH public key:¶
It has a key identifier of:¶
Alice generates an ephemeral ECDH key pair on the same curve:¶
Alice computes a shared secret called "Z" using Bob's static ECDH public key and her ephemeral ECDH private key; Z is:¶
Alice computes the pairwise key-encryption key, called "KEK1", from Z using
the X9.63 KDF with the ECC
The DER encoding of ECC
The X9.63 KDF output is the 256-bit KEK1:¶
Alice produces the 256-bit KEK2 with HKDF using SHA-384; the secret
value is KEK1; and the 'info' is the DER-encoded CMSORIfor
The DER encoding of CMSORIfor
The HKDF output is the 256-bit KEK2:¶
Alice uses AES-KEY-WRAP to encrypt the content
Alice encrypts the content using AES-256-GCM with the content
The plaintext is:¶
The resulting ciphertext is:¶
The resulting 12-octet authentication tag is:¶
B.2. ContentInfo and AuthEnvelopedData
Alice encodes the Auth
B.3. Recipient Processing Example
Bob obtains Alice's ephemeral ECDH public key from the message:¶
Bob's static ECDH private key is:¶
Bob computes a shared secret called "Z" using Alice's ephemeral ECDH public key and his static ECDH private key; Z is:¶
Bob computes the pairwise key-encryption key, KEK1, from Z using
the X9.63 KDF with the ECC
Bob produces the 256-bit KEK2 with HKDF using SHA-384; the secret value
is KEK1; and the 'info' is the DER-encoded CMSORIfor
Bob uses AES-KEY-WRAP to decrypt the content
Bob decrypts the content using AES-256-GCM with the content
The 12-octet authentication tag is:¶
The received ciphertext content is:¶
The resulting plaintext content is:¶
Acknowledgements
Many thanks to Roman Danyliw, Ben Kaduk, Burt Kaliski, Panos Kampanakis, Jim Schaad, Robert Sparks, Sean Turner, and Daniel Van Geest for their review and insightful comments. They have greatly improved the design, clarity, and implementation guidance.¶