idnits 2.17.1 draft-ietf-smime-msg-08.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- ** Looks like you're using RFC 2026 boilerplate. This must be updated to follow RFC 3978/3979, as updated by RFC 4748. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- ** Missing expiration date. The document expiration date should appear on the first and last page. ** The document is more than 15 pages and seems to lack a Table of Contents. == There is 1 instance of lines with non-ascii characters in the document. == No 'Intended status' indicated for this document; assuming Proposed Standard == The page length should not exceed 58 lines per page, but there was 1 longer page, the longest (page 1) being 1452 lines Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- ** The document seems to lack an Abstract section. ** The document seems to lack an IANA Considerations section. (See Section 2.2 of https://www.ietf.org/id-info/checklist for how to handle the case when there are no actions for IANA.) ** The document seems to lack an Authors' Addresses Section. ** The document seems to lack a both a reference to RFC 2119 and the recommended RFC 2119 boilerplate, even if it appears to use RFC 2119 keywords. RFC 2119 keyword, line 163: '...Sending and receiving agents MUST support SHA-1 [SHA1]. Receiving...' RFC 2119 keyword, line 164: '...agents SHOULD support MD5 [MD5] for the purpose of providing backward...' RFC 2119 keyword, line 169: '...Sending and receiving agents MUST support id-dsa defined in [DSS]....' RFC 2119 keyword, line 170: '...rithm parameters MUST be absent (not e...' RFC 2119 keyword, line 172: '...Receiving agents SHOULD support rsaEncryption, defined in [PKCS-1]....' (93 more instances...) Miscellaneous warnings: ---------------------------------------------------------------------------- == Line 922 has weird spacing: '...gnature is "....' == Line 964 has weird spacing: '...y other unkn...' ** The document contains RFC2119-like boilerplate, but doesn't seem to mention RFC 2119. The boilerplate contains a reference [MUSTSHOULD], but that reference does not seem to mention RFC 2119 either. -- The document seems to lack a disclaimer for pre-RFC5378 work, but may have content which was first submitted before 10 November 2008. If you have contacted all the original authors and they are all willing to grant the BCP78 rights to the IETF Trust, then this is fine, and you can ignore this comment. If not, you may need to add the pre-RFC5378 disclaimer. (See the Legal Provisions document at https://trustee.ietf.org/license-info for more information.) -- The document date (October 23, 1999) is 8952 days in the past. Is this intentional? Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) -- Missing reference section? 'MIME-SPEC' on line 1329 looks like a reference -- Missing reference section? 'CMS' on line 1310 looks like a reference -- Missing reference section? 'PKCS-7' on line 1343 looks like a reference -- Missing reference section? 'MIME-SECURE' on line 1335 looks like a reference -- Missing reference section? 'MUSTSHOULD' on line 1338 looks like a reference -- Missing reference section? 'SHA1' on line 1349 looks like a reference -- Missing reference section? 'MD5' on line 1327 looks like a reference -- Missing reference section? 'DSS' on line 1322 looks like a reference -- Missing reference section? 'PKCS-1' on line 1341 looks like a reference -- Missing reference section? 'DH' on line 1319 looks like a reference -- Missing reference section? 'ESS' on line 1324 looks like a reference -- Missing reference section? '3DES' on line 1301 looks like a reference -- Missing reference section? 'DES' on line 1316 looks like a reference -- Missing reference section? 'RC2' on line 1347 looks like a reference -- Missing reference section? 'CHARSETS' on line 1307 looks like a reference -- Missing reference section? 'CONTDISP' on line 1313 looks like a reference -- Missing reference section? 'SMIMEV2' on line 1353 looks like a reference -- Missing reference section? 'CERT3' on line 1304 looks like a reference -- Missing reference section? 'RANDOM' on line 1345 looks like a reference -- Missing reference section? '0' on line 1210 looks like a reference -- Missing reference section? '1' on line 1211 looks like a reference -- Missing reference section? '2' on line 1212 looks like a reference Summary: 8 errors (**), 0 flaws (~~), 5 warnings (==), 24 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 1 Internet Draft Editor: Blake Ramsdell, 2 draft-ietf-smime-msg-08.txt Worldtalk 3 April 23, 1999 4 Expires October 23, 1999 6 S/MIME Version 3 Message Specification 8 Status of this memo 10 This document is an Internet-Draft and is in full conformance with all 11 provisions of Section 10 of RFC2026. 13 Internet-Drafts are working documents of the Internet Engineering Task 14 Force (IETF), its areas, and its working groups. Note that other 15 groups may also distribute working documents as Internet-Drafts. 17 Internet-Drafts are draft documents valid for a maximum of six months 18 and may be updated, replaced, or obsoleted by other documents at any 19 time. It is inappropriate to use Internet-Drafts as reference 20 material or to cite them other than as "work in progress." 22 The list of current Internet-Drafts can be accessed at 23 http://www.ietf.org/ietf/1id-abstracts.txt 25 The list of Internet-Draft Shadow Directories can be accessed at 26 http://www.ietf.org/shadow.html. 28 1. Introduction 30 S/MIME (Secure/Multipurpose Internet Mail Extensions) provides a 31 consistent way to send and receive secure MIME data. Based on the 32 popular Internet MIME standard, S/MIME provides the following 33 cryptographic security services for electronic messaging applications: 34 authentication, message integrity and non-repudiation of origin (using 35 digital signatures) and privacy and data security (using encryption). 37 S/MIME can be used by traditional mail user agents (MUAs) to add 38 cryptographic security services to mail that is sent, and to interpret 39 cryptographic security services in mail that is received. However, 40 S/MIME is not restricted to mail; it can be used with any transport 41 mechanism that transports MIME data, such as HTTP. As such, S/MIME 42 takes advantage of the object-based features of MIME and allows secure 43 messages to be exchanged in mixed-transport systems. 45 Further, S/MIME can be used in automated message transfer agents that 46 use cryptographic security services that do not require any human 47 intervention, such as the signing of software-generated documents and 48 the encryption of FAX messages sent over the Internet. 50 1.1 Specification Overview 52 This document describes a protocol for adding cryptographic signature 53 and encryption services to MIME data. The MIME standard [MIME-SPEC] 54 provides a general structure for the content type of Internet messages 55 and allows extensions for new content type applications. 57 This draft defines how to create a MIME body part that has been 58 cryptographically enhanced according to CMS [CMS], which is derived 59 from PKCS #7 [PKCS-7]. This draft also defines the application/pkcs7- 60 mime MIME type that can be used to transport those body parts. 62 This draft also discusses how to use the multipart/signed MIME type 63 defined in [MIME-SECURE] to transport S/MIME signed messages. This 64 draft also defines the application/pkcs7-signature MIME type, which is 65 also used to transport S/MIME signed messages. 67 In order to create S/MIME messages, an S/MIME agent has to follow 68 specifications in this draft, as well as the specifications listed in 69 the Cryptographic Message Syntax [CMS]. 71 Throughout this draft, there are requirements and recommendations made 72 for how receiving agents handle incoming messages. There are separate 73 requirements and recommendations for how sending agents create 74 outgoing messages. In general, the best strategy is to "be liberal in 75 what you receive and conservative in what you send". Most of the 76 requirements are placed on the handling of incoming messages while the 77 recommendations are mostly on the creation of outgoing messages. 79 The separation for requirements on receiving agents and sending agents 80 also derives from the likelihood that there will be S/MIME systems 81 that involve software other than traditional Internet mail clients. 82 S/MIME can be used with any system that transports MIME data. An 83 automated process that sends an encrypted message might not be able to 84 receive an encrypted message at all, for example. Thus, the 85 requirements and recommendations for the two types of agents are 86 listed separately when appropriate. 88 1.2 Terminology 90 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 91 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 92 document are to be interpreted as described in [MUSTSHOULD]. 94 1.3 Definitions 96 For the purposes of this draft, the following definitions apply. 98 ASN.1: Abstract Syntax Notation One, as defined in CCITT X.208. 100 BER: Basic Encoding Rules for ASN.1, as defined in CCITT X.209. 102 Certificate: A type that binds an entity's distinguished name to a 103 public key with a digital signature. 105 DER: Distinguished Encoding Rules for ASN.1, as defined in CCITT 106 X.509. 108 7-bit data: Text data with lines less than 998 characters long, where 109 none of the characters have the 8th bit set, and there are no NULL 110 characters. and occur only as part of a end of line 111 delimiter. 113 8-bit data: Text data with lines less than 998 characters, and where 114 none of the characters are NULL characters. and occur only 115 as part of a end of line delimiter. 117 Binary data: Arbitrary data. 119 Transfer Encoding: A reversible transformation made on data so 8-bit 120 or binary data may be sent via a channel that only transmits 7-bit 121 data. 123 Receiving agent: software that interprets and processes S/MIME CMS 124 objects, MIME body parts that contain CMS objects, or both. 126 Sending agent: software that creates S/MIME CMS objects, MIME body 127 parts that contain CMS objects, or both. 129 S/MIME agent: user software that is a receiving agent, a sending 130 agent, or both. 132 1.4 Compatibility with Prior Practice of S/MIME 134 S/MIME version 3 agents should attempt to have the greatest 135 interoperability possible with S/MIME version 2 agents. S/MIME version 136 2 is described in RFC 2311 through RFC 2315, inclusive. RFC 2311 also 137 has historical information about the development of S/MIME. 139 1.5 Discussion of This Draft 141 This draft is being discussed on the "ietf-smime" mailing list. To 142 subscribe, send a message to: 144 ietf-smime-request@imc.org 146 with the single word 148 subscribe 150 in the body of the message. There is a Web site for the mailing list 151 at . 153 2. CMS Options 155 CMS allows for a wide variety of options in content and algorithm 156 support. This section puts forth a number of support requirements and 157 recommendations in order to achieve a base level of interoperability 158 among all S/MIME implementations. [CMS] provides additional details 159 regarding the use of the cryptographic algorithms. 161 2.1 DigestAlgorithmIdentifier 163 Sending and receiving agents MUST support SHA-1 [SHA1]. Receiving 164 agents SHOULD support MD5 [MD5] for the purpose of providing backward 165 compatibility with MD5-digested S/MIME v2 SignedData objects. 167 2.2 SignatureAlgorithmIdentifier 169 Sending and receiving agents MUST support id-dsa defined in [DSS]. 170 The algorithm parameters MUST be absent (not encoded as NULL). 172 Receiving agents SHOULD support rsaEncryption, defined in [PKCS-1]. 174 Sending agents SHOULD support rsaEncryption. Outgoing messages are 175 signed with a user's private key. The size of the private key is 176 determined during key generation. 178 Note that S/MIME v2 clients are only capable of verifying digital 179 signatures using the rsaEncryption algorithm. 181 2.3 KeyEncryptionAlgorithmIdentifier 183 Sending and receiving agents MUST support Diffie-Hellman defined in 184 [DH]. 186 Receiving agents SHOULD support rsaEncryption. Incoming encrypted 187 messages contain symmetric keys which are to be decrypted with a 188 user's private key. The size of the private key is determined during 189 key generation. 191 Sending agents SHOULD support rsaEncryption. 193 Note that S/MIME v2 clients are only capable of decrypting content 194 encryption keys using the rsaEncryption algorithm. 196 2.4 General Syntax 198 CMS defines multiple content types. Of these, only the Data, 199 SignedData, and EnvelopedData content types are currently used for 200 S/MIME. 202 2.4.1 Data Content Type 204 Sending agents MUST use the id-data content type identifier to 205 indicate the message content which has had security services applied 206 to it. For example, when applying a digital signature to MIME data, 207 the CMS signedData encapContentInfo eContentType MUST include the id- 208 data object identifier and the MIME content MUST be stored in the 209 SignedData encapContentInfo eContent OCTET STRING (unless the sending 210 agent is using multipart/signed, in which case the eContent is absent, 211 per section 3.4.3 of this document). As another example, when 212 applying encryption to MIME data, the CMS EnvelopedData 213 encryptedContentInfo ContentType MUST include the id-data object 214 identifier and the encrypted MIME content MUST be stored in the 215 envelopedData encryptedContentInfo encryptedContent OCTET STRING. 217 2.4.2 SignedData Content Type 219 Sending agents MUST use the signedData content type to apply a digital 220 signature to a message or, in a degenerate case where there is no 221 signature information, to convey certificates. 223 2.4.3 EnvelopedData Content Type 225 This content type is used to apply privacy protection to a message. A 226 sender needs to have access to a public key for each 227 intended message recipient to use this service. This content type does 228 not provide authentication. 230 2.5 Attribute SignerInfo Type 232 The SignerInfo type allows the inclusion of unsigned and signed 233 attributes to be included along with a signature. 235 Receiving agents MUST be able to handle zero or one instance of each 236 of the signed attributes listed here. Sending agents SHOULD generate 237 one instance of each of the following signed attributes in each S/MIME 238 message: 239 - signingTime (section 2.5.1 in this document) 240 - sMIMECapabilities (section 2.5.2 in this document) 241 - sMIMEEncryptionKeyPreference (section 2.5.3 in this document) 243 Further, receiving agents SHOULD be able to handle zero or one 244 instance in the signed attributes of the signingCertificate attribute 245 (section 5 in [ESS]). 247 Sending agents SHOULD generate one instance of the signingCertificate 248 signed attribute in each S/MIME message. 250 Additional attributes and values for these attributes may be defined 251 in the future. Receiving agents SHOULD handle attributes or values 252 that it does not recognize in a graceful manner. 254 Sending agents that include signed attributes that are not listed here 255 SHOULD display those attributes to the user, so that the user is aware 256 of all of the data being signed. 258 2.5.1 Signing-Time Attribute 260 The signing-time attribute is used to convey the time that a message 261 was signed. Until there are trusted timestamping services, the time of 262 signing will most likely be created by a message originator and 263 therefore is only as trustworthy as the originator. 265 Sending agents MUST encode signing time through the year 2049 as 266 UTCTime; signing times in 2050 or later MUST be encoded as 267 GeneralizedTime. When the UTCTime CHOICE is used, S/MIME agents MUST 268 interpret the year field (YY) as follows: 270 if YY is greater than or equal to 50, the year is interpreted as 19YY; 271 if YY is less than 50, the year is interpreted as 20YY. 273 2.5.2 SMIMECapabilities Attribute 275 The SMIMECapabilities attribute includes signature algorithms (such as 276 "sha1WithRSAEncryption"), symmetric algorithms (such as "DES-EDE3- 277 CBC"), and key encipherment algorithms (such as "rsaEncryption"). It 278 also includes a non-algorithm capability which is the preference for 279 signedData. The SMIMECapabilities were designed to be flexible and 280 extensible so that, in the future, a means of identifying other 281 capabilities and preferences such as certificates can be added in a 282 way that will not cause current clients to break. 284 If present, the SMIMECapabilities attribute MUST be a SignedAttribute; 285 it MUST NOT be an UnsignedAttribute. CMS defines SignedAttributes as a 286 SET OF Attribute. The SignedAttributes in a signerInfo MUST NOT 287 include multiple instances of the SMIMECapabilities attribute. CMS 288 defines the ASN.1 syntax for Attribute to include attrValues SET OF 289 AttributeValue. A SMIMECapabilities attribute MUST only include a 290 single instance of AttributeValue. There MUST NOT be zero or multiple 291 instances of AttributeValue present in the attrValues SET OF 292 AttributeValue. 294 The semantics of the SMIMECapabilites attribute specify a partial list 295 as to what the client announcing the SMIMECapabilites can support. A 296 client does not have to list every capability it supports, and 297 probably should not list all its capabilities so that the capabilities 298 list doesn't get too long. In an SMIMECapabilities attribute, the OIDs 299 are listed in order of their preference, but SHOULD be logically 300 separated along the lines of their categories (signature algorithms, 301 symmetric algorithms, key encipherment algorithms, etc.) 303 The structure of the SMIMECapabilities attribute is to facilitate 304 simple table lookups and binary comparisons in order to determine 305 matches. For instance, the DER-encoding for the SMIMECapability for 306 DES EDE3 CBC MUST be identically encoded regardless of the 307 implementation. 309 In the case of symmetric algorithms, the associated parameters for the 310 OID MUST specify all of the parameters necessary to differentiate 311 between two instances of the same algorithm. For instance, the number 312 of rounds and block size for RC5 must be specified in addition to the 313 key length. 315 There is a list of OIDs (OIDs Used with S/MIME) that is centrally 316 maintained and is separate from this draft. The list of OIDs is 317 maintained by the Internet Mail Consortium at . Note that all OIDs associated with the MUST and 319 SHOULD implement algorithms are included in section A of this 320 document. 322 The OIDs that correspond to algorithms SHOULD use the same OID as the 323 actual algorithm, except in the case where the algorithm usage is 324 ambiguous from the OID. For instance, in an earlier draft, 325 rsaEncryption was ambiguous because it could refer to either a 326 signature algorithm or a key encipherment algorithm. In the event that 327 an OID is ambiguous, it needs to be arbitrated by the maintainer of 328 the registered SMIMECapabilities list as to which type of algorithm 329 will use the OID, and a new OID MUST be allocated under the 330 smimeCapabilities OID to satisfy the other use of the OID. 332 The registered SMIMECapabilities list specifies the parameters for 333 OIDs that need them, most notably key lengths in the case of variable- 334 length symmetric ciphers. In the event that there are no 335 differentiating parameters for a particular OID, the parameters MUST 336 be omitted, and MUST NOT be encoded as NULL. 338 Additional values for the SMIMECapabilities attribute may be defined 339 in the future. Receiving agents MUST handle a SMIMECapabilities object 340 that has values that it does not recognize in a graceful manner. 342 2.5.3 Encryption Key Preference Attribute 344 The encryption key preference attribute allows the signer to 345 unambiguously describe which of the signer's certificates has the 346 signer's preferred encryption key. This attribute is designed to 347 enhance behavior for interoperating with those clients which use 348 separate keys for encryption and signing. This attribute is used to 349 convey to anyone viewing the attribute which of the listed 350 certificates should be used for encrypting a session key for future 351 encrypted messages. 353 If present, the SMIMEEncryptionKeyPreference attribute MUST be a 354 SignedAttribute; it MUST NOT be an UnsignedAttribute. CMS defines 355 SignedAttributes as a SET OF Attribute. The SignedAttributes in a 356 signerInfo MUST NOT include multiple instances of the 357 SMIMEEncryptionKeyPreference attribute. CMS defines the ASN.1 syntax 358 for Attribute to include attrValues SET OF AttributeValue. A 359 SMIMEEncryptionKeyPreference attribute MUST only include a single 360 instance of AttributeValue. There MUST NOT be zero or multiple 361 instances of AttributeValue present in the attrValues SET OF 362 AttributeValue. 364 The sending agent SHOULD include the referenced certificate in the set 365 of certificates included in the signed message if this attribute is 366 used. The certificate may be omitted if it has been previously made 367 available to the receiving agent. Sending agents SHOULD use this 368 attribute if the commonly used or preferred encryption certificate is 369 not the same as the certificate used to sign the message. 371 Receiving agents SHOULD store the preference data if the signature on 372 the message is valid and the signing time is greater than the 373 currently stored value. (As with the SMIMECapabilities, the clock 374 skew should be checked and the data not used if the skew is too 375 great.) Receiving agents SHOULD respect the sender's encryption key 376 preference attribute if possible. This however represents only a 377 preference and the receiving agent may use any certificate in replying 378 to the sender that is valid. 380 2.5.3.1 Selection of Recipient Key Management Certificate 382 In order to determine the key management certificate to be used when 383 sending a future CMS envelopedData message for a particular recipient, 384 the following steps SHOULD be followed: 386 - If an SMIMEEncryptionKeyPreference attribute is found in a 387 signedData object received from the desired recipient, this identifies 388 the X.509 certificate that should be used as the X.509 key management 389 certificate for the recipient. 391 - If an SMIMEEncryptionKeyPreference attribute is not found in a 392 signedData object received from the desired recipient, the set of 393 X.509 certificates should be searched for a X.509 certificate with the 394 same subject name as the signing X.509 certificate which can be used 395 for key management. 397 - Or use some other method of determining the user's key management 398 key. If a X.509 key management certificate is not found, then 399 encryption cannot be done with the signer of the message. If multiple 400 X.509 key management certificates are found, the S/MIME agent can make 401 an arbitrary choice between them. 403 2.6 SignerIdentifier SignerInfo Type 405 S/MIME v3 requires the use of SignerInfo version 1, that is the 406 issuerAndSerialNumber CHOICE MUST be used for SignerIdentifier. 408 2.7 ContentEncryptionAlgorithmIdentifier 410 Sending and receiving agents MUST support encryption and decryption 411 with DES EDE3 CBC, hereinafter called "tripleDES" [3DES] [DES]. 412 Receiving agents SHOULD support encryption and decryption using the 413 RC2 [RC2] or a compatible algorithm at a key size of 40 bits, 414 hereinafter called "RC2/40". 416 2.7.1 Deciding Which Encryption Method To Use 418 When a sending agent creates an encrypted message, it has to decide 419 which type of encryption to use. The decision process involves using 420 information garnered from the capabilities lists included in messages 421 received from the recipient, as well as out-of-band information such 422 as private agreements, user preferences, legal restrictions, and so 423 on. 425 Section 2.5 defines a method by which a sending agent can optionally 426 announce, among other things, its decrypting capabilities in its order 427 of preference. The following method for processing and remembering the 428 encryption capabilities attribute in incoming signed messages SHOULD 429 be used. 431 - If the receiving agent has not yet created a list of capabilities 432 for the sender's public key, then, after verifying the signature 433 on the incoming message and checking the timestamp, the receiving 434 agent SHOULD create a new list containing at least the signing 435 time and the symmetric capabilities. 436 - If such a list already exists, the receiving agent SHOULD verify 437 that the signing time in the incoming message is greater than 438 the signing time stored in the list and that the signature is 439 valid. If so, the receiving agent SHOULD update both the signing 440 time and capabilities in the list. Values of the signing time that 441 lie far in the future (that is, a greater discrepancy than any 442 reasonable clock skew), or a capabilities list in messages whose 443 signature could not be verified, MUST NOT be accepted. 445 The list of capabilities SHOULD be stored for future use in creating 446 messages. 448 Before sending a message, the sending agent MUST decide whether it is 449 willing to use weak encryption for the particular data in the message. 450 If the sending agent decides that weak encryption is unacceptable for 451 this data, then the sending agent MUST NOT use a weak algorithm such 452 as RC2/40. The decision to use or not use weak encryption overrides 453 any other decision in this section about which encryption algorithm to 454 use. 456 Sections 2.7.2.1 through 2.7.2.4 describe the decisions a sending 457 agent SHOULD use in deciding which type of encryption should be 458 applied to a message. These rules are ordered, so the sending agent 459 SHOULD make its decision in the order given. 461 2.7.1.1 Rule 1: Known Capabilities 463 If the sending agent has received a set of capabilities from the 464 recipient for the message the agent is about to encrypt, then the 465 sending agent SHOULD use that information by selecting the first 466 capability in the list (that is, the capability most preferred by the 467 intended recipient) for which the sending agent knows how to encrypt. 468 The sending agent SHOULD use one of the capabilities in the list if 469 the agent reasonably expects the recipient to be able to decrypt the 470 message. 472 2.7.1.2 Rule 2: Unknown Capabilities, Known Use of Encryption 474 If: 475 - the sending agent has no knowledge of the encryption capabilities 476 of the recipient, 477 - and the sending agent has received at least one message from the 478 recipient, 479 - and the last encrypted message received from the recipient had a 480 trusted signature on it, 481 then the outgoing message SHOULD use the same encryption algorithm as 482 was used on the last signed and encrypted message received from the 483 recipient. 485 2.7.1.3 Rule 3: Unknown Capabilities, Unknown Version of S/MIME 487 If: 488 - the sending agent has no knowledge of the encryption capabilities 489 of the recipient, 490 - and the sending agent has no knowledge of the version of S/MIME 491 of the recipient, 492 then the sending agent SHOULD use tripleDES because it is a stronger 493 algorithm and is required by S/MIME v3. If the sending agent chooses 494 not to use tripleDES in this step, it SHOULD use RC2/40. 496 2.7.2 Choosing Weak Encryption 498 Like all algorithms that use 40 bit keys, RC2/40 is considered by many 499 to be weak encryption. A sending agent that is controlled by a human 500 SHOULD allow a human sender to determine the risks of sending data 501 using RC2/40 or a similarly weak encryption algorithm before sending 502 the data, and possibly allow the human to use a stronger encryption 503 method such as tripleDES. 505 2.7.3 Multiple Recipients 507 If a sending agent is composing an encrypted message to a group of 508 recipients where the encryption capabilities of some of the recipients 509 do not overlap, the sending agent is forced to send more than one 510 message. It should be noted that if the sending agent chooses to send 511 a message encrypted with a strong algorithm, and then send the same 512 message encrypted with a weak algorithm, someone watching the 513 communications channel may be able to learn the contents of the 514 strongly-encrypted message simply by decrypting the weakly-encrypted 515 message. 517 3. Creating S/MIME Messages 519 This section describes the S/MIME message formats and how they are 520 created. S/MIME messages are a combination of MIME bodies and CMS 521 objects. Several MIME types as well as several CMS objects are used. 522 The data to be secured is always a canonical MIME entity. The MIME 523 entity and other data, such as certificates and algorithm identifiers, 524 are given to CMS processing facilities which produces a CMS object. 525 The CMS object is then finally wrapped in MIME. The Enhanced Security 526 Services for S/MIME [ESS] document provides examples of how nested, 527 secured S/MIME messages are formatted. ESS provides an example of how 528 a triple-wrapped S/MIME message is formatted using multipart/signed 529 and application/pkcs7-mime for the signatures. 531 S/MIME provides one format for enveloped-only data, several formats 532 for signed-only data, and several formats for signed and enveloped 533 data. Several formats are required to accommodate several 534 environments, in particular for signed messages. The criteria for 535 choosing among these formats are also described. 537 The reader of this section is expected to understand MIME as described 538 in [MIME-SPEC] and [MIME-SECURE]. 540 3.1 Preparing the MIME Entity for Signing or Enveloping 542 S/MIME is used to secure MIME entities. A MIME entity may be a sub- 543 part, sub-parts of a message, or the whole message with all its sub- 544 parts. A MIME entity that is the whole message includes only the MIME 545 headers and MIME body, and does not include the RFC-822 headers. Note 546 that S/MIME can also be used to secure MIME entities used in 547 applications other than Internet mail. 549 The MIME entity that is secured and described in this section can be 550 thought of as the "inside" MIME entity. That is, it is the "innermost" 551 object in what is possibly a larger MIME message. Processing "outside" 552 MIME entities into CMS objects is described in Section 3.2, 3.4 and 553 elsewhere. 555 The procedure for preparing a MIME entity is given in [MIME-SPEC]. The 556 same procedure is used here with some additional restrictions when 557 signing. Description of the procedures from [MIME-SPEC] are repeated 558 here, but the reader should refer to that document for the exact 559 procedure. This section also describes additional requirements. 561 A single procedure is used for creating MIME entities that are to be 562 signed, enveloped, or both signed and enveloped. Some additional steps 563 are recommended to defend against known corruptions that can occur 564 during mail transport that are of particular importance for clear- 565 signing using the multipart/signed format. It is recommended that 566 these additional steps be performed on enveloped messages, or signed 567 and enveloped messages in order that the message can be forwarded to 568 any environment without modification. 570 These steps are descriptive rather than prescriptive. The implementor 571 is free to use any procedure as long as the result is the same. 573 Step 1. The MIME entity is prepared according to the local conventions 575 Step 2. The leaf parts of the MIME entity are converted to canonical 576 form 578 Step 3. Appropriate transfer encoding is applied to the leaves of the 579 MIME entity 581 When an S/MIME message is received, the security services on the 582 message are processed, and the result is the MIME entity. That MIME 583 entity is typically passed to a MIME-capable user agent where, it is 584 further decoded and presented to the user or receiving application. 586 3.1.1 Canonicalization 588 Each MIME entity MUST be converted to a canonical form that is 589 uniquely and unambiguously representable in the environment where the 590 signature is created and the environment where the signature will be 591 verified. MIME entities MUST be canonicalized for enveloping as well 592 as signing. 594 The exact details of canonicalization depend on the actual MIME type 595 and subtype of an entity, and are not described here. Instead, the 596 standard for the particular MIME type should be consulted. For 597 example, canonicalization of type text/plain is different from 598 canonicalization of audio/basic. Other than text types, most types 599 have only one representation regardless of computing platform or 600 environment which can be considered their canonical representation. In 601 general, canonicalization will be performed by the non-security part 602 of the sending agent rather than the S/MIME implementation. 604 The most common and important canonicalization is for text, which is 605 often represented differently in different environments. MIME entities 606 of major type "text" must have both their line endings and character 607 set canonicalized. The line ending must be the pair of characters 608 , and the charset should be a registered charset [CHARSETS]. 609 The details of the canonicalization are specified in [MIME-SPEC]. The 610 chosen charset SHOULD be named in the charset parameter so that 611 the receiving agent can unambiguously determine the charset used. 613 Note that some charsets such as ISO-2022 have multiple representations 614 for the same characters. When preparing such text for signing, the 615 canonical representation specified for the charset MUST be used. 617 3.1.2 Transfer Encoding 619 When generating any of the secured MIME entities below, except the 620 signing using the multipart/signed format, no transfer encoding at all 621 is required. S/MIME implementations MUST be able to deal with binary 622 MIME objects. If no Content-Transfer-Encoding header is present, the 623 transfer encoding should be considered 7BIT. 625 S/MIME implementations SHOULD however use transfer encoding described 626 in section 3.1.3 for all MIME entities they secure. The reason for 627 securing only 7-bit MIME entities, even for enveloped data that are 628 not exposed to the transport, is that it allows the MIME entity to be 629 handled in any environment without changing it. For example, a trusted 630 gateway might remove the envelope, but not the signature, of a 631 message, and then forward the signed message on to the end recipient 632 so that they can verify the signatures directly. If the transport 633 internal to the site is not 8-bit clean, such as on a wide-area 634 network with a single mail gateway, verifying the signature will not 635 be possible unless the original MIME entity was only 7-bit data. 637 3.1.3 Transfer Encoding for Signing Using multipart/signed 639 If a multipart/signed entity is EVER to be transmitted over the 640 standard Internet SMTP infrastructure or other transport that is 641 constrained to 7-bit text, it MUST have transfer encoding applied so 642 that it is represented as 7-bit text. MIME entities that are 7-bit 643 data already need no transfer encoding. Entities such as 8-bit text 644 and binary data can be encoded with quoted-printable or base-64 645 transfer encoding. 647 The primary reason for the 7-bit requirement is that the Internet mail 648 transport infrastructure cannot guarantee transport of 8-bit or binary 649 data. Even though many segments of the transport infrastructure now 650 handle 8-bit and even binary data, it is sometimes not possible to 651 know whether the transport path is 8-bit clear. If a mail message with 652 8-bit data were to encounter a message transfer agent that can not 653 transmit 8-bit or binary data, the agent has three options, none of 654 which are acceptable for a clear-signed message: 656 - The agent could change the transfer encoding; this would invalidate 657 the signature. 658 - The agent could transmit the data anyway, which would most likely 659 result in the 8th bit being corrupted; this too would invalidate the 660 signature. 661 - The agent could return the message to the sender. 663 [MIME-SECURE] prohibits an agent from changing the transfer encoding 664 of the first part of a multipart/signed message. If a compliant agent 665 that can not transmit 8-bit or binary data encounters a 666 multipart/signed message with 8-bit or binary data in the first part, 667 it would have to return the message to the sender as undeliverable. 669 3.1.4 Sample Canonical MIME Entity 671 This example shows a multipart/mixed message with full transfer 672 encoding. This message contains a text part and an attachment. The 673 sample message text includes characters that are not US-ASCII and thus 674 must be transfer encoded. Though not shown here, the end of each line 675 is . The line ending of the MIME headers, the text, and 676 transfer encoded parts, all must be . 678 Note that this example is not of an S/MIME message. 680 Content-Type: multipart/mixed; boundary=bar 682 --bar 683 Content-Type: text/plain; charset=iso-8859-1 684 Content-Transfer-Encoding: quoted-printable 686 =A1Hola Michael! 688 How do you like the new S/MIME specification? 690 I agree. It's generally a good idea to encode lines that begin 691 with 692 From=20because some mail transport agents will insert a greater- 693 than (>) sign, thus invalidating the signature. 695 Also, in some cases it might be desirable to encode any =20 696 trailing whitespace that occurs on lines in order to ensure =20 697 that the message signature is not invalidated when passing =20 698 a gateway that modifies such whitespace (like BITNET). =20 700 --bar 701 Content-Type: image/jpeg 702 Content-Transfer-Encoding: base64 704 iQCVAwUBMJrRF2N9oWBghPDJAQE9UQQAtl7LuRVndBjrk4EqYBIb3h5QXIX/LC// 705 jJV5bNvkZIGPIcEmI5iFd9boEgvpirHtIREEqLQRkYNoBActFBZmh9GC3C041WGq 706 uMbrbxc+nIs1TIKlA08rVi9ig/2Yh7LFrK5Ein57U/W72vgSxLhe/zhdfolT9Brn 707 HOxEa44b+EI= 709 --bar-- 711 3.2 The application/pkcs7-mime Type 713 The application/pkcs7-mime type is used to carry CMS objects of 714 several types including envelopedData and signedData. The details of 715 constructing these entities is described in subsequent sections. This 716 section describes the general characteristics of the application/pkcs7- 717 mime type. 719 The carried CMS object always contains a MIME entity that is prepared 720 as described in section 3.1 if the eContentType is id-data. Other 721 contents may be carried when the eContentType contains different 722 values. See [ESS] for an example of this with signed receipts. 724 Since CMS objects are binary data, in most cases base-64 transfer 725 encoding is appropriate, in particular when used with SMTP transport. 726 The transfer encoding used depends on the transport through which the 727 object is to be sent, and is not a characteristic of the MIME type. 729 Note that this discussion refers to the transfer encoding of the CMS 730 object or "outside" MIME entity. It is completely distinct from, and 731 unrelated to, the transfer encoding of the MIME entity secured by the 732 CMS object, the "inside" object, which is described in section 3.1. 734 Because there are several types of application/pkcs7-mime objects, a 735 sending agent SHOULD do as much as possible to help a receiving agent 736 know about the contents of the object without forcing the receiving 737 agent to decode the ASN.1 for the object. The MIME headers of all 738 application/pkcs7-mime objects SHOULD include the optional "smime- 739 type" parameter, as described in the following sections. 741 3.2.1 The name and filename Parameters 743 For the application/pkcs7-mime, sending agents SHOULD emit the 744 optional "name" parameter to the Content-Type field for compatibility 745 with older systems. Sending agents SHOULD also emit the optional 746 Content-Disposition field [CONTDISP] with the "filename" parameter. If 747 a sending agent emits the above parameters, the value of the 748 parameters SHOULD be a file name with the appropriate extension: 750 MIME Type File Extension 752 Application/pkcs7-mime (signedData, .p7m 753 envelopedData) 755 Application/pkcs7-mime (degenerate .p7c 756 signedData "certs-only" message) 758 Application/pkcs7-signature .p7s 760 In addition, the file name SHOULD be limited to eight characters 761 followed by a three letter extension. The eight character filename 762 base can be any distinct name; the use of the filename base "smime" 763 SHOULD be used to indicate that the MIME entity is associated with 764 S/MIME. 766 Including a file name serves two purposes. It facilitates easier use 767 of S/MIME objects as files on disk. It also can convey type 768 information across gateways. When a MIME entity of type 769 application/pkcs7-mime (for example) arrives at a gateway that has no 770 special knowledge of S/MIME, it will default the entity's MIME type to 771 application/octet-stream and treat it as a generic attachment, thus 772 losing the type information. However, the suggested filename for an 773 attachment is often carried across a gateway. This often allows the 774 receiving systems to determine the appropriate application to hand the 775 attachment off to, in this case a stand-alone S/MIME processing 776 application. Note that this mechanism is provided as a convenience for 777 implementations in certain environments. A proper S/MIME 778 implementation MUST use the MIME types and MUST NOT rely on the file 779 extensions. 781 3.2.2 The smime-type parameter 783 The application/pkcs7-mime content type defines the optional "smime- 784 type" parameter. The intent of this parameter is to convey details 785 about the security applied (signed or enveloped) along with infomation 786 about the contained content. This draft defines the following smime- 787 types. 789 Name Security Inner Content 791 enveloped-data EnvelopedData id-data 793 signed-data SignedData id-data 795 certs-only SignedData none 797 In order that consistency can be obtained with future, the following 798 guidelines should be followed when assigning a new smime-type 799 parameter. 801 1. If both signing and encryption can be applied to the content, then 802 two values for smime-type SHOULD be assigned "signed-*" and "encrypted- 803 *". If one operation can be assigned then this may be omitted. Thus 804 since "certs-only" can only be signed, "signed-" is omitted. 806 2. A common string for a content oid should be assigned. We use "data" 807 for the id-data content OID when MIME is the inner content. 809 3. If no common string is assigned. Then the common string of 810 "OID." is recommended (for example, "OID.1.3.6.1.5.5.7.6.1" would 811 be DES40). 813 3.3 Creating an Enveloped-only Message 815 This section describes the format for enveloping a MIME entity without 816 signing it. It is important to note that sending enveloped but not 817 signed messages does not provide for data integrity. It is possible to 818 replace ciphertext in such a way that the processed message will still 819 be valid, but the meaning may be altered. 821 Step 1. The MIME entity to be enveloped is prepared according to 822 section 3.1. 824 Step 2. The MIME entity and other required data is processed into a 825 CMS object of type envelopedData. In addition to encrypting a copy of 826 the content-encryption key for each recipient, a copy of the content 827 encryption key SHOULD be encrypted for the originator and included in 828 the envelopedData (see CMS Section 6). 830 Step 3. The CMS object is inserted into an application/pkcs7-mime MIME 831 entity. 833 The smime-type parameter for enveloped-only messages is "enveloped- 834 data". The file extension for this type of message is ".p7m". 836 A sample message would be: 838 Content-Type: application/pkcs7-mime; smime-type=enveloped-data; 839 name=smime.p7m 840 Content-Transfer-Encoding: base64 841 Content-Disposition: attachment; filename=smime.p7m 843 rfvbnj756tbBghyHhHUujhJhjH77n8HHGT9HG4VQpfyF467GhIGfHfYT6 844 7n8HHGghyHhHUujhJh4VQpfyF467GhIGfHfYGTrfvbnjT6jH7756tbB9H 845 f8HHGTrfvhJhjH776tbB9HG4VQbnj7567GhIGfHfYT6ghyHhHUujpfyF4 846 0GhIGfHfQbnj756YT64V 848 3.4 Creating a Signed-only Message 850 There are two formats for signed messages defined for S/MIME: 851 application/pkcs7-mime with SignedData, and multipart/signed. In 852 general, the multipart/signed form is preferred for sending, and 853 receiving agents SHOULD be able to handle both. 855 3.4.1 Choosing a Format for Signed-only Messages 857 There are no hard-and-fast rules when a particular signed-only format 858 should be chosen because it depends on the capabilities of all the 859 receivers and the relative importance of receivers with S/MIME 860 facilities being able to verify the signature versus the importance of 861 receivers without S/MIME software being able to view the message. 863 Messages signed using the multipart/signed format can always be viewed 864 by the receiver whether they have S/MIME software or not. They can 865 also be viewed whether they are using a MIME-native user agent or they 866 have messages translated by a gateway. In this context, "be viewed" 867 means the ability to process the message essentially as if it were not 868 a signed message, including any other MIME structure the message might 869 have. 871 Messages signed using the signedData format cannot be viewed by a 872 recipient unless they have S/MIME facilities. However, if they have 873 S/MIME facilities, these messages can always be verified if they were 874 not changed in transit. 876 3.4.2 Signing Using application/pkcs7-mime with SignedData 878 This signing format uses the application/pkcs7-mime MIME type. The 879 steps to create this format are: 881 Step 1. The MIME entity is prepared according to section 3.1 883 Step 2. The MIME entity and other required data is processed into a 884 CMS object of type signedData 886 Step 3. The CMS object is inserted into an application/pkcs7-mime MIME 887 entity 889 The smime-type parameter for messages using application/pkcs7-mime 890 with SignedData is "signed-data". The file extension for this type of 891 message is ".p7m". 893 A sample message would be: 895 Content-Type: application/pkcs7-mime; smime-type=signed-data; 896 name=smime.p7m 897 Content-Transfer-Encoding: base64 898 Content-Disposition: attachment; filename=smime.p7m 900 567GhIGfHfYT6ghyHhHUujpfyF4f8HHGTrfvhJhjH776tbB9HG4VQbnj7 901 77n8HHGT9HG4VQpfyF467GhIGfHfYT6rfvbnj756tbBghyHhHUujhJhjH 902 HUujhJh4VQpfyF467GhIGfHfYGTrfvbnjT6jH7756tbB9H7n8HHGghyHh 903 6YT64V0GhIGfHfQbnj75 905 3.4.3 Signing Using the multipart/signed Format 907 This format is a clear-signing format. Recipients without any S/MIME 908 or CMS processing facilities are able to view the message. It makes 909 use of the multipart/signed MIME type described in [MIME-SECURE]. The 910 multipart/signed MIME type has two parts. The first part contains the 911 MIME entity that is signed; the second part contains the "detached 912 signature" CMS SignedData object in which the encapContentInfo 913 eContent field is absent. 915 3.4.3.1 The application/pkcs7-signature MIME Type 917 This MIME type always contains a single CMS object of type signedData. 918 The signedData encapContentInfo eContent field MUST be absent. The 919 signerInfos field contains the signatures for the MIME entity. 921 The file extension for signed-only messages using application/pkcs7- 922 signature is ".p7s". 924 3.4.3.2 Creating a multipart/signed Message 926 Step 1. The MIME entity to be signed is prepared according to section 927 3.1, taking special care for clear-signing. 929 Step 2. The MIME entity is presented to CMS processing in order to 930 obtain an object of type signedData in which the encapContentInfo 931 eContent field is absent. 933 Step 3. The MIME entity is inserted into the first part of a 934 multipart/signed message with no processing other than that described 935 in section 3.1. 937 Step 4. Transfer encoding is applied to the "detached signature" CMS 938 SignedData object and it is inserted into a MIME entity of type 939 application/pkcs7-signature. 941 Step 5. The MIME entity of the application/pkcs7-signature is inserted 942 into the second part of the multipart/signed entity. 944 The multipart/signed Content type has two required parameters: the 945 protocol parameter and the micalg parameter. 947 The protocol parameter MUST be "application/pkcs7-signature". Note 948 that quotation marks are required around the protocol parameter 949 because MIME requires that the "/" character in the parameter value 950 MUST be quoted. 952 The micalg parameter allows for one-pass processing when the signature 953 is being verified. The value of the micalg parameter is dependent on 954 the message digest algorithm(s) used in the calculation of the Message 955 Integrity Check. If multiple message digest algorithms are used they 956 MUST be separated by commas per [MIME-SECURE]. The values to be placed 957 in the micalg parameter SHOULD be from the following: 959 Algorithm Value 960 used 962 MD5 md5 963 SHA-1 sha1 964 Any other unknown 966 (Historical note: some early implementations of S/MIME emitted and 967 expected "rsa-md5" and "rsa-sha1" for the micalg parameter.) Receiving 968 agents SHOULD be able to recover gracefully from a micalg parameter 969 value that they do not recognize. 971 3.4.3.3 Sample multipart/signed Message 973 Content-Type: multipart/signed; 974 protocol="application/pkcs7-signature"; 975 micalg=sha1; boundary=boundary42 977 --boundary42 978 Content-Type: text/plain 980 This is a clear-signed message. 982 --boundary42 983 Content-Type: application/pkcs7-signature; name=smime.p7s 984 Content-Transfer-Encoding: base64 985 Content-Disposition: attachment; filename=smime.p7s 987 ghyHhHUujhJhjH77n8HHGTrfvbnj756tbB9HG4VQpfyF467GhIGfHfYT6 988 4VQpfyF467GhIGfHfYT6jH77n8HHGghyHhHUujhJh756tbB9HGTrfvbnj 989 n8HHGTrfvhJhjH776tbB9HG4VQbnj7567GhIGfHfYT6ghyHhHUujpfyF4 990 7GhIGfHfYT64VQbnj756 992 --boundary42-- 994 3.5 Signing and Encrypting 996 To achieve signing and enveloping, any of the signed-only and 997 encrypted-only formats may be nested. This is allowed because the 998 above formats are all MIME entities, and because they all secure MIME 999 entities. 1001 An S/MIME implementation MUST be able to receive and process 1002 arbitrarily nested S/MIME within reasonable resource limits of the 1003 recipient computer. 1005 It is possible to either sign a message first, or to envelope the 1006 message first. It is up to the implementor and the user to choose. 1007 When signing first, the signatories are then securely obscured by the 1008 enveloping. When enveloping first the signatories are exposed, but it 1009 is possible to verify signatures without removing the enveloping. This 1010 may be useful in an environment were automatic signature verification 1011 is desired, as no private key material is required to verify a 1012 signature. 1014 There are security ramifications to choosing whether to sign first or 1015 encrypt first. A recipient of a message that is encrypted and then 1016 signed can validate that the encrypted block was unaltered, but cannot 1017 determine any relationship between the signer and the unencrypted 1018 contents of the message. A recipient of a message that is signed-then- 1019 encrypted can assume that the signed message itself has not been 1020 altered, but that a careful attacker may have changed the 1021 unauthenticated portions of the encrypted message. 1023 3.6 Creating a Certificates-only Message 1025 The certificates only message or MIME entity is used to transport 1026 certificates, such as in response to a registration request. This 1027 format can also be used to convey CRLs. 1029 Step 1. The certificates are made available to the CMS generating 1030 process which creates a CMS object of type signedData. The signedData 1031 encapContentInfo eContent field MUST be absent and signerInfos field 1032 MUST be empty. 1034 Step 2. The CMS signedData object is enclosed in an application/pkcs7- 1035 mime MIME entity 1037 The smime-type parameter for a certs-only message is "certs-only". 1038 The file extension for this type of message is ".p7c". 1040 3.7 Registration Requests 1042 A sending agent that signs messages MUST have a certificate for the 1043 signature so that a receiving agent can verify the signature. There 1044 are many ways of getting certificates, such as through an exchange 1045 with a certificate authority, through a hardware token or diskette, 1046 and so on. 1048 S/MIME v2 [SMIMEV2] specified a method for "registering" public keys 1049 with certificate authorities using an application/pkcs10 body part. 1050 The IETF's PKIX Working Group is preparing another method for 1051 requesting certificates; however, that work was not finished at the 1052 time of this draft. S/MIME v3 does not specify how to request a 1053 certificate, but instead mandates that every sending agent already has 1054 a certificate. Standardization of certificate management is being 1055 pursued separately in the IETF. 1057 3.8 Identifying an S/MIME Message 1059 Because S/MIME takes into account interoperation in non-MIME 1060 environments, several different mechanisms are employed to carry the 1061 type information, and it becomes a bit difficult to identify S/MIME 1062 messages. The following table lists criteria for determining whether 1063 or not a message is an S/MIME message. A message is considered an 1064 S/MIME message if it matches any below. 1066 The file suffix in the table below comes from the "name" parameter in 1067 the content-type header, or the "filename" parameter on the content- 1068 disposition header. These parameters that give the file suffix are not 1069 listed below as part of the parameter section. 1071 MIME type: application/pkcs7-mime 1072 parameters: any 1073 file suffix: any 1075 MIME type: multipart/signed 1076 parameters: protocol="application/pkcs7-signature" 1077 file suffix: any 1079 MIME type: application/octet-stream 1080 parameters: any 1081 file suffix: p7m, p7s, p7c 1083 4. Certificate Processing 1085 A receiving agent MUST provide some certificate retrieval mechanism in 1086 order to gain access to certificates for recipients of digital 1087 envelopes. This draft does not cover how S/MIME agents handle 1088 certificates, only what they do after a certificate has been validated 1089 or rejected. S/MIME certification issues are covered in [CERT3]. 1091 At a minimum, for initial S/MIME deployment, a user agent could 1092 automatically generate a message to an intended recipient requesting 1093 that recipient's certificate in a signed return message. Receiving and 1094 sending agents SHOULD also provide a mechanism to allow a user to 1095 "store and protect" certificates for correspondents in such a way so 1096 as to guarantee their later retrieval. 1098 4.1 Key Pair Generation 1100 If an S/MIME agent needs to generate a key pair, then the S/MIME agent 1101 or some related administrative utility or function MUST be capable of 1102 generating separate DH and DSS public/private key pairs on behalf of 1103 the user. Each key pair MUST be generated from a good source of non- 1104 deterministic random input [RANDOM] and the private key MUST be 1105 protected in a secure fashion. 1107 If an S/MIME agent needs to generate a key pair, then the S/MIME agent 1108 or some related administrative utility or function SHOULD generate RSA 1109 key pairs. 1111 A user agent SHOULD generate RSA key pairs at a minimum key size of 1112 768 bits. A user agent MUST NOT generate RSA key pairs less than 512 1113 bits long. Creating keys longer than 1024 bits may cause some older 1114 S/MIME receiving agents to not be able to verify signatures, but gives 1115 better security and is therefore valuable. A receiving agent SHOULD be 1116 able to verify signatures with keys of any size over 512 bits. Some 1117 agents created in the United States have chosen to create 512 bit keys 1118 in order to get more advantageous export licenses. However, 512 bit 1119 keys are considered by many to be cryptographically insecure. 1120 Implementors should be aware that multiple (active) key pairs may be 1121 associated with a single individual. For example, one key pair may be 1122 used to support confidentiality, while a different key pair may be 1123 used for authentication. 1125 5. Security 1127 This entire draft discusses security. Security issues not covered in 1128 other parts of the draft include: 1130 40-bit encryption is considered weak by most cryptographers. Using 1131 weak cryptography in S/MIME offers little actual security over sending 1132 plaintext. However, other features of S/MIME, such as the 1133 specification of tripleDES and the ability to announce stronger 1134 cryptographic capabilities to parties with whom you communicate, allow 1135 senders to create messages that use strong encryption. Using weak 1136 cryptography is never recommended unless the only alternative is no 1137 cryptography. When feasible, sending and receiving agents should 1138 inform senders and recipients the relative cryptographic strength of 1139 messages. 1141 It is impossible for most software or people to estimate the value of 1142 a message. Further, it is impossible for most software or people to 1143 estimate the actual cost of decrypting a message that is encrypted 1144 with a key of a particular size. Further, it is quite difficult to 1145 determine the cost of a failed decryption if a recipient cannot decode 1146 a message. Thus, choosing between different key sizes (or choosing 1147 whether to just use plaintext) is also impossible. However, decisions 1148 based on these criteria are made all the time, and therefore this 1149 draft gives a framework for using those estimates in choosing 1150 algorithms. 1152 If a sending agent is sending the same message using different 1153 strengths of cryptography, an attacker watching the communications 1154 channel may be able to determine the contents of the strongly- 1155 encrypted message by decrypting the weakly-encrypted version. In other 1156 words, a sender should not send a copy of a message using weaker 1157 cryptography than they would use for the original of the message. 1159 Modification of the ciphertext can go undetected if authentication is 1160 not also used, which is the case when sending EnvelopedData without 1161 wrapping it in SignedData or enclosing SignedData within it. 1163 A. ASN.1 Module 1165 SecureMimeMessageV3 1166 { iso(1) member-body(2) us(840) rsadsi(113549) 1167 pkcs(1) pkcs-9(9) smime(16) modules(0) smime(4) } 1169 DEFINITIONS IMPLICIT TAGS ::= 1170 BEGIN 1172 IMPORTS 1173 -- Cryptographic Message Syntax 1174 SubjectKeyIdentifier, IssuerAndSerialNumber, 1175 RecipientKeyIdentifier 1176 FROM CryptographicMessageSyntax 1177 { iso(1) member-body(2) us(840) rsadsi(113549) 1178 pkcs(1) pkcs-9(9) smime(16) modules(0) cms(1) }; 1180 -- id-aa is the arc with all new authenticated and unauthenticated 1181 attributes 1182 -- produced the by S/MIME Working Group 1184 id-aa OBJECT IDENTIFIER ::= {iso(1) member-body(2) usa(840) 1185 rsadsi(113549) 1186 pkcs(1) pkcs-9(9) smime(16) attributes(2)} 1188 -- S/MIME Capabilities provides a method of broadcasting the symetric 1189 capabilities 1190 -- understood. Algorithms should be ordered by preference and 1191 grouped 1192 by type 1194 smimeCapabilities OBJECT IDENTIFIER ::= 1195 {iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) pkcs-9(9) 15} 1197 SMIMECapability ::= SEQUENCE { 1198 capabilityID OBJECT IDENTIFIER, 1199 parameters ANY DEFINED BY capabilityID OPTIONAL } 1201 SMIMECapabilities ::= SEQUENCE OF SMIMECapability 1203 -- Encryption Key Preference provides a method of broadcasting the 1204 prefered 1205 -- encryption certificate. 1207 id-aa-encrypKeyPref OBJECT IDENTIFIER ::= {id-aa 11} 1209 SMIMEEncryptionKeyPreference ::= CHOICE { 1210 issuerAndSerialNumber [0] IssuerAndSerialNumber, 1211 receipentKeyId [1] RecipientKeyIdentifier, 1212 subjectAltKeyIdentifier [2] SubjectKeyIdentifier 1213 } 1215 -- The Content Encryption Algorithms defined for SMIME are: 1217 -- Triple-DES is the manditory algorithm with CBCParameter being the 1218 parameters 1220 dES-EDE3-CBC OBJECT IDENTIFIER ::= 1221 {iso(1) member-body(2) us(840) rsadsi(113549) 1222 encryptionAlgorithm(3) 7} 1224 CBCParameter ::= IV 1226 IV ::= OCTET STRING (SIZE (8..8)) 1228 -- RC2 (or compatable) is an optional algorithm w/ RC2-CBC-paramter 1229 as the 1230 parameter 1232 rC2-CBC OBJECT IDENTIFIER ::= 1233 {iso(1) member-body(2) us(840) rsadsi(113549) 1234 encryptionAlgorithm(3) 2} 1236 -- For the effective-key-bits (key size) greater than 32 and less than 1237 -- 256, the RC2-CBC algorithm parameters are encoded as: 1239 RC2-CBC-parameter ::= SEQUENCE { 1240 rc2ParameterVersion INTEGER, 1241 iv IV} 1243 -- For the effective-key-bits of 40, 64, and 128, the 1244 rc2ParameterVersion 1245 -- values are 160, 120, 58 respectively. 1247 -- The following list the OIDs to be used with S/MIME V3 1249 -- Digest Algorithms: 1251 -- md5 OBJECT IDENTIFIER ::= 1252 -- {iso(1) member-body(2) us(840) rsadsi(113549) 1253 digestAlgorithm(2) 5} 1255 -- sha-1 OBJECT IDENTIFIER ::= 1256 --- {iso(1) identified-organization(3) oiw(14) secsig(3) 1257 algorithm(2) 1258 -- 26} 1260 -- Asymmetric Encryption Algorithms 1261 -- 1262 -- rsaEncryption OBJECT IDENTIFIER ::= 1263 -- {iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) pkcs-1(1) 1264 1} 1265 -- 1266 -- rsa OBJECT IDENTIFIER ::= 1267 -- {joint-iso-ccitt(2) ds(5) algorithm(8) encryptionAlgorithm(1) 1} 1268 -- 1269 -- id-dsa OBJECT IDENTIFIER ::= 1270 -- {iso(1) member-body(2) us(840) x9-57(10040) x9cm(4) 1 } 1272 -- Signature Algorithms 1273 -- 1274 -- md2WithRSAEncryption OBJECT IDENTIFIER ::= 1275 -- {iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) pkcs-1(1) 1276 2} 1277 -- 1278 -- md5WithRSAEncryption OBJECT IDENTIFIER ::= 1279 -- {iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) pkcs-1(1) 1280 4} 1281 -- 1282 -- sha-1WithRSAEncryption OBJECT IDENTIFIER ::= 1283 -- {iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) pkcs-1(1) 1284 5} 1285 -- 1286 -- id-dsa-with-sha1 OBJECT IDENTIFIER ::= 1287 -- {iso(1) member-body(2) us(840) x9-57(10040) x9cm(4) 3} 1289 -- Other Signed Attributes 1290 -- 1291 -- signingTime OBJECT IDENTIFIER ::= 1292 -- {iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) pkcs-9(9) 1293 5} 1294 -- See [CMS] for a description of how to encode the attribute 1295 value. 1297 END 1299 B. References 1301 [3DES] ANSI X9.52-1998, "Triple Data Encryption Algorithm Modes of 1302 Operation", American National Standards Institute, 1998. 1304 [CERT3] "S/MIME Version 3 Certificate Handling", Internet Draft draft- 1305 ietf-smime-cert-*.txt. 1307 [CHARSETS] Character sets assigned by IANA. See . 1310 [CMS] "Cryptographic Message Syntax", Internet Draft draft-ietf-smime- 1311 cms-*.txt. 1313 [CONTDISP] "Communicating Presentation Information in Internet 1314 Messages: The Content-Disposition Header Field", RFC 2183 1316 [DES] ANSI X3.106, "American National Standard for Information Systems- 1317 Data Link Encryption," American National Standards Institute, 1983. 1319 [DH] "Diffie-Hellman Key Agreement Method", Internet Draft draft-ietf- 1320 smime-x942-*.txt 1322 [DSS] NIST FIPS PUB 186, "Digital Signature Standard", 18 May 1994. 1324 [ESS] "Enhanced Security Services for S/MIME", Internet draft, draft- 1325 ietf-smime-ess-*.txt. 1327 [MD5] "The MD5 Message Digest Algorithm", RFC 1321 1329 [MIME-SPEC] The primary definition of MIME. "MIME Part 1: Format of 1330 Internet Message Bodies", RFC 2045; "MIME Part 2: Media Types", RFC 1331 2046; "MIME Part 3: Message Header Extensions for Non-ASCII Text", RFC 1332 2047; "MIME Part 4: Registration Procedures", RFC 2048; "MIME Part 5: 1333 Conformance Criteria and Examples", RFC 2049 1335 [MIME-SECURE] "Security Multiparts for MIME: Multipart/Signed and 1336 Multipart/Encrypted", RFC 1847 1338 [MUSTSHOULD] "Key words for use in RFCs to Indicate Requirement 1339 Levels", RFC 2119 1341 [PKCS-1] "PKCS #1: RSA Encryption Version 1.5", RFC 2313 1343 [PKCS-7] "PKCS #7: Cryptographic Message Syntax Version 1.5", RFC 2315 1345 [RANDOM] "Randomness Recommendations for Security", RFC 1750 1347 [RC2] "A Description of the RC2 (r) Encryption Algorithm", RFC 2268 1349 [SHA1] NIST FIPS PUB 180-1, "Secure Hash Standard," National Institute 1350 of Standards and Technology, U.S. Department of Commerce, DRAFT, 31May 1351 1994. 1353 [SMIMEV2] "S/MIME Version 2 Message Specification", RFC 2311 1355 C. Acknowledgements 1357 Many thanks go out to the other authors of the S/MIME Version 2 1358 Message Specification RFC: Steve Dusse, Paul Hoffman, Laurence 1359 Lundblade and Lisa Repka. Without v2, there wouldn't be a v3. 1361 A number of the members of the S/MIME Working Group have also worked 1362 very hard and contributed to this document. Any list of people is 1363 doomed to omission, and for that I apologize. In alphabetical order, 1364 the following people stand out in my mind due to the fact that they 1365 made direct contributions to this document. 1367 Dave Crocker 1368 Bill Flanigan 1369 Paul Hoffman 1370 Russ Housley 1371 John Pawling 1372 Jim Schaad 1374 D. Changes from last draft 1376 Changed section 1.3 to contain correct reference language for 1377 MUSTSHOULD (Thomas Narten) 1378 Renumbered section F to section E (Blake Ramsdell) 1379 Changed section E to update author's address (Blake Ramsdell) 1380 Changed in section C to actual list (Blake Ramsdell) 1382 E. Editor�s address 1384 Blake Ramsdell 1385 Worldtalk 1386 17720 NE 65th St Ste 201 1387 Redmond, WA 98052 1388 +1 425 376 0225 1389 blaker@deming.com