Algorithms for Cryptographic Message Syntax (CMS) Key Package Receipt and Error Content Types
Which signature, key-transport and encryption algorithms to support when protecting CMS key package receipts and errors.
Turner, S., "Algorithms for Cryptographic Message Syntax (CMS) Key Package Receipt and Error Content Types", RFC 7192, DOI 10.17487/RFC7192, April 2014, <https://www.rfc-editor.org/info/rfc7192>.
@misc{rfc7192,
series = {Request for Comments},
number = 7192,
howpublished = {RFC 7192},
publisher = {RFC Editor},
doi = {10.17487/RFC7192},
url = {https://www.rfc-editor.org/info/rfc7192},
author = {S. Turner},
title = {{Algorithms for Cryptographic Message Syntax (CMS) Key Package Receipt and Error Content Types}},
pagetotal = 6,
year = 2014,
month = apr,
} RFC text
Contents
Internet Engineering Task Force (IETF) S. Turner
Request for Comments: 7192 IECA
Category: Standards Track April 2014
ISSN: 2070-1721
Algorithms for Cryptographic Message Syntax (CMS)
Key Package Receipt and Error Content Types
Abstract
This document describes the conventions for using several
cryptographic algorithms with the Cryptographic Message Syntax (CMS)
key package receipt and error content types. Specifically, it
includes conventions necessary to implement SignedData,
EnvelopedData, EncryptedData, and AuthEnvelopedData.
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 5741.
Information about the current status of this document, any errata,
and how to provide feedback on it may be obtained at
http://www.rfc-editor.org/info/rfc7192.
Copyright Notice
Copyright (c) 2014 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
(http://trustee.ietf.org/license-info) in effect on the date of
publication of this document. Please review these documents
carefully, as they describe your rights and restrictions with respect
to this document. Code Components extracted from this document must
include Simplified BSD License text as described in Section 4.e of
the Trust Legal Provisions and are provided without warranty as
described in the Simplified BSD License.
1. Introduction
This document describes the conventions for using several
cryptographic algorithms with the Cryptographic Message Syntax (CMS)
key package receipt and error content types [RFC7191]. Specifically,
it includes conventions necessary to implement SignedData [RFC5652],
EnvelopedData [RFC5652], EncryptedData [RFC5652], and
AuthEnvelopedData [RFC5083].
This document does not define any new algorithms; instead, it refers
to previously defined algorithms. In fact, the algorithm
requirements in this document are the same as those in [RFC5959],
[RFC6033], [RFC6160], [RFC6161], and [RFC6162] with the following
exceptions: the content-encryption algorithm is AES in Cipher Block
Chaining (CBC) mode as opposed to AES Key Wrap with Message Length
Indicator (MLI) and the key-wrap algorithm is AES Key Wrap as opposed
to AES Key Wrap with MLI. The rationale for the difference is that
the receipt and error content types are not keys; therefore, AES Key
Wrap with MLI is not appropriate for the content-encryption
algorithm. If an implementation is not using AES Key Wrap with MLI
as the content-encryption algorithm, then there's no need to keep the
key-wrap algorithm the same as the content encryption algorithm.
NOTE: [RFC7191] only requires that the key package receipt be signed.
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
[RFC2119].
2. SignedData
If an implementation supports SignedData, then it MUST support the
signature scheme RSA [RFC3370] and SHOULD support the signature
schemes RSA Probabilistic Signature Scheme (RSASSA-PSS) [RFC4056] and
Digital Signature Algorithm (DSA) [RFC3370]. Additionally,
implementations MUST support the hash function SHA-256 [RFC5754] in
concert with these signature schemes, and they SHOULD support the
hash function SHA-1 [RFC3370]. Implementations can also choose the
to support Elliptic Curve Digital Signature Algorithm (ECDSA)
[RFC5753] and [RFC6090].
3. EnvelopedData
If an implementation supports EnvelopedData, then it MUST implement
key transport and it MAY implement key agreement.
When key transport is used, RSA encryption [RFC3370] MUST be
supported, and RSA Encryption Scheme - Optimal Asymmetric Encryption
Padding (RSAES-OAEP) [RFC3560] SHOULD be supported.
When key agreement is used, Diffie-Hellman (DH) ephemeral-static
[RFC3370] MUST be supported. When key agreement is used, Elliptic
Curve Diffie-Hellman (ECDH) [RFC5753] [RFC6090] MAY be supported.
Regardless of the key management technique choice, implementations
MUST support AES-128 in CBC mode [AES] as the content-encryption
algorithm. Implementations SHOULD support AES-256 in CBC mode [AES]
as the content-encryption algorithm.
When key agreement is used, the same length for the underlying block
algorithm MUST be used. If the content-encryption algorithm is
AES-128 in CBC mode, then the key-wrap algorithm MUST be AES-128 Key
Wrap [RFC3394]. If the content-encryption algorithm is AES-256 in
CBC mode, then the key-wrap algorithm MUST be AES-256 Key Wrap
[RFC3394].
4. EncryptedData
If an implementation supports EncryptedData, then it MUST implement
AES-128 in CBC mode [AES] and SHOULD implement AES-256 in CBC mode
[AES].
NOTE: EncryptedData requires that keys be managed by other means;
therefore, the only algorithm specified is the content-encryption
algorithm.
5. AuthEnvelopedData
If an implementation supports AuthEnvelopedData, then it MUST
implement the EnvelopedData recommendations except for the content-
encryption algorithm, which, in this case, MUST be AES-GCM [RFC5084];
the 128-bit version MUST be implemented, and the 256-bit version
SHOULD be implemented. Implementations MAY also support AES-CCM
[RFC5084].
6. Public Key Sizes
The easiest way to implement SignedData, EnvelopedData, and
AuthEnvelopedData is with public key certificates [RFC5280]. If an
implementation supports RSA, RSASSA-PSS, DSA, RSAES-OAEP, or Diffie-
Hellman, then it MUST support key lengths from 1024-bit to 2048-bit,
inclusive. If an implementation supports ECDSA or ECDH, then it MUST
support keys on the P-256 curve [RFC6090].
7. Security Considerations
The security considerations from [RFC3370], [RFC3394], [RFC3560],
[RFC4056], [RFC5084], [RFC5652], [RFC5753], and [RFC5754] apply.
[SP800-57] provides comparable bits of security for some algorithms
and key sizes. [SP800-57] also provides time frames during which
certain numbers of bits of security are appropriate, and some
environments may find these time frames useful.
8. Acknowledgements
I'd like to thank Russ Housley for his early feedback on this
document.
9. References
9.1. Normative References
[AES] National Institute of Standards and Technology, FIPS Pub
197: Advanced Encryption Standard (AES), 26 November 2001.
[RFC2119] Bradner, S., "Key words for use in RFCs to Indicate
Requirement Levels", BCP 14, RFC 2119, March 1997.
[RFC3370] Housley, R., "Cryptographic Message Syntax (CMS)
Algorithms", RFC 3370, August 2002.
[RFC3394] Schaad, J. and R. Housley, "Advanced Encryption Standard
(AES) Key Wrap Algorithm", RFC 3394, September 2002.
[RFC3560] Housley, R., "Use of the RSAES-OAEP Key Transport
Algorithm in Cryptographic Message Syntax (CMS)", RFC
3560, July 2003.
[RFC4056] Schaad, J., "Use of the RSASSA-PSS Signature Algorithm in
Cryptographic Message Syntax (CMS)", RFC 4056, June 2005.
[RFC5083] Housley, R., "Cryptographic Message Syntax (CMS)
Authenticated-Enveloped-Data Content Type", RFC 5083,
November 2007.
[RFC5084] Housley, R., "Using AES-CCM and AES-GCM Authenticated
Encryption in the Cryptographic Message Syntax (CMS)", RFC
5084, November 2007.
[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, May 2008.
[RFC5652] Housley, R., "Cryptographic Message Syntax (CMS)", STD 70,
RFC 5652, September 2009.
[RFC5753] Turner, S. and D. Brown, "Use of Elliptic Curve
Cryptography (ECC) Algorithms in Cryptographic Message
Syntax (CMS)", RFC 5753, January 2010.
[RFC5754] Turner, S., "Using SHA2 Algorithms with Cryptographic
Message Syntax", RFC 5754, January 2010.
[RFC6090] McGrew, D., Igoe, K., and M. Salter, "Fundamental Elliptic
Curve Cryptography Algorithms", RFC 6090, February 2011.
[RFC7191] Housley, R., "Cryptographic Message Syntax (CMS) Key
Package Receipt and Error Content Types", RFC 7191, April
2014.
9. Informative References
[RFC5959] Turner, S., "Algorithms for Asymmetric Key Package Content
Type", RFC 5959, August 2010.
[RFC6033] Turner, S., "Algorithms for Cryptographic Message Syntax
(CMS) Encrypted Key Package Content Type", RFC 6033,
December 2010.
[RFC6160] Turner, S., "Algorithms for Cryptographic Message Syntax
(CMS) Protection of Symmetric Key Package Content Types",
RFC 6160, April 2011.
[RFC6161] Turner, S., "Elliptic Curve Algorithms for Cryptographic
Message Syntax (CMS) Encrypted Key Package Content Type",
RFC 6161, April 2011.
[RFC6162] Turner, S., "Elliptic Curve Algorithms for Cryptographic
Message Syntax (CMS) Asymmetric Key Package Content Type",
RFC 6162, April 2011.
[SP800-57] National Institute of Standards and Technology (NIST),
Special Publication 800-57: Recommendation for Key
Management - Part 1 (Revised), March 2007.
Author's Address
Sean Turner
IECA, Inc.
3057 Nutley Street, Suite 106
Fairfax, VA 22031
USA
EMail: turners@ieca.com
AI ELI5
On this page
§1What This Document Does
RFC 7192 describes the conventions for using several cryptographic algorithms with the Cryptographic Message Syntax (CMS) key package receipt and error content types defined in RFC 7191. It covers four CMS protection types: SignedData, EnvelopedData and EncryptedData from RFC 5652, and AuthEnvelopedData from RFC 5083.
The document does not define any new algorithms. It points to algorithms that are already defined elsewhere. Its requirements match those in RFC 5959, RFC 6033, RFC 6160, RFC 6161 and RFC 6162, with two exceptions: the content-encryption algorithm is AES in Cipher Block Chaining (CBC) mode rather than AES Key Wrap with Message Length Indicator (MLI), and the key-wrap algorithm is plain AES Key Wrap rather than the MLI variant.
The reason is that receipts and errors are not keys, so AES Key Wrap with MLI is not appropriate for encrypting them. The RFC also notes that RFC 7191 only requires the key package receipt to be signed.
This is a rulebook that says which secret codes to use when sending a receipt. It does not invent new codes. It picks from codes that already exist.
§2SignedData
If an implementation supports SignedData, it MUST support the RSA signature scheme. It SHOULD also support the RSA Probabilistic Signature Scheme (RSASSA-PSS) and the Digital Signature Algorithm (DSA).
Implementations MUST support the hash function SHA-256 alongside these signature schemes, and SHOULD support SHA-1. They can also choose to support the Elliptic Curve Digital Signature Algorithm (ECDSA).
Since RFC 7191 requires receipts to be signed, this is the section that matters most for receipts.
A signature is like signing your name on a letter so people know it is really from you. Everyone must know the most common way of signing, and may know a few others.
§3EnvelopedData
If an implementation supports EnvelopedData, it MUST implement key transport and MAY implement key agreement. With key transport, RSA encryption MUST be supported and RSAES-OAEP SHOULD be supported. With key agreement, ephemeral-static Diffie-Hellman MUST be supported and Elliptic Curve Diffie-Hellman (ECDH) MAY be supported.
Whichever key management technique is used, implementations MUST support AES-128 in CBC mode as the content-encryption algorithm and SHOULD support AES-256 in CBC mode.
When key agreement is used, the key lengths must line up. If the content-encryption algorithm is AES-128 in CBC mode, the key-wrap algorithm MUST be AES-128 Key Wrap. If it is AES-256 in CBC mode, the key-wrap algorithm MUST be AES-256 Key Wrap.
An envelope hides a message so only the right person can open it. There are two ways to hand over the key to the envelope, and the rules say which ways everyone must know.
§4EncryptedData
If an implementation supports EncryptedData, it MUST implement AES-128 in CBC mode and SHOULD implement AES-256 in CBC mode.
EncryptedData requires that keys be managed by other means. Because of that, the only algorithm this section specifies is the content-encryption algorithm.
Here the lock is chosen, but how you get the key to the other person is somebody else's problem.
§5AuthEnvelopedData
If an implementation supports AuthEnvelopedData, it MUST follow the EnvelopedData recommendations, except for the content-encryption algorithm. For this type the content-encryption algorithm MUST be AES-GCM. The 128-bit version MUST be implemented and the 256-bit version SHOULD be implemented.
Implementations MAY also support AES-CCM.
This is an envelope that also has a tamper seal, so you can tell if someone changed the message inside. A different lock is used because it has to do both jobs.
| CMS type | Must support | Should support |
|---|---|---|
| EnvelopedData | AES-128 in CBC mode | AES-256 in CBC mode |
| EncryptedData | AES-128 in CBC mode | AES-256 in CBC mode |
| AuthEnvelopedData | AES-GCM, 128-bit | AES-GCM, 256-bit |
§6Public Key Sizes
The easiest way to implement SignedData, EnvelopedData and AuthEnvelopedData is with public key certificates, as defined in RFC 5280.
If an implementation supports RSA, RSASSA-PSS, DSA, RSAES-OAEP or Diffie-Hellman, it MUST support key lengths from 1024 bits to 2048 bits, inclusive. If it supports ECDSA or ECDH, it MUST support keys on the P-256 curve.
A longer key is like a lock with more tumblers. Everyone has to be able to handle locks in a certain range of sizes.
§7Security Considerations
The security considerations of RFC 3370, RFC 3394, RFC 3560, RFC 4056, RFC 5084, RFC 5652, RFC 5753 and RFC 5754 apply.
The RFC also points to NIST SP 800-57, which gives comparable bits of security for some algorithms and key sizes, along with time frames during which certain numbers of bits of security are appropriate. Some environments may find those time frames useful.
The safety rules for each lock are written down in the documents that define the locks. This one just tells you to read them.