RFC 5959
Algorithms for Asymmetric Key Package Content Type
π RFC 5959: Algorithms for Asymmetric Key Package Content Type π
Internet Engineering Task Force (IETF) πΈ Request for Comments: 5959 π Author: S. Turner (IECA) π Category: Standards Track β¨ Date: August 2010 π¦ ISSN: 2070-1721 π§
Abstract β¨
okay so this doc is all about which crypto algorithms to use with the EncryptedPrivateKeyInfo structure from RFC 5958 π. it also covers how to protect the AsymmetricKeyPackage content type when you wrap it in SignedData, EnvelopedData, EncryptedData, AuthenticatedData, and AuthEnvelopedData π«Ά
Status of This Memo π
this is an Internet Standards Track document π₯
it's a product of the Internet Engineering Task Force (IETF) π. it represents the consensus of the IETF community, got public review, and was approved for publication by the Internet Engineering Steering Group (IESG) π. if you want more on Internet Standards, check Section 2 of RFC 5741 π
info about the current status, errata, and how to send feedback lives at http://www.rfc-editor.org/info/rfc5959 π
Copyright Notice Β©οΈ
Copyright (c) 2010 IETF Trust and the persons identified as the document authors. All rights reserved. π
this doc is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (http://trustee.ietf.org/license-info) as of the publication date π. please read these carefully, because they spell out your rights and restrictions π. any Code Components pulled out of this document must include Simplified BSD License text as described in Section 4.e of the Trust Legal Provisions, and they come without warranty as described in the Simplified BSD License π«Ά
1. Introduction π·
okay so this doc is about using a bunch of crypto algorithms with the EncryptedPrivateKeyInfo structure [RFC5958] β¨. [P12] uses EncryptedPrivateKeyInfo to encrypt PrivateKeyInfo [RFC5958] π. it's kinda like EncryptedData [RFC5652] in that it has no recipients, no originators, and no content encryption keys, and it needs keys managed some other way π§
this doc also covers how to protect the AsymmetricKeyPackage content type [RFC5958] with Cryptographic Message Syntax (CMS) protecting content types: SignedData [RFC5652], EnvelopedData [RFC5652], EncryptedData [RFC5652], AuthenticatedData [RFC5652], and AuthEnvelopedData [RFC5083] π. implementations of AsymmetricKeyPackage don't need to support any CMS protecting content type πΈ. BUT if the AsymmetricKeyPackage is CMS protected, it is RECOMMENDED that the conventions defined here get followed π
this doc doesn't define any new algorithms. it just points at algorithms that already exist π¦
1.1. Terminology π
the key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document get interpreted as described in [RFC2119] π
2. EncryptedPrivateKeyInfo π
the de facto standard for encrypting the PrivateKeyInfo structure (which then goes into the encryptedData field of EncryptedPrivateKeyInfo) is Password Based Encryption (PBE) π. it's based on PKCS #5 [RFC2898] and PKCS #12 [P12] π
. the big difference between the two is the password encoding: PKCS #5 uses ASCII and PKCS #12 uses Unicode, encoded as specified in Section B.1 of [P12] β¨
[RFC2898] defines two PBE Schemes (PBES), 1 and 2, and it recommends PBES2 for new specs π§. PBES2 with a key derivation algorithm of PBKDF2 using HMAC with SHA-256 [RFC5754] and an encryption algorithm of AES Key Wrap with Padding as defined in [RFC5649] MUST be supported π₯. AES-256 Key Wrap with Padding [RFC5649] MAY also be supported as an encryption algorithm π
3. AsymmetricKeyPackage π
as noted in Asymmetric Key Packages [RFC5958], CMS can protect the AsymmetricKeyPackage π. this section gives guidance for SignedData [RFC5652], EnvelopedData [RFC5652], EncryptedData [RFC5652], AuthenticatedData [RFC5652], and AuthEnvelopedData [RFC5083] β¨
3.1. SignedData βοΈ
if an implementation supports SignedData, then it MUST support the signature scheme RSA [RFC3370] [RFC5754] π. it SHOULD support the signature schemes RSASSA-PSS [RFC4056] and DSA [RFC3370] [RFC5754] π«Ά. on top of that, implementations MUST support the hash function SHA-256 [RFC5754] alongside these signature schemes, and SHOULD support the hash function SHA-1 [RFC3370] π₯
3.2. 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 πΈ. RSAES-OAEP (RSA Encryption Scheme - Optimal Asymmetric Encryption Padding) [RFC3560] SHOULD be supported too π¦
when key agreement is used, Diffie-Hellman (DH) ephemeral-static [RFC3370] MUST be supported π§
the content type carries a cryptographic key plus its attributes, so this uses an algorithm that's normally used to encrypt one key with another π. no matter what key management technique you pick, implementations MUST support AES-128 Key Wrap with Padding [RFC5649] as the content encryption algorithm π . implementations SHOULD also support AES-256 Key Wrap with Padding [RFC5649] as the content encryption algorithm β¨
when key agreement is used, a key wrap algorithm also gets specified to wrap the content encryption key π. if the content encryption algorithm is AES-128 Key Wrap with Padding, then the key wrap algorithm MUST be AES-128 Key Wrap with Padding [RFC5649] π. if the content encryption algorithm is AES-256 Key Wrap with Padding, then the key wrap algorithm MUST be AES-256 Key Wrap with Padding [RFC5649] π«Ά
3.3. EncryptedData π
if an implementation supports EncryptedData, then it MUST implement AES-128 Key Wrap with Padding [RFC5649] and SHOULD implement AES-256 Key Wrap with Padding [RFC5649] π
NOTE: EncryptedData needs keys managed some other way π. that's why the only algorithm specified is the content encryption algorithm. the content type carries a cryptographic key and its attributes, so it uses an algorithm that's normally used to encrypt one key with another π
3.4. AuthenticatedData π‘οΈ
if an implementation supports AuthenticatedData, then it MUST implement SHA-256 [RFC5754] and SHOULD support SHA-1 [RFC3370] as the message digest algorithm π. HMAC with SHA-256 [RFC4231] MUST be supported too, and HMAC with SHA-1 [RFC3370] SHOULD be supported π₯
3.5. AuthEnvelopedData π
if an implementation supports AuthEnvelopedData, then it MUST implement the EnvelopedData recommendations, except for the content encryption algorithm π. here that algorithm 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] β¨
4. 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, DSS, RSAES-OAEP, or DH, then it MUST support key lengths from 1024-bit to 2048-bit, inclusive π
5. SMIMECapabilities Attribute π
[RFC5751] defines the SMIMECapabilities attribute as a way for recipients to say which capabilities they support, including the algorithms π . these are the values for the SMIMECapabilities attribute for AES Key Wrap with Padding [RFC5649] when it's used as a content encryption algorithm β¨
AES-128 KW with Padding: 30 0d 06 09 60 86 48 01 65 03 04 01 08
AES-192 KW with Padding: 30 0d 06 09 60 86 48 01 65 03 04 01 1C
AES-256 KW with Padding: 30 0d 06 09 60 86 48 01 65 03 04 01 30
6. Security Considerations π¨
okay this section is SERIOUS bestie π. the security considerations from [RFC3370], [RFC3560], [RFC4056], [RFC4231], [RFC5083], [RFC5084], [RFC5649], [RFC5652], [RFC5754], and [RFC5958] all apply π₯
the strength of any encryption scheme is only as good as its weakest link π. in the case of a PBES, that link is the password π. passwords need enough entropy that they can't be easily guessed π
the U.S. National Institute of Standards and Technology (NIST) Electronic Authentication Guidance [SP800-63] has some info on password entropy π. [SP800-63] says a user-chosen 20-character password from a 94-character keyboard with no checks gives 36 bits of entropy π« . if the 20-character password is randomly chosen, the entropy goes up to roughly 131 bits π₯. the entropy in a password doesn't map directly to bits of security, but in general the more the better π
the choice of content encryption algorithms for this doc was based on [RFC5649], which says: "In the design of some high assurance cryptographic modules, it is desirable to segregate cryptographic keying material from other data. The use of a specific cryptographic mechanism solely for the protection of cryptographic keying material can assist in this goal". πΈ unfortunately there's no AES-GCM or AES-CCM mode that gives the same properties π. if an AES-GCM or AES-CCM mode that gives the same properties ever gets defined, this doc will be updated to adopt it π¦
[SP800-57] gives comparable bits of security for some algorithms and key sizes π§. it also gives time frames in which certain numbers of bits of security are appropriate, and some environments may find those time frames useful β¨
7. References π
7.1. Normative References πβ¨
- [P12] RSA Laboratories, "PKCS #12 v1.0: Personal Information Exchange Syntax", June 1999. π
- [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, March 1997. π
- [RFC2898] Kaliski, B., "PKCS #5: Password-Based Cryptography Specification Version 2.0", RFC 2898, September 2000. π¦
- [RFC3370] Housley, R., "Cryptographic Message Syntax (CMS) Algorithms", RFC 3370, August 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. π
- [RFC4231] Nystrom, M., "Identifiers and Test Vectors for HMAC-SHA-224, HMAC-SHA-256, HMAC-SHA-384, and HMAC-SHA-512", RFC 4231, December 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. π
- [RFC5649] Housley, R. and M. Dworkin, "Advanced Encryption Standard (AES) Key Wrap with Padding Algorithm", RFC 5649, September 2009. π«Ά
- [RFC5652] Housley, R., "Cryptographic Message Syntax (CMS)", STD 70, RFC 5652, September 2009. π₯
- [RFC5751] Ramsdell, B. and S. Turner, "Secure/Multipurpose Internet Mail Extensions (S/MIME) Version 3.2 Message Specification", RFC 5751, January 2010. π
- [RFC5754] Turner, S., "Using SHA2 Algorithms with Cryptographic Message Syntax", RFC 5754, January 2010. β
- [RFC5958] Turner, S., "Asymmetric Key Packages", RFC 5958, August 2010. π
7.2. Informative References π
- [SP800-57] National Institute of Standards and Technology (NIST), Special Publication 800-57: Recommendation for Key Management - Part 1 (Revised), March 2007. π·
- [SP800-63] National Institute of Standards and Technology (NIST), Special Publication 800-63: Electronic Authentication Guidance, April 2006. π¦
Author's Address π
Sean Turner
IECA, Inc.
3057 Nutley Street, Suite 106
Fairfax, VA 22031
USA
EMail: turners@ieca.com
π¦ where this page comes from
- ietf: rfc5959 2010-08
- π girlified by claude-haiku-5-5 on : a language model's rewrite of the original, under its terms