RFC 4056

Use of the RSASSA-PSS Signature Algorithm in Cryptographic Message Syntax (CMS)

πŸ“… published June 2005, from ietf

RFC 4056 πŸ’– Use of the RSASSA-PSS Signature Algorithm in Cryptographic Message Syntax (CMS)

okay bestie, this is RFC 4056 πŸŽ€ It's a Standards Track doc from the Network Working Group, written by J. Schaad of Soaring Hawk Consulting, dated June 2005. The header doesn't list anything it obsoletes or updates, so there's no drama there πŸ’…

Status of This Memo ✨

okay so this document is an Internet standards track protocol for the Internet community, and it's asking everyone for discussion and suggestions for improvements πŸ¦‹ For the current standardization state and status, check the "Internet Official Protocol Standards" (STD 1). Distribution of this memo is unlimited, so share it with everyone 🌸

Copyright (C) The Internet Society (2005).

Abstract 🧚

this doc sets the rules for using the RSASSA-PSS (RSA Probabilistic Signature Scheme) digital signature algorithm with the Cryptographic Message Syntax (CMS) πŸ’œ

1. Overview ✨

okay so the main idea is that this document explains how to use the RSA Probabilistic Signature Scheme (RSASSA-PSS) [P1v2.1] digital signature algorithm with the Cryptographic Message Syntax [CMS] signed-data content type πŸ”₯

CMS values get generated using ASN.1 [X.208-88], with the Basic Encoding Rules (BER) [X.209-88] and the Distinguished Encoding Rules (DER) [X.509-88] πŸ“

this doc is meant to be used alongside RFC 4055 [RSA-ALGS] 🫢 All of the ASN.1 structures mentioned here are defined in RFC 4055, so go check there when you need them 🌈

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 RFC 2119 [STDWORDS] πŸ’…

1.1. PSS Algorithm πŸ’–

okay, no cap, PKCS #1 v1.5 [P1v1.5] signatures don't have any known defects 😭 But RSASSA-PSS [P1v2.1] was built to have more mathematically provable security. PKCS #1 v1.5 signatures were made in an ad hoc way, and RSASSA-PSS was built on mathematical foundations instead 🧠✨

2. Algorithm Identifiers and Parameters πŸŽ€

2.1. Certificate Identifiers πŸ¦‹

RSASSA-PSS is defined in RFC 3447 [P1v2.1], and the rules for encoding the public key are in RFC 4055 [RSA-ALGS] πŸ’œ

there are two algorithm identifiers for RSA subject public keys in certificates:

rsaEncryption OBJECT IDENTIFIER ::= { pkcs-1 1 }

and

id-RSASSA-PSS OBJECT IDENTIFIER ::= { pkcs-1 10 }

when the rsaEncryption algorithm identifier is used for a public key, the AlgorithmIdentifier parameters field MUST contain NULL. You can find all the details in [RSA-ALGS] 🌸

when the id-RSASSA-PSS algorithm identifier is used for a public key, the AlgorithmIdentifier parameters field MUST either be absent or contain RSASSA-PSS-params. Again, the full details live in [RSA-ALGS] ✨

in both cases, the RSA public key (a modulus plus a public exponent) MUST be encoded using the RSAPublicKey type πŸ‘‘ The output of that encoding is carried in the certificate subject public key 🫢

RSAPublicKey ::= SEQUENCE {
   modulus INTEGER, -- n
   publicExponent INTEGER } -- e

2.2. Signature Identifiers 🌈

the algorithm identifier for RSASAA-PSS signatures is:

id-RSASSA-PSS OBJECT IDENTIFIER ::= {pkcs-1 10 }

when the id-RSASSA-PSS algorithm identifier is used for a signature, the AlgorithmIdentifier parameters field MUST contain RSASSA-PSS-params. You can find info about RSASSA-PSS-params in [RSA-ALGS] πŸ”₯

when signing, the RSA algorithm generates a single value, and that value is used directly as the signature value πŸ’…

3. Signed-data Conventions 🌸

digestAlgorithms SHOULD contain the one-way hash function used to compute the message digest on the eContent value πŸ“

the same one-way hash function SHOULD be used for computing the message digest on both the eContent and the signedAttributes value if signedAttributes exist ✨

the same one-way hash function MUST be used for computing the message digest on the signedAttributes and as the hashAlgorithm in the RSA-PSS-params structure πŸ’–

signatureAlgorithm MUST contain id-RSASSA-PSS. The algorithm parameters field MUST contain RSASSA-PSS-params πŸŽ€

signature contains the single value that comes out of the signing operation πŸ¦‹

