Use of The RSA-KEM Key Transport Algorithm in CMS
Use of The RSA-KEM Key Transport Algorithm in CMS
Use of The RSA-KEM Key Transport Algorithm in CMS
1 Introduction
The RSA-KEM Key Transport Algorithm is a one-pass (store-and-forward) mechanism
for transporting keying data to a recipient using the recipient's RSA public key. Most
previous key transport algorithms based on the RSA public-key cryptosystem (e.g., the
popular PKCS #1 v1.5 algorithm [PKCS1]) have the following general form:
c = me mod n
The RSA-KEM Key Transport Algorithm takes a different approach that provides higher
security assurance, by encrypting a _random_ integer with the recipient's public key,
and using a symmetric key-wrapping scheme to encrypt the keying data. It has the
following form:
c = ze mod n.
4. Wrap the keying data using KEK to obtain wrapped keying data
WK.
This different approach provides higher security assurance because the input to the
underlying RSA operation is random and independent of the message, and the key-
encrypting key KEK is derived from it in a strong way. As a result, the algorithm enjoys a
"tight" security proof in the random oracle model. It is also architecturally convenient
because the public-key operations are separate from the symmetric operations on the
keying data. One benefit is that the length of the keying data is bounded only by the
symmetric key-wrapping scheme, not the size of the RSA modulus.
The RSA-KEM Key Transport Algorithm in various forms is being adopted in several
draft standards including the draft ANS X9.44 [ANS-X9.44] and ISO/IEC 18033-2. It has
also been recommended by the NESSIE project [NESSIE]. For completeness, a
specification of the algorithm is given in Appendix A of this document; ASN.1 syntax is
given in Appendix B.
NOTE: The term KEM stands for "key encapsulation mechanism" and refers to the first
three steps of the process above. The formalization of key transport algorithms (or more
generally, asymmetric encryption schemes) in terms of key encapsulation mechanisms
is described further in research by Victor Shoup leading to the development of the
ISO/IEC 18033-2 standard [SHOUP].
2 Use in CMS
The RSA-KEM Key Transport Algorithm MAY be employed for one or more recipients
in the CMS enveloped-data content type (Section 6 of [CMS]), where the keying data
processed by the algorithm is the CMS content-encryption key.
The RSA-KEM Key Transport Algorithm SHOULD be considered for new CMS-based
applications as a replacement for the widely implemented RSA encryption algorithm
specified originally in PKCS #1 v1.5 (see [PKCS1] and Section 4.2.1 of [CMSALGS]),
which is vulnerable to chosen-ciphertext attacks. The RSAES-OAEP Key Transport
Algorithm has also been proposed as a replacement (see [PKCS1] and [CMS-OAEP]).
RSA-KEM has the advantage over RSAES-OAEP of a tighter security proof, but the
disadvantage of slightly longer encrypted keying data.
Underlying Components
A CMS implementation that supports the RSA-KEM Key Transport Algorithm MUST
support at least the following underlying components:
* For the key derivation function, KDF2 or KDF3 (see [ANS-X9.44] [IEEE-P1363a])
based on SHA-1 (see [FIPS-180-2]) (this function is also specified as the key derivation
function in [ANS-X9.63])
* For the key-wrapping scheme, AES-Wrap-128, i.e., the AES Key Wrap with a
128-bit key encrypting key (see [AES-WRAP])
An implementation SHOULD also support KDF2 and KDF3 based on SHA-256 (see
[FIPS-180-2]), the Triple-DES Key Wrap (see [3DES-WRAP]) and the Camillia key wrap
algorithm (see [Camillia]). It MAY support other underlying components. When AES or
Camilla are used the data block size is 128 bits while the key size can be 128, 192, or
256 bits while Triple DES requires a data block size of 64 bits and a key size of 112 or
168 bits.
RecipientInfo Conventions
When the RSA-KEM Key Transport Algorithm is employed for a recipient, the
RecipientInfo alternative for that recipient MUST be KeyTransRecipientInfo. The
algorithm-specific fields of the KeyTransRecipientInfo value MUST have the following
values:
* encryptedKey MUST be the encrypted keying data output by the algorithm, where
the keying data is the content-encryption key. (see Appendix A)
Certificate Conventions
A recipient who employs the RSA-KEM Key Transport Algorithm MAY identify the public
key in a certificate by the same AlgorithmIdentifier as for the PKCS #1 v1.5 algorithm,
i.e., using the rsaEncryption object identifier [PKCS1].
If the recipient wishes only to employ the RSA-KEM Key Transport Algorithm with a
given public key, the recipient MUST identify the public key in the certificate using the
id-ac-generic-hybrid object identifier (see Appendix B) where the associated
GenericHybridParameters value indicates the underlying components with which the
algorithm is to be employed. The certificate user MUST perform the RSA-KEM Key
Transport algorithm using only those components.
Regardless of the AlgorithmIdentifier used, the RSA public key is encoded in the same
manner in the subject public key information. The RSA public key MUST be encoded
using the type RSAPublicKey type:
Here, the modulus is the modulus n, and publicExponent is the public exponent e. The
DER encoded RSAPublicKey is carried in the subjectPublicKey BIT STRING within the
subject public key information.
The intended application for the key MAY be indicated in the key usage certificate
extension. If the keyUsage extension is present in a certificate that conveys an RSA
public key with the id-ac-generic-hybrid object identifier as discussed above, then the
key usage extension MUST contain the following value:
keyEncipherment.
IETF RFC 2633 [MSG], Section 2.5.2 defines the SMIMECapabilities signed attribute
(defined as a SEQUENCE of SMIMECapability SEQUENCEs) to be used to specify a
partial list of algorithms that the software announcing the SMIMECapabilities can
support. When constructing a signedData object, compliant software MAY include the
SMIMECapabilities signed attribute announcing that it supports the RSA-KEM Key
Transport algorithm.
Security Considerations
The security of the RSA-KEM Key Transport Algorithm described in this document can
be shown to be tightly related to the difficulty of either solving the RSA problem or
breaking the underlying symmetric key-wrapping scheme, if the underlying key
derivation function is modeled as a random oracle, and assuming that the symmetric
key-wrapping scheme satisfies the properties of a data encapsulation mechanism
[SHOUP]. While in practice a random-oracle result does not provide an actual security
proof for any particular key derivation function, the result does provide assurance that
the general construction is reasonable; a key derivation function would need to be
particularly weak to lead to an attack that is not possible in the random oracle model.
The RSA key size and the underlying components should be selected consistent with
the desired symmetric security level for an application. Several security levels have
been identified in [NIST FIPS PUB 800-57]. For brevity, the first three levels are
mentioned here:
* 80-bit security. The RSA key size SHOULD be at least 1024 bits,
the hash function underlying the KDF SHOULD be SHA-1 or above,
and the symmetric key-wrapping scheme SHOULD be AES Key Wrap,
Triple-DES Key Wrap, or Camillia Key Wrap.
Note that the AES Key Wrap or Camillia Key Wrap MAY be used at all three of these
levels; the use of AES or Camillia does not require a 128-bit security level for other
components.
Implementations MUST protect the RSA private key and the content-encryption key.
Compromise of the RSA private key may result in the disclosure of all messages
protected with that key. Compromise of the content-encryption key may result in
disclosure of the associated encrypted content.
The security of the algorithm also depends on the strength of the random number
generator, which SHOULD have a comparable security level. For further discussion on
random number generation, please see [RANDOM].
Generally, good cryptographic practice employs a given RSA 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. While
RSA public keys have often been employed for multiple purposes such as key transport
and digital signature without any known bad interactions, for increased security
assurance, such combined use of an RSA key pair is NOT RECOMMENDED in the
future (unless the different schemes are specifically designed to be used together).
Accordingly, an RSA key pair used for the RSA-KEM Key Transport Algorithm SHOULD
NOT also be used for digital signatures. (Indeed, ASC X9 requires such a separation
between key establishment key pairs and digital signature key pairs.) Continuing this
principle of key separation, a key pair used for the RSA-KEM Key Transport Algorithm
SHOULD NOT be used with other key establishment schemes, or for data encryption,
or with more than one set of underlying algorithm components.
Parties MAY formalize the assurance that one another's implementations are correct
through implementation validation, e.g. NIST's Cryptographic Module Validation
Program (CMVP).
References
Normative References
CAMILLIA Kato, A., Moriai, S., and Kanda, M.: The Camellia
Cipher Algorithm and Its Use With IPsec. RFC 4312.
December 2005
Informative References
Appendix A.
RSA-KEM Key Transport Algorithm
The RSA-KEM Key Transport Algorithm is a one-pass (store-and-forward) mechanism
for transporting keying data to a recipient using the recipient's RSA public key.
With this type of algorithm, a sender encrypts the keying data using the recipient's
public key to obtain encrypted keying data. The recipient decrypts the encrypted keying
data using the recipient's private key to recover the keying data.
Underlying Components
Let (n,e) be the recipient's RSA public key (see [PKCS1] for details) and let K be the
keying data to be transported.
Let nLen denote the length in bytes of the modulus n, i.e., the least integer such that
2^{8*nLen} > n.
c = z^e mod n
C = IntegerToString (c, nLen)
4. Wrap the keying data K with the key-encrypting key KEK using
the underlying key-wrapping scheme to obtain wrapped keying
data WK:
WK = Wrap (KEK, K)
EK = C || WK
Let (n,d) be the recipient's RSA private key (see [PKCS1]; other private key formats are
allowed) and let EK be the encrypted keying data.
C || WK = EK
c = StringToInteger (C)
z = c^d mod n
NOTE: Implementations SHOULD NOT reveal information about the integer z and the
string Z, nor about the calculation of the exponentiation in Step 2, the conversion in
Step 3, or the key derivation in Step 4, whether by timing or other "side channels". The
observable behavior of the implementation SHOULD be the same at these steps for all
ciphertexts C that are in range. (For example, IntegerToString conversion should take
the same amount of time regardless of the actual value of the integer z.) The integer z,
the string Z and other intermediate results MUST be securely deleted when they are no
longer needed.