COSE Working Group | J. Schaad |
Internet-Draft | August Cellars |
Intended status: Informational | March 21, 2016 |
Expires: September 22, 2016 |
CBOR Encoded Message Syntax: Additional Algorithms
draft-schaad-cose-alg-01
This document defines the identifiers and usage for a set of additional cryptographic algorithms in the CBOR Encoded Message (COSE) Syntax.
The algorithms setup in this docment are: RSA-PSS, RSA-OAEP, .... !!TBD!!
The source for this draft is being maintained in GitHub. Suggested changes should be submitted as pull requests at <https://github.com/cose-wg/cose-algs>. Instructions are on that page as well. Editorial changes can be managed in GitHub, but any substantial issues need to be discussed on the COSE mailing list.
This Internet-Draft is submitted in full conformance with the provisions of BCP 78 and BCP 79.
Internet-Drafts are working documents of the Internet Engineering Task Force (IETF). Note that other groups may also distribute working documents as Internet-Drafts. The list of current Internet-Drafts is at http://datatracker.ietf.org/drafts/current/.
Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress."
This Internet-Draft will expire on September 22, 2016.
Copyright (c) 2016 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.
In the process of writing RFCXXXX [I-D.ietf-cose-msg] several algorithms were removed from that document to be addressed at a later date. This document deals with a large set of the cryptographic algorithms which were removed at that time.
This document provides the necessary conventions needed to use the algorithms defined in this document. This document additionally provides the necessary registration in the appropriate IANA registry tables.
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].
When the words appear in lower case, their natural language meaning is used.
In this document we use the following terminology: [CREF1]JLS: I have not gone through the document to determine what needs to be here yet. We mostly want to grab terms which are used in unusual ways or are not generally understood.
This document defines two new signature algorithms: RSA-PSS and Edwards Curve Digital Signature Algorithm (EdDSA). Both of these signature algorithms are Signature Scheme with Appendix algorithms. (For a discussion on the difference between signature scheme with appendix and signature scheme with message recovery algorithms, see [I-D.ietf-cose-msg].)
The RSASSA-PSS signature algorithm is defined in [RFC3447].
The RSASSA-PSS signature algorithm is parametized with a hash function (h), a mask generation function (mgf) and a salt length (sLen). For this specification, the mask generation function is fixed to be MGF1 as defined in [RFC3447]. It has been recommended that the same hash function be used for hashing the data as well as in the mask generation function, for this specification we following this recommendation. The salt length is the same length as the hash function output.
Implementations need to check that the key type is 'RSA' when creating or verifying a signature.
The algorithms defined in this document can be found in Table 1.
name | value | hash | salt length | description |
---|---|---|---|---|
PS256 | TBD1 | SHA-256 | 32 | RSASSA-PSS w/ SHA-256 |
PS384 | TBD2 | SHA-384 | 48 | RSASSA-PSS w/ SHA-384 |
PS512 | TBD3 | SHA-512 | 64 | RSASSA-PSS w/ SHA-512 |
In addition to needing to worry about keys that are too small to provide the required security, there are issues with keys that are too large. Denial of service attacks have been mounted with overly large keys. This has the potential to consume resources with potentially bad keys. There are two reasonable ways to address this attack. First, a key should not be used for a cryptographic operation until it has been matched back to an authorized user. This approach means that no cryptography would be done except for authorized users. Second, applications can impose maximum as well as minimum length requirements on keys. This limits the resources consumed even if the matching is not performed until the cryptography has been done.
There is a theoretical hash substitution attack that can be mounted against RSASSA-PSS. However, the requirement that the same hash function be used consistently for all operations is an effective mitigation against it. Unlike ECDSA, hash functions are not truncated so that the full hash value is always signed. The internal padding structure of RSASSA-PSS means that one needs to have multiple collisions between the two hash functions in order to be successful in producing a forgery based on changing the hash function. This is highly unlikely.
[I-D.irtf-cfrg-eddsa] describes the elliptic curve signature scheme Edwards-curve Digital Signature Algorithm (EdDSA). In that document, the signature algorithm is instantiated using parameters for edwards25519 and edwards448 curves. The document additionally describes two variants of the EdDSA algorithm: Pure EdDSA, where no hash function is applied to the content before signing and, HashEdDSA where a hash function is applied to the content before signing and the result of that hash function is signed. For use with COSE, on the pure EdDSA version is used. This is because it is not expected that extremely large contents are going to be needed and, based on the arrangement of the message structure, the entire message is going to need to be held in memory in order to create or verify a signature. Thus, the use of an incremental update process would not be useful. Applications can provide the same features by defining the content of the message as a hash value and transporting the COSE message and the content as separate items.
The algorithms defined in this document can be found in Table 2. A single signature algorithm is defined which can be used for multiple curves.
name | value | description |
---|---|---|
EdDSA | * | EdDSA |
[I-D.irtf-cfrg-eddsa] describes the method of encoding the signature value.
When using a COSE key for this algorithm the following checks are made:
This document defines no new Message Authentication Code algorithms.
This document defines no new content inception algorithms.
This document defines new new key derivation functions.
RSAES-OAEP is an asymmetric key encryption algorithm. The defintion of RSAEA-OAEP can be find in Section 7.1 of [RFC3447]. The algorithm is parameterized using a masking generation function (mgf), a hash function (h) and encoding parameters (P). For the algorithm identifiers defined in this section: Table 3 summarizes the rest of the values.
name | value | hash | description |
---|---|---|---|
RSAES-OAEP w/SHA-256 | -25 | SHA-256 | RSAES OAEP w/ SHA-256 |
RSAES-OAEP w/SHA-512 | -26 | SHA-512 | RSAES OAEP w/ SHA-512 |
The key type MUST be 'RSA'.
A key size of 2048 bits or larger MUST be used with these algorithms. This key size corresponds roughly to the same strength as provided by a 128-bit symmetric encryption algorithm.
It is highly recommended that checks on the key length be done before starting a decryption operation. One potential denial of service operation is to provide encrypted objects using either abnormally long or oddly sized RSA modulus values. Implementations SHOULD be able to encrypt and decrypt with modulus between 2048 and 16K bits in length. Applications can impose additional restrictions on the length of the modulus.
The algorithm ECDH is defined for use in COSE in [I-D.ietf-cose-msg]. In this document the algorithm is extended to be used with the two curves defined in [I-D.irtf-cfrg-curves].
The following updates [I-D.ietf-cose-msg] sections 12.4.1 and 12.5.1.
All the rest of the checks remain the same.
The COSE_Key object defines a way to hold a single key object, it is still required that the members of individual key types be defined. This section of the document is where we define an initial set of members for specific key types.
For each of the key types, we define both public and private members. The public members are what is transmitted to others for their usage. We define private members mainly for the purpose of archival of keys by individuals. However, there are some circumstances where private keys may be distributed by various entities in a protocol. Examples include: Entities which have poor random number generation. Centralized key creation for multi-cast type operations. Protocols where a shared secret is used as a bearer token for authorization purposes.
Key types are identified by the 'kty' member of the COSE_Key object. In this document we define four values for the member.
name | value | description |
---|---|---|
OPK | TBDXX | Octet Key Pair |
RSA | TBDXX1 | RSA Keys |
A new key type is defined for Octet Key Pairs (OKP). Do not assume that keys using this type are elliptic curves. This key type could be used for other curve types (for example mathematics based on hyper-elliptic surfaces).
The key parameters defined in this section are summarized in Table 5. The members that are defined for this key type are:
For public keys, it is REQUIRED that 'crv' and 'x' be present in the structure. For private keys, it is REQUIRED that 'crv' and 'd' be present in the structure. For private keys, it is RECOMMENDED that 'x' also be present, but it can be recomputed from the required elements and omitting it saves on space.
name | key type | value | type | description |
---|---|---|---|---|
crv | 1 | -1 | int / tstr | EC Curve identifier - Taken from the COSE General Registry |
x | 1 | -2 | bstr | X Coordinate |
d | 1 | -4 | bstr | Private key |
name | key type | value | description |
---|---|---|---|
Curve25519 | EC1 | TBDYY1 | Curve 25519 |
Curve448 | EC1 | TBDYY2 | Curve 448 |
This document defines a key structure for both the public and private halves of RSA keys. Together, an RSA public key and an RSA private key form an RSA key pair. [CREF3]JLS: Looking at the CBOR specification, the bstr that we are looking in our table below should most likely be specified as big numbers rather than as binary strings. This means that we would use the tag 6.2 instead. From my reading of the specification, there is no difference in the encoded size of the resulting output. The specification of bignum does explicitly allow for integers encoded with leading zeros.
The document also provides support for the so-called "multi-prime" RSA where the modulus may have more than two prime factors. The benefit of multi-prime RSA is lower computational cost for the decryption and signature primitives. For a discussion on how multi-prime affects the security of RSA crypto-systems, the reader is referred to [MultiPrimeRSA].
This document follows the naming convention of [RFC3447] for the naming of the fields of an RSA public or private key. The table Table 7 provides a summary of the label values and the types associated with each of those labels. The requirements for fields for RSA keys are as follows:
name | key type | value | type | description |
---|---|---|---|---|
n | 3 | -1 | bstr | Modulus Parameter |
e | 3 | -2 | int | Exponent Parameter |
d | 3 | -3 | bstr | Private Exponent Parameter |
p | 3 | -4 | bstr | First Prime Factor |
q | 3 | -5 | bstr | Second Prime Factor |
dP | 3 | -6 | bstr | First Factor CRT Exponent |
dQ | 3 | -7 | bstr | Second Factor CRT Exponent |
qInv | 3 | -8 | bstr | First CRT Coefficient |
other | 3 | -9 | array | Other Primes Info |
r_i | 3 | -10 | bstr | i-th factor, Prime Factor |
d_i | 3 | -11 | bstr | i-th factor, Factor CRT Exponent |
t_i | 3 | -12 | bstr | i-th factor, Factor CRT Coefficient |
There are currently no registration requests here
TBD
TBD
There are currently no registration tasks inthis section.
It is requested that IANA create a new registry “COSE Key Type Parameters”.
The columns of the table are:
This registry will be initially populated by the values in Table 5, and Table 7. The specification column for all of these entries will be this document.
It is requested that IANA create a new registry “COSE Elliptic Curve Parameters”.
The columns of the table are:
This registry will be initially populated by the values in Table 4. The specification column for all of these entries will be this document.
There are security considerations:
[RFC2119] | Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, DOI 10.17487/RFC2119, March 1997. |
[RFC7049] | Bormann, C. and P. Hoffman, "Concise Binary Object Representation (CBOR)", RFC 7049, DOI 10.17487/RFC7049, October 2013. |