Internet Engineering Task Force (IETF) S. Turner
Request for Comments: 5959 IECA
Category: Standards Track August 2010
ISSN: 2070-1721
Algorithms for Asymmetric Key Package Content Type
Turner Standards Track [Page 1]
RFC 5959 Algorithms for Asymmetric Key Packages August 2010 1. IntroductionThis document describes the conventions for using several cryptographic algorithms with the EncryptedPrivateKeyInfo structure [RFC5958]. The EncryptedPrivateKeyInfo is used by [P12] to encrypt PrivateKeyInfo [RFC5958]. It is similar to EncryptedData [RFC5652] in that it has no recipients, no originators, and no content encryption keys and requires keys to be managed by other means.
1.1. Terminology
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in [RFC2119].
2. EncryptedPrivateKeyInfo
The de facto standard used to encrypt the PrivateKeyInfo structure, which is subsequently placed in the EncryptedPrivateKeyInfo encryptedData field, is Password Based Encryption (PBE) based on PKCS #5 [RFC2898] and PKCS #12 [P12]. The major difference between PKCS #5 and PKCS #12 is the supported encoding for the password: ASCII for PKCS #5 and Unicode for PKCS #12, encoded as specified in Section B.1 of [P12]. [RFC2898] specifies two PBE Schemes (PBES) 1 and 2; [RFC2898] recommends PBES2 for new specification. 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 be used to protect the AsymmetricKeyPackage. The following provides guidance for SignedData [RFC5652], EnvelopedData [RFC5652], EncryptedData [RFC5652], AuthenticatedData [RFC5652], and AuthEnvelopedData [RFC5083].
Turner Standards Track [Page 2]
RFC 5959 Algorithms for Asymmetric Key Packages August 2010 3.1. SignedDataIf an implementation supports SignedData, then it MUST support the signature scheme RSA [RFC3370] [RFC5754] and SHOULD support the signature schemes RSASSA-PSS [RFC4056] and DSA [RFC3370] [RFC5754]. Additionally, implementations MUST support in concert with these signature schemes the hash function SHA-256 [RFC5754] 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.
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 requires that keys be managed by other means; therefore, the only algorithm specified is the content encryption algorithm. Since the content type is used to carry a cryptographic key and its attributes, an algorithm that is traditionally used to encrypt one key with another is employed.
Turner Standards Track [Page 3]
RFC 5959 Algorithms for Asymmetric Key Packages August 2010 3.4. AuthenticatedDataIf an implementation supports AuthenticatedData, then it MUST implement SHA-256 [RFC5754] and SHOULD support SHA-1 [RFC3370] as the message digest algorithm. Additionally, HMAC with SHA-256 [RFC4231] MUST be supported 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, 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 for AES-CCM [RFC5084].
4. Public Key Sizes
The easiest way to implement the SignedData, EnvelopedData, and AuthEnvelopedData is with public key certificates [RFC5280]. If an implementation support 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 mechanism for recipients to indicate their supported capabilities including the algorithms they support. The following are values for the SMIMECapabilities attribute for AES Key Wrap with Padding [RFC5649] when used as a content encryption algorithm:
6. Security Considerations
The security considerations from [RFC3370], [RFC3560], [RFC4056], [RFC4231], [RFC5083], [RFC5084], [RFC5649], [RFC5652], [RFC5754], and [RFC5958] apply. The strength of any encryption scheme is only as good as its weakest link, which in the case of a PBES is the password. Passwords need to provide sufficient entropy to ensure they cannot be easily guessed. The U.S. National Institute of Standards and Technology (NIST) Electronic Authentication Guidance [SP800-63] provides some information on password entropy. [SP800-63] indicates that a user- chosen 20-character password from a 94-character keyboard with no checks provides 36 bits of entropy. If the 20-character password is randomly chosen, then the amount of entropy is increased to roughly 131 bits of entropy. The amount of entropy in the password does not correlate directly to bits of security but in general the more than the better.
Turner Standards Track [Page 4]
RFC 5959 Algorithms for Asymmetric Key Packages August 2010
The choice of content encryption algorithms for this document was based on [RFC5649]: "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 is no AES-GCM or AES- CCM mode that provides the same properties. If an AES-GCM and AES- CCM mode that provides the same properties is defined, then this document will be updated to adopt that algorithm.7. References 7.1. Normative References[P12] RSA Laboratories, "PKCS #12 v1.0: Personal Information
Turner Standards Track [Page 5]
RFC 5959 Algorithms for Asymmetric Key Packages August 2010
[RFC4056] Schaad, J., "Use of the RSASSA-PSS Signature Algorithm in
7.2. Informative References
[SP800-57] National Institute of Standards and Technology (NIST),
Turner Standards Track [Page 6]
RFC 5959 Algorithms for Asymmetric Key Packages August 2010
Author's Address