Showing content from https://www.rfc-editor.org/rfc/rfc9688.xml below:
Introduction The Cryptographic Message Syntax (CMS) is used to digitally sign, digest, authenticate, or encrypt arbitrary message contents. This specification describes the use of the four one-way hash functions in the SHA3 family (SHA3-224, SHA3-256, SHA3-384, and SHA3-512) with the CMS. In addition, this specification describes the use of these four one-way hash functions with the RSASSA PKCS#1 version 1.5 signature algorithm and the Elliptic Curve Digital Signature Algorithm (ECDSA) with the CMS signed-data content type. This document should not be confused with , which defines conventions for using the SHAKE family of SHA3-based extensible output functions with the CMS. ASN.1 CMS values are generated with ASN.1 , using the Basic Encoding Rules (BER) and the Distinguished Encoding Rules (DER) . 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 BCP 14 when, and only when, they appear in all capitals, as shown here. Message Digest Algorithms One-way hash functions are also referred to as message digest algorithms. This section specifies the conventions employed by CMS implementations that support SHA3-224, SHA3-256, SHA3-384, and SHA3-512 . Digest algorithm identifiers are located in the SignedData digestAlgorithms field, the SignerInfo digestAlgorithm field, the DigestedData digestAlgorithm field, and the AuthenticatedData digestAlgorithm field. Digest values are located in the DigestedData digest field and the Message Digest authenticated attribute. In addition, digest values are input to signature algorithms. SHA3-224, SHA3-256, SHA3-384, and SHA3-512 produce output values with 224, 256, 384, and 512 bits, respectively. The object identifiers for these four one-way hash functions are as follows: hashAlgs OBJECT IDENTIFIER ::= { joint-iso-itu-t(2) country(16) us(840) organization(1) gov(101) csor(3) nistAlgorithm(4) 2 } id-sha3-224 OBJECT IDENTIFIER ::= { hashAlgs 7 } id-sha3-256 OBJECT IDENTIFIER ::= { hashAlgs 8 } id-sha3-384 OBJECT IDENTIFIER ::= { hashAlgs 9 } id-sha3-512 OBJECT IDENTIFIER ::= { hashAlgs 10 } When using the id-sha3-224, id-sha3-s256, id-sha3-384, or id-sha3-512 algorithm identifiers, the parameters field MUST be absent, not NULL but absent. Signature Algorithms This section specifies the conventions employed by CMS implementations that support the four SHA3 one-way hash functions with the RSASSA PKCS#1 v1.5 signature algorithm and the ECDSA with the CMS signed-data content type. Signature algorithm identifiers are located in the SignerInfo signatureAlgorithm field of SignedData. Also, signature algorithm identifiers are located in the SignerInfo signatureAlgorithm field of countersignature attributes. Signature values are located in the SignerInfo signature field of SignedData. Also, signature values are located in the SignerInfo signature field of countersignature attributes. RSASSA PKCS#1 v1.5 with SHA3 The RSASSA PKCS#1 v1.5 is defined in . When RSASSA PKCS#1 v1.5 is used in conjunction with one of the SHA3 one-way hash functions, the object identifiers are: OID ::= OBJECT IDENTIFIER sigAlgs OBJECT IDENTIFIER ::= { joint-iso-itu-t(2) country(16) us(840) organization(1) gov(101) csor(3) nistAlgorithm(4) 3 } id-rsassa-pkcs1-v1-5-with-sha3-224 OID ::= { sigAlgs 13 } id-rsassa-pkcs1-v1-5-with-sha3-256 OID ::= { sigAlgs 14 } id-rsassa-pkcs1-v1-5-with-sha3-384 OID ::= { sigAlgs 15 } id-rsassa-pkcs1-v1-5-with-sha3-512 OID ::= { sigAlgs 16 } The algorithm identifier for RSASSA PKCS#1 v1.5 subject public keys in certificates is specified in , and it is repeated here for convenience: rsaEncryption OBJECT IDENTIFIER ::= { iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) pkcs-1(1) 1 } When the rsaEncryption, id-rsassa-pkcs1-v1-5-with-sha3-224, id-rsassa-pkcs1-v1-5-with-sha3-256, id-rsassa-pkcs1-v1-5-with-sha3-384, and id-rsassa-pkcs1-v1-5-with-sha3-512 algorithm identifiers are used, the AlgorithmIdentifier parameters field MUST contain NULL. When the rsaEncryption algorithm identifier is used, the RSA public key, which is composed of a modulus and a public exponent, MUST be encoded using the RSAPublicKey type as specified in . The output of this encoding is carried in the certificate subject public key. The definition of RSAPublicKey is repeated here for convenience: RSAPublicKey ::= SEQUENCE { modulus INTEGER, -- n publicExponent INTEGER } -- e When signing, the RSASSA PKCS#1 v1.5 signature algorithm generates a single value. That value is used directly as the signature value. ECDSA with SHA3 The ECDSA is defined in . When the ECDSA is used in conjunction with one of the SHA3 one-way hash functions, the object identifiers are: sigAlgs OBJECT IDENTIFIER ::= { joint-iso-itu-t(2) country(16) us(840) organization(1) gov(101) csor(3) nistAlgorithm(4) 3 } id-ecdsa-with-sha3-224 OBJECT IDENTIFIER ::= { sigAlgs 9 } id-ecdsa-with-sha3-256 OBJECT IDENTIFIER ::= { sigAlgs 10 } id-ecdsa-with-sha3-384 OBJECT IDENTIFIER ::= { sigAlgs 11 } id-ecdsa-with-sha3-512 OBJECT IDENTIFIER ::= { sigAlgs 12 } When the id-sha3-224, id-sha3-s256, id-sha3-384, or id-sha3-512 algorithm identifier is used, the parameters field MUST be absent, not NULL but absent. When the id-ecdsa-with-sha3-224, id-ecdsa-with-sha3-256, id- ecdsa-with-sha3-384, and id-ecdsa-with-sha3-512 algorithm identifiers are used, the parameters field MUST be absent, not NULL but absent. The conventions for ECDSA public keys are as specified in . The ECParameters associated with the ECDSA public key in the signers certificate SHALL apply to the verification of the signature. When signing, the ECDSA algorithm generates two values. These values are commonly referred to as r and s. To easily transfer these two values as one signature, they MUST be ASN.1 encoded using the ECDSA-Sig-Value defined in , which is repeated here for convenience: ECDSA-Sig-Value ::= SEQUENCE { r INTEGER, s INTEGER } Message Authentication Codes Using HMAC and SHA3 This section specifies the conventions employed by CMS implementations that support the Hashed Message Authentication Code (HMAC) with SHA3 message authentication code (MAC). MAC algorithm identifiers are located in the AuthenticatedData macAlgorithm field. MAC values are located in the AuthenticatedData mac field. When HMAC is used in conjunction with one of the SHA3 one-way hash functions, the object identifiers are: hashAlgs OBJECT IDENTIFIER ::= { joint-iso-itu-t(2) country(16) us(840) organization(1) gov(101) csor(3) nistAlgorithm(4) 2 } id-hmacWithSHA3-224 OBJECT IDENTIFIER ::= { hashAlgs 13 } id-hmacWithSHA3-256 OBJECT IDENTIFIER ::= { hashAlgs 14 } id-hmacWithSHA3-384 OBJECT IDENTIFIER ::= { hashAlgs 15 } id-hmacWithSHA3-512 OBJECT IDENTIFIER ::= { hashAlgs 16 } When the id-hmacWithSHA3-224, id-hmacWithSHA3-256, id-hmacWithSHA3-384, and id-hmacWithSHA3-512 algorithm identifiers are used, the parameters field MUST be absent, not NULL but absent. Key Derivation Functions The CMS KEMRecipientInfo structure is one place where algorithm identifiers for key-derivation functions are needed. HKDF with SHA3 This section assigns four algorithm identifiers that can be employed by CMS implementations that support the HMAC-based Extract-and-Expand Key Derivation Function (HKDF) with the SHA3 family of hash functions. When HKDF is used in conjunction with one of the SHA3 one-way hash functions, the object identifiers are: id-alg OBJECT IDENTIFIER ::= { iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) pkcs-9(9) smime(16) 3 } id-alg-hkdf-with-sha3-224 OBJECT IDENTIFIER ::= { id-alg 32 } id-alg-hkdf-with-sha3-256 OBJECT IDENTIFIER ::= { id-alg 33 } id-alg-hkdf-with-sha3-384 OBJECT IDENTIFIER ::= { id-alg 34 } id-alg-hkdf-with-sha3-512 OBJECT IDENTIFIER ::= { id-alg 35 } When id-alg-hkdf-with-sha3-224, id-alg-hkdf-with-sha3-256, id-alg-hkdf-with-sha3-384, or id-alg-hkdf-with-sha3-512 is used in an algorithm identifier, the parameters field MUST be absent, not NULL but absent. KMAC128-KDF and KMAC256-KDF This section specifies the conventions employed by CMS implementations that employ either KMAC128 or KMAC256 as KDFs as defined in Section 4.4 of . KMAC128 and KMAC256 are specified in . The use of KMAC128 and KMAC256 as KDFs are defined as follows: KMAC128-KDF is KMAC128(K, X, L, S). KMAC256-KDF is KMAC256(K, X, L, S). The parameters to the KMAC128 and KMAC256 functions are:
-
K
-
The input key-derivation key. The length of K MUST be less than 2 2040.
-
X
-
The context, which contains the ASN.1 DER encoding of CMSORIforKEMOtherInfo when the KDF is used with .
-
L
-
The output length in bits. L MUST be greater than or equal to 0 and MUST be less than 2 2040.
-
S
-
The optional customization label, such as "KDF" (0x4B4446). The length of S MUST be less than 2 2040.
The K parameter is known to all authorized parties; it is often the output of a KEM Decap() operation. The X parameter is assembled from data that is transmitted by the originator. The L parameter is determined by the size of the output keying material. The S parameter is optional, and if it is provided by the originator, it is passed in the parameters field of the KDF algorithm identifier. When KMAC128-KDF or KMAC256-KDF is used, the object identifiers are: hashAlgs OBJECT IDENTIFIER ::= { joint-iso-itu-t(2) country(16) us(840) organization(1) gov(101) csor(3) nistAlgorithm(4) 2 } id-kmac128 OBJECT IDENTIFIER ::= { hashAlgs 21 } id-kmac256 OBJECT IDENTIFIER ::= { hashAlgs 22 } When id-kmac128 or id-kmac256 is used as part of an algorithm identifier, the parameters field MUST be absent when there is no customization label (S). If any value is provided for S, then the parameters field MUST be present and contain the value of S, encoded as Customization. Customization ::= OCTET STRING KDF2 and KDF3 with SHA3 This section specifies the conventions employed by CMS implementations that employ either the KDF2 or KDF3 functions defined in . The CMS KEMRecipientInfo structure is one place where algorithm identifiers for key-derivation functions are needed. The key-derivation function algorithm identifier is an object identifier and optional parameters. When KDF2 and KDF3 are used, they are identified by the id-kdf-kdf2 and id-kdf-kdf3 object identifiers, respectively. The key-derivation function algorithm identifier parameters carry a message digest algorithm identifier, which indicates the hash function that is being employed. To support SHA3, the key-derivation function algorithm identifier parameters contain an algorithm identifier from . x9-44 OBJECT IDENTIFIER ::= { iso(1) identified-organization(3) tc68(133) country(16) x9(840) x9Standards(9) x9-44(44) } x9-44-components OBJECT IDENTIFIER ::= { x9-44 components(1) } id-kdf-kdf2 OBJECT IDENTIFIER ::= { x9-44-components kdf2(1) } id-kdf-kdf3 OBJECT IDENTIFIER ::= { x9-44-components kdf3(2) } Security Considerations Implementations must protect the signer's private key. Compromise of the signer's private key permits masquerade. Implementations must protect the key-derivation key. Compromise of the key-derivation key permits others to derive the derived keying material, which would result in loss of confidentiality, integrity, or authentication, depending on the use of the derived keying material. When more than two parties share the same message-authentication key, data origin authentication is not assured. Any party that knows the message-authentication key can compute a valid MAC; therefore, the content could originate from any one of the parties. Implementations must randomly generate message-authentication keys and one-time values, such as the a per-message secret number (called the k value) when generating an ECDSA signature. In addition, the generation of public/private key pairs relies on a random numbers. The use of inadequate pseudorandom number generators (PRNGs) to generate cryptographic values can result in little or no security. Instead of brute-force searching the whole key space, an attacker may find it much easier to reproduce the PRNG environment that produced the keys and then search the resulting small set of possibilities. The generation of quality random numbers is difficult. offers important guidance in this area, and Appendix 3 of FIPS PUB 186-4 provides some PRNG techniques. Implementers should be aware that cryptographic algorithms become weaker with time. As new cryptanalysis techniques are developed and computing performance improves, the work factor to break a particular cryptographic algorithm will reduce. Therefore, cryptographic algorithm implementations should be modular, allowing new algorithms to be readily inserted. That is, implementers should be prepared to regularly update the set of algorithms in their implementations. IANA Considerations IANA has assigned one object identifier for the ASN.1 module in in the "SMI Security for S/MIME Module Identifiers (1.2.840.113549.1.9.16.0)" registry : id-mod-sha3-oids-2023 OBJECT IDENTIFIER ::= { iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) pkcs-9(9) smime(16) mod(0) 78 } IANA has assigned four object identifiers for the HKDF using SHA3 algorithm identifiers in the "SMI Security for S/MIME Algorithms (1.2.840.113549.1.9.16.3)" registry : id-alg-hkdf-with-sha3-224 OBJECT IDENTIFIER ::= { id-alg 32 } id-alg-hkdf-with-sha3-256 OBJECT IDENTIFIER ::= { id-alg 33 } id-alg-hkdf-with-sha3-384 OBJECT IDENTIFIER ::= { id-alg 34 } id-alg-hkdf-with-sha3-512 OBJECT IDENTIFIER ::= { id-alg 35 }
RetroSearch is an open source project built by @garambo
| Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4