if the subjectPublicKeyInfo algorithm identifier for the public key in the certificate is id-RSASSA-PSS and the parameters field is present, then the following extra steps MUST be done as part of signature validation πŸ”₯

  1. The hashAlgorithm field in the certificate subjectPublicKey.algorithm parameters and the signatureAlgorithm parameters MUST be the same.
  2. The maskGenAlgorithm field in the certificate subjectPublicKey.algorithm parameters and the signatureAlgorithm parameters MUST be the same.
  3. The saltLength in the signatureAlgorithm parameters MUST be greater or equal to the saltLength in the certificate subjectPublicKey.algorithm parameters.
  4. The trailerField in the certificate subjectPublicKey.algorithm parameters and signatureAlgorithm parameters MUST be the same.

when you do those comparisons, default values count as the same as extant values πŸ’œ If any of the four steps above isn't true, the signature checking algorithm MUST fail validation πŸ’€

4. Security Considerations πŸ”₯

okay, this part is SERIOUS bestie 😭 Implementations must protect the RSA private key. If the RSA private key gets compromised, someone could forge signatures πŸ’€

generating an RSA private key relies on random numbers. Using inadequate pseudo-random number generators (PRNGs) to make these values can result in little or no security. An attacker may find it much easier to recreate the PRNG environment that produced the keys and search that small set of possibilities, instead of brute forcing the whole key space πŸ™ˆ Making quality random numbers is hard, and RFC 1750 [RANDOM] offers important guidance here 🧚

using the same private key for different algorithms has the potential to let an attacker get extra information about the key. It is strongly suggested that the same key not be used for both the PKCS #1 v1.5 and RSASSA-PSS signature algorithms 🚨

when computing signatures, the same hash function should be used for all operations. This cuts down on the number of failure points in the signature process ✨

the parameter checking procedures outlined in section 3 are super important πŸ‘‘ It's possible to forge signatures by changing these parameter values (especially to weaker values). Signers using this algorithm should take care that only one set of parameter values is used, because this lowers the chance of leaking information 🫢

5. Normative References πŸ’œ

[CMS] Housley, R., "Cryptographic Message Syntax (CMS)", RFC 3852, July 2004.

[P1v2.1] Jonsson, J. and B. Kaliski, "Public-Key Cryptography Standards (PKCS) #1: RSA Cryptography Specifications Version 2.1", RFC 3447, February 2003.

[RSA-ALGS] Schaad, J., Kaliski, B., and R. Housley, "Additional Algorithms and Identifiers for RSA Cryptography for use in the Internet X.509 Public Key Infrastructure Certificate and Certificate Revocation List (CRL) Profile", RFC 4055, June 2005.

[STDWORDS] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, March 1997.

[X.208-88] CCITT Recommendation X.208: Specification of Abstract Syntax Notation One (ASN.1), 1998.

[X.209-88] CCITT Recommendation X.209: Specification of Basic Encoding Rules for Abstract Syntax Notation One (ASN.1), 1988.

[X.509-88] CCITT Recommendation X.509: The Directory Authentication Framework, 1988.

6. Informative References 🌈

[P1v1.5] Kaliski, B., "PKCS #1: RSA Encryption Version 1.5", RFC 2313, March 1998.

[RANDOM] Eastlake 3rd, D., Crocker, S., and J. Schiller, "Randomness Recommendations for Security", RFC 1750, December 1994.

Author' Address πŸ¦‹

Jim Schaad Soaring Hawk Consulting PO Box 675 Gold Bar, WA 98251

EMail: jimsch@exmsft.com

Copyright (C) The Internet Society (2005).

This document is subject to the rights, licenses and restrictions contained in BCP 78, and except as set forth therein, the authors retain all their rights.

This document and the information contained herein are provided on an "AS IS" basis and THE CONTRIBUTOR, THE ORGANIZATION HE/SHE REPRESENTS OR IS SPONSORED BY (IF ANY), THE INTERNET SOCIETY AND THE INTERNET ENGINEERING TASK FORCE DISCLAIM ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.

Intellectual Property πŸ“

the IETF takes no position on the validity or scope of any Intellectual Property Rights or other rights that might be claimed to pertain to the implementation or use of the technology described in this document, or on whether any license under those rights might or might not be available. It also doesn't say it has made any independent effort to identify any such rights 🫢 Info on the procedures for rights in RFC documents is in BCP 78 and BCP 79.

copies of IPR disclosures made to the IETF Secretariat, any assurances of licenses to be made available, or the result of an attempt to get a general license or permission for implementers or users of this specification can be found in the IETF online IPR repository at http://www.ietf.org/ipr.

the IETF invites any interested party to bring to its attention any copyrights, patents or patent applications, or other proprietary rights that may cover technology required to implement this standard. Send that info to the IETF at ietf-ipr@ietf.org πŸ’…

Acknowledgement 🌸

funding for the RFC Editor function is currently provided by the Internet Society πŸ’œ

πŸ“¦ where this page comes from