idnits 2.17.1 draft-ietf-smime-msg-05.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- ** Cannot find the required boilerplate sections (Copyright, IPR, etc.) in this document. Expected boilerplate is as follows today (2024-04-24) according to https://trustee.ietf.org/license-info : IETF Trust Legal Provisions of 28-dec-2009, Section 6.a: This Internet-Draft is submitted in full conformance with the provisions of BCP 78 and BCP 79. IETF Trust Legal Provisions of 28-dec-2009, Section 6.b(i), paragraph 2: Copyright (c) 2024 IETF Trust and the persons identified as the document authors. All rights reserved. IETF Trust Legal Provisions of 28-dec-2009, Section 6.b(i), paragraph 3: This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (https://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. 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 seems to lack a 1id_guidelines paragraph about Internet-Drafts being working documents. ** The document seems to lack a 1id_guidelines paragraph about the list of current Internet-Drafts. ** The document seems to lack a 1id_guidelines paragraph about the list of Shadow Directories. ** The document is more than 15 pages and seems to lack a Table of Contents. == 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 1337 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 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 88: '...draft, the terms MUST, MUST NOT, SHOUL...' RFC 2119 keyword, line 155: '...Sending and receiving agents MUST support SHA-1 [SHA1]. Receiving...' RFC 2119 keyword, line 156: '...agents SHOULD support MD5 [MD5] for the purpose of providing backward...' RFC 2119 keyword, line 161: '...Sending and receiving agents MUST support id-dsa defined in [DSS]....' RFC 2119 keyword, line 162: '...rithm parameters MUST be absent (not e...' (91 more instances...) Miscellaneous warnings: ---------------------------------------------------------------------------- == Line 89 has weird spacing: '...s. This confo...' == Line 861 has weird spacing: '...gnature is "....' == Line 903 has weird spacing: '...y other unkn...' == Using lowercase 'not' together with uppercase 'MUST', 'SHALL', 'SHOULD', or 'RECOMMENDED' is not an accepted usage according to RFC 2119. Please use uppercase 'NOT' together with RFC 2119 keywords (if that is what you mean). Found 'MUST not' in this paragraph: Including a file name serves two purposes. It facilitates easier use of S/MIME objects as files on disk. It also can convey type information across gateways. When a MIME entity of type application/pkcs7-mime (for example) arrives at a gateway that has no special knowledge of S/MIME, it will default the entity's MIME type to application/octet-stream and treat it as a generic attachment, thus losing the type information. However, the suggested filename for an attachment is often carried across a gateway. This often allows the receiving systems to determine the appropriate application to hand the attachment off to, in this case a stand-alone S/MIME processing application. Note that this mechanism is provided as a convenience for implementations in certain environments. A proper S/MIME implementation MUST use the MIME types and MUST not rely on the file extensions. -- 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 (August 6, 1998) is 9393 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 1218 looks like a reference -- Missing reference section? 'CMS' on line 1198 looks like a reference -- Missing reference section? 'PKCS-7' on line 1232 looks like a reference -- Missing reference section? 'MIME-SECURE' on line 1224 looks like a reference -- Missing reference section? 'MUSTSHOULD' on line 1227 looks like a reference -- Missing reference section? 'SHA1' on line 1236 looks like a reference -- Missing reference section? 'MD5' on line 1216 looks like a reference -- Missing reference section? 'DSS' on line 1209 looks like a reference -- Missing reference section? 'PKCS-1' on line 1230 looks like a reference -- Missing reference section? 'DH' on line 1207 looks like a reference -- Missing reference section? '3DES' on line 1189 looks like a reference -- Missing reference section? 'DES' on line 1204 looks like a reference -- Missing reference section? 'RC2' on line 1234 looks like a reference -- Missing reference section? 'ESS' on line 1213 looks like a reference -- Missing reference section? 'CHARSETS' on line 1195 looks like a reference -- Missing reference section? 'CONTDISP' on line 1201 looks like a reference -- Missing reference section? 'SMIMEV2' on line 1244 looks like a reference -- Missing reference section? 'CERT3' on line 1192 looks like a reference -- Missing reference section? '0' on line 1111 looks like a reference -- Missing reference section? '1' on line 1112 looks like a reference -- Missing reference section? '2' on line 1113 looks like a reference Summary: 9 errors (**), 0 flaws (~~), 6 warnings (==), 23 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-05.txt Worldtalk 3 August 6, 1998 4 Expires in six months 6 S/MIME Version 3 Message Specification 8 Status of this memo 10 This document is an Internet-Draft. Internet-Drafts are working 11 documents of the Internet Engineering Task Force (IETF), its areas, 12 and its working groups. Note that other groups may also distribute 13 working documents as Internet-Drafts. 15 Internet-Drafts are draft documents valid for a maximum of six months 16 and may be updated, replaced, or obsoleted by other documents at any 17 time. It is inappropriate to use Internet-Drafts as reference material 18 or to cite them other than as "work in progress." 20 To view the entire list of current Internet-Drafts, please check the 21 "1id-abstracts.txt" listing contained in the Internet-Drafts Shadow 22 Directories on ftp.is.co.za (Africa), ftp.nordu.net (Northern Europe), 23 ftp.nis.garr.it (Southern Europe), munnari.oz.au (Pacific Rim), 24 ftp.ietf.org (US East Coast), or ftp.isi.edu (US West Coast). 26 1. Introduction 28 S/MIME (Secure/Multipurpose Internet Mail Extensions) provides a 29 consistent way to send and receive secure MIME data. Based on the 30 popular Internet MIME standard, S/MIME provides the following 31 cryptographic security services for electronic messaging applications: 32 authentication, message integrity and non-repudiation of origin (using 33 digital signatures) and privacy and data security (using encryption). 35 S/MIME can be used by traditional mail user agents (MUAs) to add 36 cryptographic security services to mail that is sent, and to interpret 37 cryptographic security services in mail that is received. However, 38 S/MIME is not restricted to mail; it can be used with any transport 39 mechanism that transports MIME data, such as HTTP. As such, S/MIME 40 takes advantage of the object-based features of MIME and allows secure 41 messages to be exchanged in mixed-transport systems. 43 Further, S/MIME can be used in automated message transfer agents that 44 use cryptographic security services that do not require any human 45 intervention, such as the signing of software-generated documents and 46 the encryption of FAX messages sent over the Internet. 48 1.1 Specification Overview 50 This document describes a protocol for adding cryptographic signature 51 and encryption services to MIME data. The MIME standard [MIME-SPEC] 52 provides a general structure for the content type of Internet messages 53 and allows extensions for new content type applications. 55 This draft defines how to create a MIME body part that has been 56 cryptographically enhanced according to CMS [CMS], which is derived 57 from PKCS #7 [PKCS-7]. This draft also defines the application/pkcs7- 58 mime MIME type that can be used to transport those body parts. 60 This draft also discusses how to use the multipart/signed MIME type 61 defined in [MIME-SECURE] to transport S/MIME signed messages. This 62 draft also defines the application/pkcs7-signature MIME type, which is 63 also used to transport S/MIME signed messages. 65 In order to create S/MIME messages, an agent has to follow 66 specifications in this draft, as well as the specifications listed in 67 the Cryptographic Message Syntax [CMS]. 69 Throughout this draft, there are requirements and recommendations made 70 for how receiving agents handle incoming messages. There are separate 71 requirements and recommendations for how sending agents create 72 outgoing messages. In general, the best strategy is to "be liberal in 73 what you receive and conservative in what you send". Most of the 74 requirements are placed on the handling of incoming messages while the 75 recommendations are mostly on the creation of outgoing messages. 77 The separation for requirements on receiving agents and sending agents 78 also derives from the likelihood that there will be S/MIME systems 79 that involve software other than traditional Internet mail clients. 80 S/MIME can be used with any system that transports MIME data. An 81 automated process that sends an encrypted message might not be able to 82 receive an encrypted message at all, for example. Thus, the 83 requirements and recommendations for the two types of agents are 84 listed separately when appropriate. 86 1.2 Terminology 88 Throughout this draft, the terms MUST, MUST NOT, SHOULD, and SHOULD 89 NOT are used in capital letters. This conforms to the definitions in 90 [MUSTSHOULD]. [MUSTSHOULD] defines the use of these key words to help 91 make the intent of standards track documents as clear as possible. The 92 same key words are used in this document to help implementors achieve 93 interoperability. 95 1.3 Definitions 97 For the purposes of this draft, the following definitions apply. 99 ASN.1: Abstract Syntax Notation One, as defined in CCITT X.208. 101 BER: Basic Encoding Rules for ASN.1, as defined in CCITT X.209. 103 Certificate: A type that binds an entity's distinguished name to a 104 public key with a digital signature. 106 DER: Distinguished Encoding Rules for ASN.1, as defined in CCITT 107 X.509. 109 7-bit data: Text data with lines less than 998 characters long, where 110 none of the characters have the 8th bit set, and there are no NULL 111 characters. and occur only as part of a end of line 112 delimiter. 114 8-bit data: Text data with lines less than 998 characters, and where 115 none of the characters are NULL characters. and occur only 116 as part of a end of line delimiter. 118 Binary data: Arbitrary data. 120 Transfer Encoding: A reversible transformation made on data so 8-bit 121 or binary data may be sent via a channel that only transmits 7-bit 122 data. 124 1.4 Compatibility with Prior Practice of S/MIME 126 S/MIME version 3 agents should attempt to have the greatest 127 interoperability possible with S/MIME version 2 agents. S/MIME version 128 2 is described in RFC 2311 through RFC 2315, inclusive. RFC 2311 also 129 has historical information about the development of S/MIME. 131 1.5 Discussion of This Draft 133 This draft is being discussed on the "ietf-smime" mailing list. To 134 subscribe, send a message to: 136 ietf-smime-request@imc.org 138 with the single word 140 subscribe 142 in the body of the message. There is a Web site for the mailing list 143 at . 145 2. CMS Options 147 CMS allows for a wide variety of options in content and algorithm 148 support. This section puts forth a number of support requirements and 149 recommendations in order to achieve a base level of interoperability 150 among all S/MIME implementations. [CMS] provides additional details 151 regarding the use of the cryptographic algorithms. 153 2.1 DigestAlgorithmIdentifier 155 Sending and receiving agents MUST support SHA-1 [SHA1]. Receiving 156 agents SHOULD support MD5 [MD5] for the purpose of providing backward 157 compatibility with MD5-digested S/MIME v2 SignedData objects. 159 2.2 SignatureAlgorithmIdentifier 161 Sending and receiving agents MUST support id-dsa defined in [DSS]. 162 The algorithm parameters MUST be absent (not encoded as NULL). 164 Receiving agents SHOULD support rsaEncryption, defined in [PKCS-1]. 166 Sending agents SHOULD support rsaEncryption. Outgoing messages are 167 signed with a user's private key. The size of the private key is 168 determined during key generation. 170 2.3 KeyEncryptionAlgorithmIdentifier 172 Sending and receiving agents MUST support Diffie-Hellman defined in 173 [DH]. 175 Receiving agents SHOULD support rsaEncryption. Incoming encrypted 176 messages contain symmetric keys which are to be decrypted with a 177 user's private key. The size of the private key is determined during 178 key generation. 180 Sending agents SHOULD support rsaEncryption. 182 2.4 General Syntax 184 CMS defines multiple content types. Of these, only the Data, 185 SignedData, and EnvelopedData content types are currently used for 186 S/MIME. 188 2.4.1 Data Content Type 190 Sending agents MUST use the id-data content type identifier to 191 indicate the message content which has had security services applied 192 to it. For example, when applying a digital signature to MIME data, 193 the CMS signedData encapContentInfo eContentType MUST include the id- 194 data object identifier and the MIME content MUST be stored in the 195 SignedData encapContentInfo eContent OCTET STRING. As another 196 example, when applying encryption to MIME data, the CMS EnvelopedData 197 encryptedContentInfo ContentType MUST include the id-data object 198 identifier and the encrypted MIME content MUST be stored in the 199 envelopedData encryptedContentInfo encryptedContent OCTET STRING. 201 2.4.2 SignedData Content Type 203 Sending agents MUST use the signedData content type to apply a digital 204 signature to a message or, in a degenerate case where there is no 205 signature information, to convey certificates. 207 2.4.3 EnvelopedData Content Type 209 This content type is used to apply privacy protection to a message. A 210 sender needs to have access to a public key for each 211 intended message recipient to use this service. This content type does 212 not provide authentication. 214 2.5 Attribute SignerInfo Type 216 The SignerInfo type allows the inclusion of unsigned and signed 217 attributes to be included along with a signature. 219 Receiving agents MUST be able to handle zero or one instance of each 220 of the signed attributes described in this section. 222 Sending agents SHOULD be able to generate one instance of each of the 223 signed attributes described in this section, and SHOULD include the 224 signing time and SMIMECapabilities attribute in each signed message 225 sent. 227 Additional attributes and values for these attributes may be defined 228 in the future. Receiving agents SHOULD handle attributes or values 229 that it does not recognize in a graceful manner. 231 Sending agents that include attributes that are not listed here SHOULD 232 display those attributes to the user, so that the user is aware of all 233 of the data being signed. 235 2.5.1 Signing-Time Attribute 237 The signing-time attribute is used to convey the time that a message 238 was signed. Until there are trusted timestamping services, the time of 239 signing will most likely be created by a message originator and 240 therefore is only as trustworthy as the originator. 242 Sending agents MUST encode signing time through the year 2049 as 243 UTCTime; signing times in 2050 or later MUST be encoded as 244 GeneralizedTime. When the UTCTime CHOICE is used, agents MUST 245 interpret the year field (YY) as follows: 247 if YY is greater than or equal to 50, the year is interpreted as 19YY; 248 if YY is less than 50, the year is interpreted as 20YY. 250 2.5.2 SMIMECapabilities Attribute 252 The SMIMECapabilities attribute includes signature algorithms (such as 253 "md5WithRSAEncryption"), symmetric algorithms (such as "DES-CBC"), and 254 key encipherment algorithms (such as "rsaEncryption"). It also 255 includes a non-algorithm capability which is the preference for 256 signedData. The SMIMECapabilities were designed to be flexible and 257 extensible so that, in the future, a means of identifying other 258 capabilities and preferences such as certificates can be added in a 259 way that will not cause current clients to break. 261 If present, the SMIMECapabilities attribute MUST be a SignedAttribute; 262 it MUST NOT be an UnsignedAttribute. CMS defines SignedAttributes as a 263 SET OF Attribute. The SignedAttributes in a signerInfo MUST NOT 264 include multiple instances of the SMIMECapabilities attribute. CMS 265 defines the ASN.1 syntax for Attribute to include attrValues SET OF 266 AttributeValue. A SMIMECapabilities attribute MUST only include a 267 single instance of AttributeValue. There MUST NOT be zero or multiple 268 instances of AttributeValue present in the attrValues SET OF 269 AttributeValue. 271 The semantics of the SMIMECapabilites attribute specify a partial list 272 as to what the client announcing the SMIMECapabilites can support. A 273 client does not have to list every capability it supports, and 274 probably should not list all its capabilities so that the capabilities 275 list doesn't get too long. In an SMIMECapabilities attribute, the OIDs 276 are listed in order of their preference, but SHOULD be logically 277 separated along the lines of their categories (signature algorithms, 278 symmetric algorithms, key encipherment algorithms, etc.) 280 The structure of the SMIMECapabilities attribute is to facilitate 281 simple table lookups and binary comparisons in order to determine 282 matches. For instance, the DER-encoding for the SMIMECapability for 283 DES EDE3 CBC MUST be identically encoded regardless of the 284 implementation. 286 In the case of symmetric algorithms, the associated parameters for the 287 OID MUST specify all of the parameters necessary to differentiate 288 between two instances of the same algorithm. For instance, the number 289 of rounds and block size for RC5 must be specified in addition to the 290 key length. 292 There is a list of OIDs (the registered SMIMECapabilities list) that 293 is centrally maintained and is separate from this draft. The list of 294 OIDs is maintained by the Internet Mail Consortium at 295 . 297 The OIDs that correspond to algorithms SHOULD use the same OID as the 298 actual algorithm, except in the case where the algorithm usage is 299 ambiguous from the OID. For instance, in an earlier draft, 300 rsaEncryption was ambiguous because it could refer to either a 301 signature algorithm or a key encipherment algorithm. In the event that 302 an OID is ambiguous, it needs to be arbitrated by the maintainer of 303 the registered SMIMECapabilities list as to which type of algorithm 304 will use the OID, and a new OID MUST be allocated under the 305 smimeCapabilities OID to satisfy the other use of the OID. 307 The registered SMIMECapabilities list specifies the parameters for 308 OIDs that need them, most notably key lengths in the case of variable- 309 length symmetric ciphers. In the event that there are no 310 differentiating parameters for a particular OID, the parameters MUST 311 be omitted, and MUST NOT be encoded as NULL. 313 Additional values for the SMIMECapabilities attribute may be defined 314 in the future. Receiving agents MUST handle a SMIMECapabilities object 315 that has values that it does not recognize in a graceful manner. 317 2.5.3 Encryption Key Preference Attribute 319 The encryption key preference attribute allows for the signer to 320 unambiguously describe which of the certificates issued to the signer 321 should be used when sending encrypted content. This attribute allows 322 for the signer to state a preference, but not a requirement, as to the 323 certificate to be used. This attribute is designed to enhance 324 behavior for interoperating with those clients which use separate keys 325 for encryption and signing. This attribute is used to convey to the 326 receiver which of the certificates should be used for encrypting the 327 session key. 329 If present, the SMIMEEncryptionKeyPreference attribute MUST be a 330 SignedAttribute; it MUST NOT be an UnsignedAttribute. CMS defines 331 SignedAttributes as a SET OF Attribute. The SignedAttributes in a 332 signerInfo MUST NOT include multiple instances of the 333 SMIMEEncryptionKeyPreference attribute. CMS defines the ASN.1 syntax 334 for Attribute to include attrValues SET OF AttributeValue. A 335 SMIMEEncryptionKeyPreference attribute MUST only include a single 336 instance of AttributeValue. There MUST NOT be zero or multiple 337 instances of AttributeValue present in the attrValues SET OF 338 AttributeValue. 340 The sending agent SHOULD include the referenced certificate in the set 341 of certificates included in the signed message if this attribute is 342 used. The certificate may be omitted if it has been previously made 343 available to the receiving agent. Sending agents SHOULD use this 344 attribute if the commonly used or preferred encryption certificate is 345 not the same as the certificate used to sign the message. 347 Receiving agents SHOULD store the preference data if the signature on 348 the message is valid and the signing time is greater than the 349 currently stored value. (As with the SMIMECapabilities, the clock 350 skew should be checked and the data not used if the skew is to great.) 351 Receiving agents SHOULD respect the senders encryption key preference 352 attribute if possible. This however represents only a preference and 353 the receiving agent may use any certificate in replying to the sender 354 that is valid. 356 2.5.3.1 Selection of Recipient Key Management Certificate 358 In order to determine the key management certificate to be used when 359 sending a CMS envelopedData message for a particular recipient, the 360 following steps SHOULD be followed: 362 - If an SMIMEEncryptionKeyPreference attribute is found in a 363 signedData object received from the desired recipient, this identifies 364 the X.509 certificate that should be used as the X.509 key management 365 certificate for the recipient. 367 - If an SMIMEEncryptionKeyPreference attribute is not found in a 368 signedData object received from the desired recipient, the set of 369 X.509 certificates should be searched for a X.509 certificate with the 370 same subject name as the signing X.509 certificate which can be used 371 for key management. 373 - Or use some other method of determining the user's key management 374 key. If a X.509 key management certificate is not found, then 375 encryption cannot be done with the signer of the message. If multiple 376 X.509 key management certificates are found, the S/MIME agent can make 377 an arbitrary choice between them. 379 2.6 ContentEncryptionAlgorithmIdentifier 381 Sending and receiving agents MUST support encryption and decryption 382 with DES EDE3 CBC, hereinafter called "tripleDES" [3DES] [DES]. 383 Receiving agents SHOULD support encryption and decryption using the 384 RC2 [RC2] or a compatible algorithm at a key size of 40 bits, 385 hereinafter called "RC2/40". 387 2.6.1 Deciding Which Encryption Method To Use 389 When a sending agent creates an encrypted message, it has to decide 390 which type of encryption to use. The decision process involves using 391 information garnered from the capabilities lists included in messages 392 received from the recipient, as well as out-of-band information such 393 as private agreements, user preferences, legal restrictions, and so 394 on. 396 Section 2.5 defines a method by which a sending agent can optionally 397 announce, among other things, its decrypting capabilities in its order 398 of preference. The following method for processing and remembering the 399 encryption capabilities attribute in incoming signed messages SHOULD 400 be used. 402 - If the receiving agent has not yet created a list of capabilities 403 for the sender's public key, then, after verifying the signature 404 on the incoming message and checking the timestamp, the receiving 405 agent SHOULD create a new list containing at least the signing 406 time and the symmetric capabilities. 407 - If such a list already exists, the receiving agent SHOULD verify 408 that the signing time in the incoming message is greater than 409 the signing time stored in the list and that the signature is 410 valid. If so, the receiving agent SHOULD update both the signing 411 time and capabilities in the list. Values of the signing time that 412 lie far in the future (that is, a greater discrepancy than any 413 reasonable clock skew), or a capabilities list in messages whose 414 signature could not be verified, MUST NOT be accepted. 416 The list of capabilities SHOULD be stored for future use in creating 417 messages. 419 Before sending a message, the sending agent MUST decide whether it is 420 willing to use weak encryption for the particular data in the message. 421 If the sending agent decides that weak encryption is unacceptable for 422 this data, then the sending agent MUST NOT use a weak algorithm such 423 as RC2/40. The decision to use or not use weak encryption overrides 424 any other decision in this section about which encryption algorithm to 425 use. 427 Sections 2.6.2.1 through 2.6.2.4 describe the decisions a sending 428 agent SHOULD use in deciding which type of encryption should be 429 applied to a message. These rules are ordered, so the sending agent 430 SHOULD make its decision in the order given. 432 2.6.1.1 Rule 1: Known Capabilities 434 If the sending agent has received a set of capabilities from the 435 recipient for the message the agent is about to encrypt, then the 436 sending agent SHOULD use that information by selecting the first 437 capability in the list (that is, the capability most preferred by the 438 intended recipient) for which the sending agent knows how to encrypt. 439 The sending agent SHOULD use one of the capabilities in the list if 440 the agent reasonably expects the recipient to be able to decrypt the 441 message. 443 2.6.1.2 Rule 2: Unknown Capabilities, Known Use of Encryption 445 If: 446 - the sending agent has no knowledge of the encryption capabilities 447 of the recipient, 448 - and the sending agent has received at least one message from the 449 recipient, 450 - and the last encrypted message received from the recipient had a 451 trusted signature on it, 452 then the outgoing message SHOULD use the same encryption algorithm as 453 was used on the last signed and encrypted message received from the 454 recipient. 456 2.6.1.3 Rule 3: Unknown Capabilities, Unknown Version of S/MIME 458 If: 459 - the sending agent has no knowledge of the encryption capabilities 460 of the recipient, 461 - and the sending agent has no knowledge of the version of S/MIME 462 of the recipient, 463 then the sending agent SHOULD use tripleDES because it is a stronger 464 algorithm and is required by S/MIME v3. If the sending agent chooses 465 not to use tripleDES in this step, it SHOULD use RC2/40. 467 2.6.2 Choosing Weak Encryption 469 Like all algorithms that use 40 bit keys, RC2/40 is considered by many 470 to be weak encryption. A sending agent that is controlled by a human 471 SHOULD allow a human sender to determine the risks of sending data 472 using RC2/40 or a similarly weak encryption algorithm before sending 473 the data, and possibly allow the human to use a stronger encryption 474 method such as tripleDES. 476 2.6.3 Multiple Recipients 478 If a sending agent is composing an encrypted message to a group of 479 recipients where the encryption capabilities of some of the recipients 480 do not overlap, the sending agent is forced to send more than one 481 message. It should be noted that if the sending agent chooses to send 482 a message encrypted with a strong algorithm, and then send the same 483 message encrypted with a weak algorithm, someone watching the 484 communications channel can decipher the contents of the strongly- 485 encrypted message simply by decrypting the weakly-encrypted message. 487 3. Creating S/MIME Messages 489 This section describes the S/MIME message formats and how they are 490 created. S/MIME messages are a combination of MIME bodies and CMS 491 objects. Several MIME types as well as several CMS objects are used. 492 The data to be secured is always a canonical MIME entity. The MIME 493 entity and other data, such as certificates and algorithm identifiers, 494 are given to CMS processing facilities which produces a CMS object. 495 The CMS object is then finally wrapped in MIME. The Enhanced Security 496 Services for S/MIME [ESS] document provides examples of how nested, 497 secured S/MIME messages are formatted. ESS provides an example of how 498 a triple-wrapped S/MIME message is formatted using multipart/signed 499 and application/pkcs7-mime for the signatures. 501 S/MIME provides one format for enveloped-only data, several formats 502 for signed-only data, and several formats for signed and enveloped 503 data. Several formats are required to accommodate several 504 environments, in particular for signed messages. The criteria for 505 choosing among these formats are also described. 507 The reader of this section is expected to understand MIME as described 508 in [MIME-SPEC] and [MIME-SECURE]. 510 3.1 Preparing the MIME Entity for Signing or Enveloping 512 S/MIME is used to secure MIME entities. A MIME entity may be a sub- 513 part, sub-parts of a message, or the whole message with all its sub- 514 parts. A MIME entity that is the whole message includes only the MIME 515 headers and MIME body, and does not include the RFC-822 headers. Note 516 that S/MIME can also be used to secure MIME entities used in 517 applications other than Internet mail. 519 The MIME entity that is secured and described in this section can be 520 thought of as the "inside" MIME entity. That is, it is the "innermost" 521 object in what is possibly a larger MIME message. Processing "outside" 522 MIME entities into CMS objects is described in Section 3.2, 3.4 and 523 elsewhere. 525 The procedure for preparing a MIME entity is given in [MIME-SPEC]. The 526 same procedure is used here with some additional restrictions when 527 signing. Description of the procedures from [MIME-SPEC] are repeated 528 here, but the reader should refer to that document for the exact 529 procedure. This section also describes additional requirements. 531 A single procedure is used for creating MIME entities that are to be 532 signed, enveloped, or both signed and enveloped. Some additional steps 533 are recommended to defend against known corruptions that can occur 534 during mail transport that are of particular importance for clear- 535 signing using the multipart/signed format. It is recommended that 536 these additional steps be performed on enveloped messages, or signed 537 and enveloped messages in order that the message can be forwarded to 538 any environment without modification. 540 These steps are descriptive rather than prescriptive. The implementor 541 is free to use any procedure as long as the result is the same. 543 Step 1. The MIME entity is prepared according to the local conventions 545 Step 2. The leaf parts of the MIME entity are converted to canonical 546 form 548 Step 3. Appropriate transfer encoding is applied to the leaves of the 549 MIME entity 551 When an S/MIME message is received, the security services on the 552 message are processed, and the result is the MIME entity. That MIME 553 entity is typically passed to a MIME-capable user agent where, it is 554 further decoded and presented to the user or receiving application. 556 3.1.1 Canonicalization 558 Each MIME entity MUST be converted to a canonical form that is 559 uniquely and unambiguously representable in the environment where the 560 signature is created and the environment where the signature will be 561 verified. MIME entities MUST be canonicalized for enveloping as well 562 as signing. 564 The exact details of canonicalization depend on the actual MIME type 565 and subtype of an entity, and are not described here. Instead, the 566 standard for the particular MIME type should be consulted. For 567 example, canonicalization of type text/plain is different from 568 canonicalization of audio/basic. Other than text types, most types 569 have only one representation regardless of computing platform or 570 environment which can be considered their canonical representation. In 571 general, canonicalization will be performed by the sending agent 572 rather than the S/MIME implementation. 574 The most common and important canonicalization is for text, which is 575 often represented differently in different environments. MIME entities 576 of major type "text" must have both their line endings and character 577 set canonicalized. The line ending must be the pair of characters 578 , and the charset should be a registered charset [CHARSETS]. 579 The details of the canonicalization are specified in [MIME-SPEC]. The 580 chosen charset SHOULD be named in the charset parameter so that 581 the receiving agent can unambiguously determine the charset used. 583 Note that some charsets such as ISO-2022 have multiple representations 584 for the same characters. When preparing such text for signing, the 585 canonical representation specified for the charset MUST be used. 587 3.1.2 Transfer Encoding 589 When generating any of the secured MIME entities below, except the 590 signing using the multipart/signed format, no transfer encoding at all 591 is required. S/MIME implementations MUST be able to deal with binary 592 MIME objects. If no Content-Transfer-Encoding header is present, the 593 transfer encoding should be considered 7BIT. 595 S/MIME implementations SHOULD however use transfer encoding described 596 in section 3.1.3 for all MIME entities they secure. The reason for 597 securing only 7-bit MIME entities, even for enveloped data that are 598 not exposed to the transport, is that it allows the MIME entity to be 599 handled in any environment without changing it. For example, a trusted 600 gateway might remove the envelope, but not the signature, of a 601 message, and then forward the signed message on to the end recipient 602 so that they can verify the signatures directly. If the transport 603 internal to the site is not 8-bit clean, such as on a wide-area 604 network with a single mail gateway, verifying the signature will not 605 be possible unless the original MIME entity was only 7-bit data. 607 3.1.3 Transfer Encoding for Signing Using multipart/signed 609 If a multipart/signed entity is EVER to be transmitted over the 610 standard Internet SMTP infrastructure or other transport that is 611 constrained to 7-bit text, it MUST have transfer encoding applied so 612 that it is represented as 7-bit text. MIME entities that are 7-bit 613 data already need no transfer encoding. Entities such as 8-bit text 614 and binary data can be encoded with quoted-printable or base-64 615 transfer encoding. 617 The primary reason for the 7-bit requirement is that the Internet mail 618 transport infrastructure cannot guarantee transport of 8-bit or binary 619 data. Even though many segments of the transport infrastructure now 620 handle 8-bit and even binary data, it is sometimes not possible to 621 know whether the transport path is 8-bit clear. If a mail message with 622 8-bit data were to encounter a message transfer agent that can not 623 transmit 8-bit or binary data, the agent has three options, none of 624 which are acceptable for a clear-signed message: 626 - The agent could change the transfer encoding; this would invalidate 627 the signature. 628 - The agent could transmit the data anyway, which would most likely 629 result in the 8th bit being corrupted; this too would invalidate the 630 signature. 631 - The agent could return the message to the sender. 633 [MIME-SECURE] prohibits an agent from changing the transfer encoding 634 of the first part of a multipart/signed message. If a compliant agent 635 that can not transmit 8-bit or binary data encounters a 636 multipart/signed message with 8-bit or binary data in the first part, 637 it would have to return the message to the sender as undeliverable. 639 3.1.4 Sample Canonical MIME Entity 641 This example shows a multipart/mixed message with full transfer 642 encoding. This message contains a text part and an attachment. The 643 sample message text includes characters that are not US-ASCII and thus 644 must be transfer encoded. Though not shown here, the end of each line 645 is . The line ending of the MIME headers, the text, and 646 transfer encoded parts, all must be . 648 Note that this example is not of an S/MIME message. 650 Content-Type: multipart/mixed; boundary=bar 652 --bar 653 Content-Type: text/plain; charset=iso-8859-1 654 Content-Transfer-Encoding: quoted-printable 656 =A1Hola Michael! 658 How do you like the new S/MIME specification? 660 I agree. It's generally a good idea to encode lines that begin 661 with 662 From=20because some mail transport agents will insert a greater- 663 than (>) sign, thus invalidating the signature. 665 Also, in some cases it might be desirable to encode any =20 666 trailing whitespace that occurs on lines in order to ensure =20 667 that the message signature is not invalidated when passing =20 668 a gateway that modifies such whitespace (like BITNET). =20 670 --bar 671 Content-Type: image/jpeg 672 Content-Transfer-Encoding: base64 674 iQCVAwUBMJrRF2N9oWBghPDJAQE9UQQAtl7LuRVndBjrk4EqYBIb3h5QXIX/LC// 675 jJV5bNvkZIGPIcEmI5iFd9boEgvpirHtIREEqLQRkYNoBActFBZmh9GC3C041WGq 676 uMbrbxc+nIs1TIKlA08rVi9ig/2Yh7LFrK5Ein57U/W72vgSxLhe/zhdfolT9Brn 677 HOxEa44b+EI= 679 --bar-- 681 3.2 The application/pkcs7-mime Type 683 The application/pkcs7-mime type is used to carry CMS objects of 684 several types including envelopedData and signedData. The details of 685 constructing these entities is described in subsequent sections. This 686 section describes the general characteristics of the application/pkcs7- 687 mime type. 689 The carried CMS object always contains a MIME entity that is prepared 690 as described in section 3.1 if the eContentType is id-data. Other 691 contents may be carried when the eContentType contains different 692 values. See [ESS] for an example of this with signed receipts. 694 Since CMS objects are binary data, in most cases base-64 transfer 695 encoding is appropriate, in particular when used with SMTP transport. 696 The transfer encoding used depends on the transport through which the 697 object is to be sent, and is not a characteristic of the MIME type. 699 Note that this discussion refers to the transfer encoding of the CMS 700 object or "outside" MIME entity. It is completely distinct from, and 701 unrelated to, the transfer encoding of the MIME entity secured by the 702 CMS object, the "inside" object, which is described in section 3.1. 704 Because there are several types of application/pkcs7-mime objects, a 705 sending agent SHOULD do as much as possible to help a receiving agent 706 know about the contents of the object without forcing the receiving 707 agent to decode the ASN.1 for the object. The MIME headers of all 708 application/pkcs7-mime objects SHOULD include the optional "smime- 709 type" parameter, as described in the following sections. 711 3.2.1 The name and filename Parameters 713 For the application/pkcs7-mime, sending agents SHOULD emit the 714 optional "name" parameter to the Content-Type field for compatibility 715 with older systems. Sending agents SHOULD also emit the optional 716 Content-Disposition field [CONTDISP] with the "filename" parameter. If 717 a sending agent emits the above parameters, the value of the 718 parameters SHOULD be a file name with the appropriate extension: 720 MIME Type File Extension 722 application/pkcs7-mime (signedData, .p7m 723 envelopedData) 725 application/pkcs7-mime (degenerate .p7c 726 signedData "certs-only" message) 728 application/pkcs7-signature .p7s 730 In addition, the file name SHOULD be limited to eight characters 731 followed by a three letter extension. The eight character filename 732 base can be any distinct name; the use of the filename base "smime" 733 SHOULD be used to indicate that the MIME entity is associated with 734 S/MIME. 736 Including a file name serves two purposes. It facilitates easier use 737 of S/MIME objects as files on disk. It also can convey type 738 information across gateways. When a MIME entity of type 739 application/pkcs7-mime (for example) arrives at a gateway that has no 740 special knowledge of S/MIME, it will default the entity's MIME type to 741 application/octet-stream and treat it as a generic attachment, thus 742 losing the type information. However, the suggested filename for an 743 attachment is often carried across a gateway. This often allows the 744 receiving systems to determine the appropriate application to hand the 745 attachment off to, in this case a stand-alone S/MIME processing 746 application. Note that this mechanism is provided as a convenience for 747 implementations in certain environments. A proper S/MIME 748 implementation MUST use the MIME types and MUST not rely on the file 749 extensions. 751 3.3 Creating an Enveloped-only Message 753 This section describes the format for enveloping a MIME entity without 754 signing it. It is important to note that sending enveloped but not 755 signed messages does not provide for data integrity. It is possible to 756 replace ciphertext in such a way that the processed message will still 757 be valid, but the meaning may be altered. 759 Step 1. The MIME entity to be enveloped is prepared according to 760 section 3.1. 762 Step 2. The MIME entity and other required data is processed into a 763 CMS object of type envelopedData. In addition to encrypting a copy of 764 the content-encryption key for each recipient, a copy of the content 765 encryption key SHOULD be encrypted for the originator and included in 766 the envelopedData (see CMS Section 6). 768 Step 3. The CMS object is inserted into an application/pkcs7-mime MIME 769 entity. 771 The smime-type parameter for enveloped-only messages is "enveloped- 772 data". The file extension for this type of message is ".p7m". 774 A sample message would be: 776 Content-Type: application/pkcs7-mime; smime-type=enveloped-data; 777 name=smime.p7m 778 Content-Transfer-Encoding: base64 779 Content-Disposition: attachment; filename=smime.p7m 781 rfvbnj756tbBghyHhHUujhJhjH77n8HHGT9HG4VQpfyF467GhIGfHfYT6 782 7n8HHGghyHhHUujhJh4VQpfyF467GhIGfHfYGTrfvbnjT6jH7756tbB9H 783 f8HHGTrfvhJhjH776tbB9HG4VQbnj7567GhIGfHfYT6ghyHhHUujpfyF4 784 0GhIGfHfQbnj756YT64V 786 3.4 Creating a Signed-only Message 788 There are two formats for signed messages defined for S/MIME: 789 application/pkcs7-mime with SignedData, and multipart/signed. In 790 general, the multipart/signed form is preferred for sending, and 791 receiving agents SHOULD be able to handle both. 793 3.4.1 Choosing a Format for Signed-only Messages 795 There are no hard-and-fast rules when a particular signed-only format 796 should be chosen because it depends on the capabilities of all the 797 receivers and the relative importance of receivers with S/MIME 798 facilities being able to verify the signature versus the importance of 799 receivers without S/MIME software being able to view the message. 801 Messages signed using the multipart/signed format can always be viewed 802 by the receiver whether they have S/MIME software or not. They can 803 also be viewed whether they are using a MIME-native user agent or they 804 have messages translated by a gateway. In this context, "be viewed" 805 means the ability to process the message essentially as if it were not 806 a signed message, including any other MIME structure the message might 807 have. 809 Messages signed using the signedData format cannot be viewed by a 810 recipient unless they have S/MIME facilities. However, if they have 811 S/MIME facilities, these messages can always be verified if they were 812 not changed in transit. 814 3.4.2 Signing Using application/pkcs7-mime with SignedData 816 This signing format uses the application/pkcs7-mime MIME type. The 817 steps to create this format are: 819 Step 1. The MIME entity is prepared according to section 3.1 821 Step 2. The MIME entity and other required data is processed into a 822 CMS object of type signedData 824 Step 3. The CMS object is inserted into an application/pkcs7-mime MIME 825 entity 827 The smime-type parameter for messages using application/pkcs7-mime 828 with SignedData is "signed-data". The file extension for this type of 829 message is ".p7m". 831 A sample message would be: 833 Content-Type: application/pkcs7-mime; smime-type=signed-data; 834 name=smime.p7m 835 Content-Transfer-Encoding: base64 836 Content-Disposition: attachment; filename=smime.p7m 838 567GhIGfHfYT6ghyHhHUujpfyF4f8HHGTrfvhJhjH776tbB9HG4VQbnj7 839 77n8HHGT9HG4VQpfyF467GhIGfHfYT6rfvbnj756tbBghyHhHUujhJhjH 840 HUujhJh4VQpfyF467GhIGfHfYGTrfvbnjT6jH7756tbB9H7n8HHGghyHh 841 6YT64V0GhIGfHfQbnj75 843 3.4.3 Signing Using the multipart/signed Format 845 This format is a clear-signing format. Recipients without any S/MIME 846 or CMS processing facilities are able to view the message. It makes 847 use of the multipart/signed MIME type described in [MIME-SECURE]. The 848 multipart/signed MIME type has two parts. The first part contains the 849 MIME entity that is signed; the second part contains the "detached 850 signature" CMS SignedData object in which the encapContentInfo 851 eContent field is absent. 853 3.4.3.1 The application/pkcs7-signature MIME Type 855 This MIME type always contains a single CMS object of type signedData. 856 The signedData encapContentInfo eContent field MUST be absent. The 857 signerInfos field contains the signatures for the MIME entity. The 858 details of the registered type are given in Appendix E. 860 The file extension for signed-only messages using application/pkcs7- 861 signature is ".p7s". 863 3.4.3.2 Creating a multipart/signed Message 865 Step 1. The MIME entity to be signed is prepared according to section 866 3.1, taking special care for clear-signing. 868 Step 2. The MIME entity is presented to CMS processing in order to 869 obtain an object of type signedData in which the encapContentInfo 870 eContent field is absent. 872 Step 3. The MIME entity is inserted into the first part of a 873 multipart/signed message with no processing other than that described 874 in section 3.1. 876 Step 4. Transfer encoding is applied to the "detached signature" CMS 877 SignedData object and it is inserted into a MIME entity of type 878 application/pkcs7-signature. 880 Step 5. The MIME entity of the application/pkcs7-signature is inserted 881 into the second part of the multipart/signed entity. 883 The multipart/signed Content type has two required parameters: the 884 protocol parameter and the micalg parameter. 886 The protocol parameter MUST be "application/pkcs7-signature". Note 887 that quotation marks are required around the protocol parameter 888 because MIME requires that the "/" character in the parameter value 889 MUST be quoted. 891 The micalg parameter allows for one-pass processing when the signature 892 is being verified. The value of the micalg parameter is dependent on 893 the message digest algorithm(s) used in the calculation of the Message 894 Integrity Check. If multiple message digest algorithms are used they 895 MUST be separated by commas per [MIME-SECURE]. The values to be placed 896 in the micalg parameter SHOULD be from the following: 898 Algorithm Value 899 used 901 MD5 md5 902 SHA-1 sha1 903 Any other unknown 905 (Historical note: some early implementations of S/MIME emitted and 906 expected "rsa-md5" and "rsa-sha1" for the micalg parameter.) Receiving 907 agents SHOULD be able to recover gracefully from a micalg parameter 908 value that they do not recognize. 910 3.4.3.3 Sample multipart/signed Message 912 Content-Type: multipart/signed; 913 protocol="application/pkcs7-signature"; 914 micalg=sha1; boundary=boundary42 916 --boundary42 917 Content-Type: text/plain 919 This is a clear-signed message. 921 --boundary42 922 Content-Type: application/pkcs7-signature; name=smime.p7s 923 Content-Transfer-Encoding: base64 924 Content-Disposition: attachment; filename=smime.p7s 926 ghyHhHUujhJhjH77n8HHGTrfvbnj756tbB9HG4VQpfyF467GhIGfHfYT6 927 4VQpfyF467GhIGfHfYT6jH77n8HHGghyHhHUujhJh756tbB9HGTrfvbnj 928 n8HHGTrfvhJhjH776tbB9HG4VQbnj7567GhIGfHfYT6ghyHhHUujpfyF4 929 7GhIGfHfYT64VQbnj756 931 --boundary42-- 933 3.5 Signing and Encrypting 935 To achieve signing and enveloping, any of the signed-only and 936 encrypted-only formats may be nested. This is allowed because the 937 above formats are all MIME entities, and because they all secure MIME 938 entities. 940 An S/MIME implementation MUST be able to receive and process 941 arbitrarily nested S/MIME within reasonable resource limits of the 942 recipient computer. 944 It is possible to either sign a message first, or to envelope the 945 message first. It is up to the implementor and the user to choose. 946 When signing first, the signatories are then securely obscured by the 947 enveloping. When enveloping first the signatories are exposed, but it 948 is possible to verify signatures without removing the enveloping. This 949 may be useful in an environment were automatic signature verification 950 is desired, as no private key material is required to verify a 951 signature. 953 There are security ramifications to choosing whether to sign first or 954 encrypt first. A recipient of a message that is encrypted and then 955 signed can validate that the encrypted block was unaltered, but cannot 956 determine any relationship between the signer and the unencrypted 957 contents of the message. A recipient of a message that is signed-then- 958 encrypted can assume that the signed message itself has not been 959 altered, but that a careful attacker may have changed the 960 unauthenticated portions of the encrypted message. 962 3.6 Creating a Certificates-only Message 964 The certificates only message or MIME entity is used to transport 965 certificates, such as in response to a registration request. This 966 format can also be used to convey CRLs. 968 Step 1. The certificates are made available to the CMS generating 969 process which creates a CMS object of type signedData. The signedData 970 encapContentInfo eContent field MUST be absent and signerInfos field 971 MUST be empty. 973 Step 2. The CMS signedData object is enclosed in an application/pkcs7- 974 mime MIME entity 976 The smime-type parameter for a certs-only message is "certs-only". 977 The file extension for this type of message is ".p7c". 979 3.7 Registration Requests 981 A sending agent that signs messages MUST have a certificate for the 982 signature so that a receiving agent can verify the signature. There 983 are many ways of getting certificates, such as through an exchange 984 with a certificate authority, through a hardware token or diskette, 985 and so on. 987 S/MIME v2 [SMIMEV2] specified a method for "registering" public keys 988 with certificate authorities using an application/pkcs10 body part. 989 The IETF's PKIX Working Group is preparing another method for 990 requesting certificates; however, that work was not finished at the 991 time of this draft. S/MIME v3 does not specify how to request a 992 certificate, but instead mandates that every sending agent already has 993 a certificate. Standardization of certificate management is being 994 pursued separately in the IETF. 996 3.8 Identifying an S/MIME Message 998 Because S/MIME takes into account interoperation in non-MIME 999 environments, several different mechanisms are employed to carry the 1000 type information, and it becomes a bit difficult to identify S/MIME 1001 messages. The following table lists criteria for determining whether 1002 or not a message is an S/MIME message. A message is considered an 1003 S/MIME message if it matches any below. 1005 The file suffix in the table below comes from the "name" parameter in 1006 the content-type header, or the "filename" parameter on the content- 1007 disposition header. These parameters that give the file suffix are not 1008 listed below as part of the parameter section. 1010 MIME type: application/pkcs7-mime 1011 parameters: any 1012 file suffix: any 1014 MIME type: multipart/signed 1015 parameters: protocol="application/pkcs7-signature" 1016 file suffix: any 1018 MIME type: application/octet-stream 1019 parameters: any 1020 file suffix: p7m, p7s, p7c 1022 4. Certificate Processing 1024 A receiving agent MUST provide some certificate retrieval mechanism in 1025 order to gain access to certificates for recipients of digital 1026 envelopes. This draft does not cover how S/MIME agents handle 1027 certificates, only what they do after a certificate has been validated 1028 or rejected. S/MIME certification issues are covered in [CERT3]. 1030 At a minimum, for initial S/MIME deployment, a user agent could 1031 automatically generate a message to an intended recipient requesting 1032 that recipient's certificate in a signed return message. Receiving and 1033 sending agents SHOULD also provide a mechanism to allow a user to 1034 "store and protect" certificates for correspondents in such a way so 1035 as to guarantee their later retrieval. 1037 4.1 Key Pair Generation 1039 If an S/MIME agent needs to generate a key pair, then the S/MIME agent 1040 or some related administrative utility or function MUST be capable of 1041 generating separate DH and DSS public/private key pairs on behalf of 1042 the user. Each key pair MUST be generated from a good source of non- 1043 deterministic random input and the private key MUST be protected in a 1044 secure fashion. 1046 If an S/MIME agent needs to generate a key pair, then the S/MIME agent 1047 or some related administrative utility or function SHOULD generate RSA 1048 key pairs. 1050 A user agent SHOULD generate RSA key pairs at a minimum key size of 1051 768 bits. A user agent MUST NOT generate RSA key pairs less than 512 1052 bits long. Creating keys longer than 1024 bits may cause some older 1053 S/MIME receiving agents to not be able to verify signatures, but gives 1054 better security and is therefore valuable. A receiving agent SHOULD be 1055 able to verify signatures with keys of any size over 512 bits. Some 1056 agents created in the United States have chosen to create 512 bit keys 1057 in order to get more advantageous export licenses. However, 512 bit 1058 keys are considered by many to be cryptographically insecure. 1059 Implementors should be aware that multiple (active) key pairs may be 1060 associated with a single individual. For example, one key pair may be 1061 used to support confidentiality, while a different key pair may be 1062 used for authentication. 1064 5. Security 1066 This entire draft discusses security. Security issues not covered in 1067 other parts of the draft include: 1069 40-bit encryption is considered weak by most cryptographers. Using 1070 weak cryptography in S/MIME offers little actual security over sending 1071 plaintext. However, other features of S/MIME, such as the 1072 specification of tripleDES and the ability to announce stronger 1073 cryptographic capabilities to parties with whom you communicate, allow 1074 senders to create messages that use strong encryption. Using weak 1075 cryptography is never recommended unless the only alternative is no 1076 cryptography. When feasible, sending and receiving agents should 1077 inform senders and recipients the relative cryptographic strength of 1078 messages. 1080 It is impossible for most software or people to estimate the value of 1081 a message. Further, it is impossible for most software or people to 1082 estimate the actual cost of decrypting a message that is encrypted 1083 with a key of a particular size. Further, it is quite difficult to 1084 determine the cost of a failed decryption if a recipient cannot decode 1085 a message. Thus, choosing between different key sizes (or choosing 1086 whether to just use plaintext) is also impossible. However, decisions 1087 based on these criteria are made all the time, and therefore this 1088 draft gives a framework for using those estimates in choosing 1089 algorithms. 1091 If a sending agent is sending the same message using different 1092 strengths of cryptography, an attacker watching the communications 1093 channel can determine the contents of the strongly-encrypted message 1094 by decrypting the weakly-encrypted version. In other words, a sender 1095 should not send a copy of a message using weaker cryptography than 1096 they would use for the original of the message. 1098 Modification of the ciphertext can go undetected if authentication is 1099 not also used, which is the case when sending EnvelopedData without 1100 wrapping it in SignedData or enclosing SignedData within it. 1102 A. Object Identifiers and Syntax 1104 SMIMECapability ::= SEQUENCE { 1105 capabilityID OBJECT IDENTIFIER, 1106 parameters ANY DEFINED BY capabilityID OPTIONAL } 1108 SMIMECapabilities ::= SEQUENCE OF SMIMECapability 1110 SMIMEEncryptionKeyPreference ::= CHOICE { 1111 issuerAndSerialNumber [0] IssuerAndSerialNumber, 1112 receipentKeyId [1] RecipientKeyIdentifier, 1113 subjectAltKeyIdentifier [2] KeyIdentifier 1114 } 1116 A.1 Content Encryption Algorithms 1118 RC2-CBC OBJECT IDENTIFIER ::= 1119 {iso(1) member-body(2) us(840) rsadsi(113549) 1120 encryptionAlgorithm(3) 2} 1122 For the effective-key-bits (key size) greater than 32 and less than 1123 256, the RC2-CBC algorithm parameters are encoded as: 1125 RC2-CBC parameter ::= SEQUENCE { 1126 rc2ParameterVersion INTEGER, 1127 iv OCTET STRING (8)} 1129 For the effective-key-bits of 40, 64, and 128, the rc2ParameterVersion 1130 values are 160, 120, 58 respectively. 1132 DES-EDE3-CBC OBJECT IDENTIFIER ::= 1133 {iso(1) member-body(2) us(840) rsadsi(113549) 1134 encryptionAlgorithm(3) 7} 1136 For DES-CBC and DES-EDE3-CBC, the parameter should be encoded as: 1138 CBCParameter ::= IV 1140 where IV ::= OCTET STRING -- 8 octets. 1142 A.2 Digest Algorithms 1144 md5 OBJECT IDENTIFIER ::= 1145 {iso(1) member-body(2) us(840) rsadsi(113549) digestAlgorithm(2) 5} 1147 sha-1 OBJECT IDENTIFIER ::= 1148 {iso(1) identified-organization(3) oiw(14) secsig(3) algorithm(2) 1149 26} 1151 A.3 Asymmetric Encryption Algorithms 1153 rsaEncryption OBJECT IDENTIFIER ::= 1154 {iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) pkcs-1(1) 1} 1156 rsa OBJECT IDENTIFIER ::= 1157 {joint-iso-ccitt(2) ds(5) algorithm(8) encryptionAlgorithm(1) 1} 1159 id-dsa OBJECT IDENTIFIER ::= 1160 {iso(1) member-body(2) us(840) x9-57(10040) x9cm(4) 1 } 1162 A.4 Signature Algorithms 1164 md2WithRSAEncryption OBJECT IDENTIFIER ::= 1165 {iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) pkcs-1(1) 2} 1167 md5WithRSAEncryption OBJECT IDENTIFIER ::= 1168 {iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) pkcs-1(1) 4} 1170 sha-1WithRSAEncryption OBJECT IDENTIFIER ::= 1171 {iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) pkcs-1(1) 5} 1173 id-dsa-with-sha1 OBJECT IDENTIFIER ::= 1174 {iso(1) member-body(2) us(840) x9-57(10040) x9cm(4) 3} 1176 A.5 Signed Attributes 1178 signingTime OBJECT IDENTIFIER ::= 1179 {iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) pkcs-9(9) 5} 1181 smimeCapabilities OBJECT IDENTIFIER ::= 1182 {iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) pkcs-9(9) 15} 1184 id-aa-encrypKeyPref OBJECT IDENTIFIER ::= 1185 {id-aa 11} 1187 B. References 1189 [3DES] W. Tuchman, "Hellman Presents No Shortcut Solutions To DES," 1190 IEEE Spectrum, v. 16, n. 7, July 1979, pp40-41. 1192 [CERT3] "S/MIME Version 3 Certificate Handling", Internet Draft draft- 1193 ietf-smime-cert-*.txt. 1195 [CHARSETS] Character sets assigned by IANA. See . 1198 [CMS] "Cryptographic Message Syntax", Internet Draft draft-ietf-smime- 1199 cms-*.txt. 1201 [CONTDISP] "Communicating Presentation Information in Internet 1202 Messages: The Content-Disposition Header Field", RFC 2183 1204 [DES] ANSI X3.106, "American National Standard for Information Systems- 1205 Data Link Encryption," American National Standards Institute, 1983. 1207 [DH] ANSI X9.42 TBD 1209 [DSS] ANSI X9.57-199x, "Public Key Cryptography For The Financial 1210 Services Industry: Certificate Management" (Working Draft), 21 June, 1211 1996. 1213 [ESS] "Enhanced Security Services for S/MIME", Internet draft, draft- 1214 ietf-smime-ess-*.txt. 1216 [MD5] "The MD5 Message Digest Algorithm", RFC 1321 1218 [MIME-SPEC] The primary definition of MIME. "MIME Part 1: Format of 1219 Internet Message Bodies", RFC 2045; "MIME Part 2: Media Types", RFC 1220 2046; "MIME Part 3: Message Header Extensions for Non-ASCII Text", RFC 1221 2047; "MIME Part 4: Registration Procedures", RFC 2048; "MIME Part 5: 1222 Conformance Criteria and Examples", RFC 2049 1224 [MIME-SECURE] "Security Multiparts for MIME: Multipart/Signed and 1225 Multipart/Encrypted", RFC 1847 1227 [MUSTSHOULD] "Key words for use in RFCs to Indicate Requirement 1228 Levels", RFC 2119 1230 [PKCS-1] "PKCS #1: RSA Encryption Version 1.5", RFC 2313 1232 [PKCS-7] "PKCS #7: Cryptographic Message Syntax Version 1.5", RFC 2315 1234 [RC2] "A Description of the RC2 (r) Encryption Algorithm", RFC 2268 1236 [SHA1] NIST FIPS PUB 180-1, "Secure Hash Standard," National Institute 1237 of Standards and Technology, U.S. Department of Commerce, DRAFT, 31May 1238 1994. 1240 [SMIMEV2] "S/MIME Version 2 Message Specification", RFC 2311 1242 C. Acknowledgements 1244 This document is largely derived from [SMIMEV2] written by Steve 1245 Dusse, Paul Hoffman, Blake Ramsdell, Laurence Lundblade, and Lisa 1246 Repka. 1248 Significant comments and additions were made by John Pawling and Jim 1249 Schaad. 1251 D. Changes from last draft 1253 SMIMECapabilities and SMIMEEncryptionKeyPreference clarified to be 1254 only single-instance, signed attributes (John Pawling) 1255 Removed keylength specifications for RSA signing and encryption (to be 1256 moved to CMS section 12) (John Pawling) 1257 Slight wording changes in section 3.1 (security layers being "removed" 1258 changed to "processed") (Paul Hoffman and offline comments) 1259 Added data integrity risks for enveloped-only data in section 3.3 and 1260 section 5 (Paul Hoffman and offline comments) 1261 Fixed a typo in CBCParameter (Paul Hoffman) 1262 Changed a reference to authenticated attributes to be signed 1263 attributes (John Pawling) 1264 Removed application/mime (Paul Hoffman) 1266 F. Editor's address 1268 Blake Ramsdell 1269 Worldtalk 1270 13122 NE 20th St., Suite C 1271 Bellevue, WA 98005 1272 (425) 882-8861 1273 blaker@deming.com