1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781
|
<pre>Network Working Group J. Schaad
Request for Comments: 3565 Soaring Hawk Consulting
Category: Standards Track July 2003
<span class="h1">Use of the Advanced Encryption Standard (AES) Encryption</span>
<span class="h1">Algorithm in Cryptographic Message Syntax (CMS)</span>
Status of this Memo
This document specifies an Internet standards track protocol for the
Internet community, and requests discussion and suggestions for
improvements. Please refer to the current edition of the "Internet
Official Protocol Standards" (STD 1) for the standardization state
and status of this protocol. Distribution of this memo is unlimited.
Copyright Notice
Copyright (C) The Internet Society (2003). All Rights Reserved.
Abstract
This document specifies the conventions for using the Advanced
Encryption Standard (AES) algorithm for encryption with the
Cryptographic Message Syntax (CMS).
Conventions used in this document
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
"SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
document are to be interpreted as described in <a href="https://www.rfc-editor.org/bcp/bcp14">BCP 14</a>, <a href="./rfc2119">RFC 2119</a>
[<a href="#ref-MUSTSHOULD" title=""Key Words for Use in RFCs to Indicate Requirement Levels"">MUSTSHOULD</a>].
<span class="h2"><a class="selflink" id="section-1" href="#section-1">1</a>. Overview</span>
This document specifies the conventions for using Advanced Encryption
Standard (AES) content encryption algorithm with the Cryptographic
Message Syntax [<a href="#ref-CMS" title=""Cryptographic Message Syntax (CMS)"">CMS</a>] enveloped-data and encrypted-data content types.
CMS values are generated using ASN.1 [<a href="#ref-X.208-88">X.208-88</a>], using the Basic
Encoding Rules (BER) [<a href="#ref-X.209-88">X.209-88</a>] and the Distinguished Encoding Rules
(DER) [<a href="#ref-X.509-88">X.509-88</a>].
<span class="grey">Schaad Standards Track [Page 1]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-2" ></span>
<span class="grey"><a href="./rfc3565">RFC 3565</a> Use of the AES Encryption Algorithm in CMS July 2003</span>
<span class="h3"><a class="selflink" id="section-1.1" href="#section-1.1">1.1</a>. AES</span>
The Advanced Encryption Standard (AES) [<a href="#ref-AES">AES</a>] was developed to replace
DES [<a href="#ref-DES">DES</a>]. The AES Federal Information Processing Standard (FIPS)
Publication specifies a cryptographic algorithm for use by U.S.
Government organizations. However, the AES will also be widely used
by organizations, institutions, and individuals outside of the U.S.
Government.
Two researchers who developed and submitted the Rijndael algorithm
for consideration are both cryptographers from Belgium: Dr. Joan
Daemen of Proton World International and Dr. Vincent Rijmen, a
postdoctoral researcher in the Electrical Engineering Department of
Katholieke Universiteit Leuven.
The National Institute of Standards and technology (NIST) selected
the Rijndael algorithm for AES because it offers a combination of
security, performance, efficiency, ease of implementation, and
flexibility. Specifically, Rijndael appears to be consistently a
very good performer in both hardware and software across a wide range
of computing environments regardless of its use in feedback or
non-feedback modes. Its key setup time is excellent, and its key
agility is good. The very low memory requirements of the Rijndael
algorithm make it very well suited for restricted-space environments,
in which it also demonstrates excellent performance. The Rijndael
algorithm operations are among the easiest to defend against power
and timing attacks. Additionally, it appears that some defense can
be provided against such attacks without significantly impacting the
algorithm's performance. Finally, the algorithm's internal round
structure appears to have good potential to benefit from
instruction-level parallelism.
The AES specifies three key sizes: 128, 192 and 256 bits.
<span class="h2"><a class="selflink" id="section-2" href="#section-2">2</a>. Enveloped-data Conventions</span>
The CMS enveloped-data content type consists of encrypted content and
wrapped content-encryption keys for one or more recipients. The AES
algorithm is used to encrypt the content.
Compliant software MUST meet the requirements for constructing an
enveloped-data content type stated in [<a href="#ref-CMS" title=""Cryptographic Message Syntax (CMS)"">CMS</a>] <a href="#section-6">Section 6</a>,
"Enveloped-data Content Type".
The AES content-encryption key MUST be randomly generated for each
instance of an enveloped-data content type. The content-encryption
key (CEK) is used to encrypt the content.
<span class="grey">Schaad Standards Track [Page 2]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-3" ></span>
<span class="grey"><a href="./rfc3565">RFC 3565</a> Use of the AES Encryption Algorithm in CMS July 2003</span>
AES can be used with the enveloped-data content type using any of the
following key management techniques defined in [<a href="#ref-CMS" title=""Cryptographic Message Syntax (CMS)"">CMS</a>] <a href="#section-6">Section 6</a>.
1) Key Transport: The AES CEK is uniquely wrapped for each recipient
using the recipient's public RSA key and other values. <a href="#section-2.2">Section 2.2</a>
provides additional details.
2) Key Agreement: The AES CEK is uniquely wrapped for each recipient
using a pairwise symmetric key-encryption key (KEK) generated using
an originator's randomly generated private key (ES-DH [<a href="#ref-DH" title=""Diffie-Hellman Key Agreement Method"">DH</a>]) or
previously generated private key (SS-DH [<a href="#ref-DH" title=""Diffie-Hellman Key Agreement Method"">DH</a>]), the recipient's public
DH key, and other values. <a href="#section-2.3">Section 2.3</a> provides additional details.
3) Previously Distributed Symmetric KEK: The AES CEK is wrapped
using a previously distributed symmetric KEK (such as a Mail List
Key). The methods by which the symmetric KEK is generated and
distributed are beyond the scope of this document. <a href="#section-2.4">Section 2.4</a>
provides additional details.
4) Password Encryption: The AES CEK is wrapped using a KEK derived
from a password or other shared secret. <a href="#section-2.5">Section 2.5</a> provides
additional details.
Documents defining the use of the Other Recipient Info structure will
need to define the proper use for the AES algorithm if desired.
<span class="h3"><a class="selflink" id="section-2.1" href="#section-2.1">2.1</a>. EnvelopedData Fields</span>
The enveloped-data content type is ASN.1 encoded using the
EnvelopedData syntax. The fields of the EnvelopedData syntax MUST be
populated as follows:
The EnvelopedData version is determined based on a number of factors.
See [<a href="#ref-CMS" title=""Cryptographic Message Syntax (CMS)"">CMS</a>] <a href="#section-6.1">section 6.1</a> for the algorithm to determine this value.
The EnvelopedData recipientInfos CHOICE is dependent on the key
management technique used. <a href="#section-2.2">Section 2.2</a>, 2.3, 2.4 and 2.5 provide
additional information.
The EnvelopedData encryptedContentInfo contentEncryptionAlgorithm
field MUST specify a symmetric encryption algorithm. Implementations
MUST support content encryption with AES, but implementations MAY
support other algorithms as well.
The EnvelopedData unprotectedAttrs MAY be present.
<span class="grey">Schaad Standards Track [Page 3]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-4" ></span>
<span class="grey"><a href="./rfc3565">RFC 3565</a> Use of the AES Encryption Algorithm in CMS July 2003</span>
<span class="h3"><a class="selflink" id="section-2.2" href="#section-2.2">2.2</a>. KeyTransRecipientInfo Fields</span>
The enveloped-data content type is ASN.1 encoded using the
EnvelopedData syntax. The fields of the EnvelopedData syntax MUST be
populated as follows:
The KeyTransRecipientInfo version MUST be either 0 or 2. If the
RecipientIdentifier is the CHOICE issuerAndSerialNumber, then the
version MUST be 0. If the RecipientIdentifier is
subjectKeyIdentifier, then the version MUST be 2.
The KeyTransRecipientInfo RecipientIdentifier provides two
alternatives for specifying the recipient's certificate, and thereby
the recipient's public key. The recipient's certificate MUST contain
a RSA public key. The CEK is encrypted with the recipient's RSA
public key. The issuerAndSerialNumber alternative identifies the
recipient's certificate by the issuer's distinguished name and the
certificate serial number; the subjectKeyIdentifier identifies the
recipient's certificate by the X.509 subjectKeyIdentifier extension
value.
The KeyTransRecipientInfo keyEncryptionAlgorithm field specifies the
key transport algorithm (i.e., RSAES-OAEP [<a href="#ref-RSA-OAEP" title=""Use of the RSAES-OAEP Key Transport Algorithm in the Cryptographic Message Syntax (CMS)"">RSA-OAEP</a>]), and the
associated parameters used to encrypt the CEK for the recipient.
The KeyTransRecipientInfo encryptedKey is the result of encrypting
the CEK with the recipient's RSA public key.
<span class="h3"><a class="selflink" id="section-2.3" href="#section-2.3">2.3</a>. KeyAgreeRecipientInfo Fields</span>
This section describes the conventions for using ES-DH or SS-DH and
AES with the CMS enveloped-data content type to support key
agreement. When key agreement is used, then the RecipientInfo
keyAgreeRecipientInfo CHOICE MUST be used.
The KeyAgreeRecipient version MUST be 3.
The EnvelopedData originatorInfo field MUST be the originatorKey
alternative. The originatorKey algorithm fields MUST contain the
dh-public-number object identifier with absent parameters. The
originatorKey publicKey MUST contain the originator's ephemeral
public key.
The EnvelopedData ukm MAY be present.
The EnvelopedData keyEncrytionAlgorithm MUST be the id-alg-ESDH
algorithm identifier [<a href="#ref-CMSALG" title="R.">CMSALG</a>].
<span class="grey">Schaad Standards Track [Page 4]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-5" ></span>
<span class="grey"><a href="./rfc3565">RFC 3565</a> Use of the AES Encryption Algorithm in CMS July 2003</span>
<span class="h4"><a class="selflink" id="section-2.3.1" href="#section-2.3.1">2.3.1</a>. ES-DH/AES Key Derivation</span>
Generation of the AES KEK to be used with the AES-key wrap algorithm
is done using the method described in [<a href="#ref-DH" title=""Diffie-Hellman Key Agreement Method"">DH</a>].
<span class="h5"><a class="selflink" id="section-2.3.1.1" href="#section-2.3.1.1">2.3.1.1</a>. Example 1</span>
ZZ is the 20 bytes 00 01 02 03 04 05 06 07 08 09
0a 0b 0c 0d 0e 0f 10 11 12 13
The key wrap algorithm is AES-128 wrap, so we need 128 bits (16
bytes) of keying material.
No partyAInfo is used.
Consequently, the input to SHA-1 is:
00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 11 12 13 ; ZZ
30 1b
30 11
06 09 60 86 48 01 65 03 04 01 05 ; AES-128 wrap OID
04 04
00 00 00 01 ; Counter
a2 06
04 04
00 00 00 80 ; key length
And the output is the 32 bytes:
d6 d6 b0 94 c1 02 7a 7d e6 e3 11 72 94 a3 53 64 49 08 50 f9
Consequently,
K= d6 d6 b0 94 c1 02 7a 7d e6 e3 11 72 94 a3 53 64
<span class="grey">Schaad Standards Track [Page 5]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-6" ></span>
<span class="grey"><a href="./rfc3565">RFC 3565</a> Use of the AES Encryption Algorithm in CMS July 2003</span>
<span class="h5"><a class="selflink" id="section-2.3.1.2" href="#section-2.3.1.2">2.3.1.2</a>. Example 2</span>
ZZ is the 20 bytes 00 01 02 03 04 05 06 07 08 09
0a 0b 0c 0d 0e 0f 10 11 12 13
The key wrap algorithm is AES-256 key wrap, so we need 256 bits (32
bytes) of keying material.
The partyAInfo used is the 64 bytes
01 23 45 67 89 ab cd ef fe dc ba 98 76 54 32 01
01 23 45 67 89 ab cd ef fe dc ba 98 76 54 32 01
01 23 45 67 89 ab cd ef fe dc ba 98 76 54 32 01
01 23 45 67 89 ab cd ef fe dc ba 98 76 54 32 01
Consequently, the input to first invocation of SHA-1 is:
00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 11 12 13 ; ZZ
30 5f
30 11
06 09 60 86 48 01 65 03 04 01 2d ; AES-256 wrap OID
04 04
00 00 00 01 ; Counter
a0 42
04 40
01 23 45 67 89 ab cd ef fe dc ba 98 76 54 32 01 ; partyAInfo
01 23 45 67 89 ab cd ef fe dc ba 98 76 54 32 01
01 23 45 67 89 ab cd ef fe dc ba 98 76 54 32 01
01 23 45 67 89 ab cd ef fe dc ba 98 76 54 32 01
a2 06
04 04
00 00 01 00 ; key length
And the output is the 20 bytes:
88 90 58 5C 4E 28 1A 5C 11 67 CA A5 30 BE D5 9B 32 30 D8 93
<span class="grey">Schaad Standards Track [Page 6]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-7" ></span>
<span class="grey"><a href="./rfc3565">RFC 3565</a> Use of the AES Encryption Algorithm in CMS July 2003</span>
The input to second invocation of SHA-1 is:
00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 11 12 13 ; ZZ
30 5f
30 11
06 09 60 86 48 01 65 03 04 01 2d ; AES-256 wrap OID
04 04
00 00 00 02 ; Counter
a0 42
04 40
01 23 45 67 89 ab cd ef fe dc ba 98 76 54 32 01 ; partyAInfo
01 23 45 67 89 ab cd ef fe dc ba 98 76 54 32 01
01 23 45 67 89 ab cd ef fe dc ba 98 76 54 32 01
01 23 45 67 89 ab cd ef fe dc ba 98 76 54 32 01
a2 06
04 04
00 00 01 00 ; key length
And the output is the 20 bytes:
CB A8 F9 22 BD 1B 56 A0 71 C9 6F 90 36 C6 04 2C AA 20 94 37
Consequently,
K = 88 90 58 5C 4E 28 1A 5C 11 67 CA A5 30 BE D5 9B
32 30 D8 93 CB A8 F9 22 BD 1B 56 A0
<span class="h4"><a class="selflink" id="section-2.3.2" href="#section-2.3.2">2.3.2</a>. AES CEK Wrap Process</span>
The AES key wrap algorithm encrypts one AES key in another AES key.
The algorithm produces an output 64-bits longer than the input AES
CEK, the additional bits are a checksum. The algorithm uses 6*n AES
encryption/decryption operations where n is number of 64-bit blocks
in the AES CEK. Full details of the AES key wrap algorithm are
available at [<a href="#ref-AES-WRAP" title=""Advanced Encryption Standard (AES) Key Wrap Algorithm"">AES-WRAP</a>].
NIST has assigned the following OIDs to define the AES key wrap
algorithm.
id-aes128-wrap OBJECT IDENTIFIER ::= { aes 5 }
id-aes192-wrap OBJECT IDENTIFIER ::= { aes 25 }
id-aes256-wrap OBJECT IDENTIFIER ::= { aes 45 }
In all cases the parameters field MUST be absent. The OID gives the
KEK key size, but does not make any statements as to the size of the
wrapped AES CEK. Implementations MAY use different KEK and CEK
<span class="grey">Schaad Standards Track [Page 7]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-8" ></span>
<span class="grey"><a href="./rfc3565">RFC 3565</a> Use of the AES Encryption Algorithm in CMS July 2003</span>
sizes. Implements MUST support the CEK and the KEK having the same
length. If different lengths are supported, the KEK MUST be of equal
or greater length than the CEK.
<span class="h3"><a class="selflink" id="section-2.4" href="#section-2.4">2.4</a>. KEKRecipientInfo Fields</span>
This section describes the conventions for using AES with the CMS
enveloped-data content type to support previously distributed
symmetric KEKs. When a previously distributed symmetric KEK is used
to wrap the AES CEK, then the RecipientInfo KEKRecipientInfo CHOICE
MUST be used. The methods used to generate and distribute the
symmetric KEK are beyond the scope of this document. One possible
method of distributing keys is documented in [<a href="#ref-SYMKEYDIST" title=""CMS Symmetric Key Management and Distribution"">SYMKEYDIST</a>].
The KEKRecipientInfo fields MUST be populated as specified in [<a href="#ref-CMS" title=""Cryptographic Message Syntax (CMS)"">CMS</a>]
<a href="#section-6.2.3">Section 6.2.3</a>, KEKRecipientInfo Type.
The KEKRecipientInfo keyEncryptionAlgorithm algorithm field MUST be
one of the OIDs defined in <a href="#section-2.3.2">section 2.3.2</a> indicating that the AES wrap
function is used to wrap the AES CEK. The KEKRecipientInfo
keyEncryptionAlgorithm parameters field MUST be absent.
The KEKRecipientInfo encryptedKey field MUST include the AES CEK
wrapped using the previously distributed symmetric KEK as input to
the AES wrap function.
<span class="h3"><a class="selflink" id="section-2.5" href="#section-2.5">2.5</a>. PasswordRecipientInfo Fields</span>
This section describes the conventions for using AES with the CMS
enveloped-data content type to support password-based key management.
When a password derived KEK is used to wrap the AES CEK, then the
RecipientInfo PasswordRecipientInfo CHOICE MUST be used.
The keyEncryptionAlgorithm algorithm field MUST be one of the OIDs
defined in <a href="#section-2.3.2">section 2.3.2</a> indicating the AES wrap function is used to
wrap the AES CEK. The keyEncryptionAlgorithm parameters field MUST
be absent.
The encryptedKey field MUST be the result of the AES key wrap
algorithm applied to the AES CEK value.
<span class="h2"><a class="selflink" id="section-3" href="#section-3">3</a>. Encrypted-data Conventions</span>
The CMS encrypted-data content type consists of encrypted content
with implicit key management. The AES algorithm is used to encrypt
the content.
<span class="grey">Schaad Standards Track [Page 8]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-9" ></span>
<span class="grey"><a href="./rfc3565">RFC 3565</a> Use of the AES Encryption Algorithm in CMS July 2003</span>
Compliant software MUST meet the requirements for constructing an
enveloped-data content type stated in [<a href="#ref-CMS" title=""Cryptographic Message Syntax (CMS)"">CMS</a>] <a href="#section-8">Section 8</a>,
"Encrypted-data Content Type".
The encrypted-data content type is ASN.1 encoded using the
EncryptededData syntax. The fields of the EncryptedData syntax MUST
be populated as follows:
The EncryptedData version is determined based on a number of factors.
See [<a href="#ref-CMS" title=""Cryptographic Message Syntax (CMS)"">CMS</a>] <a href="#section-9.1">section 9.1</a> for the algorithm to determine this value.
The EncryptedData encryptedContentInfo contentEncryptionAlgorithm
field MUST specify a symmetric encryption algorithm. Implementations
MUST support encryption using AES, but implementations MAY support
other algorithms as well.
The EncryptedData unprotectedAttrs MAY be present.
<span class="h2"><a class="selflink" id="section-4" href="#section-4">4</a>. Algorithm Identifiers and Parameters</span>
This section specified algorithm identifiers for the AES encryption
algorithm.
<span class="h3"><a class="selflink" id="section-4.1" href="#section-4.1">4.1</a>. AES Algorithm Identifiers and Parameters</span>
The AES algorithm is defined in [<a href="#ref-AES">AES</a>]. RSAES-OAEP [<a href="#ref-RSA-OAEP" title=""Use of the RSAES-OAEP Key Transport Algorithm in the Cryptographic Message Syntax (CMS)"">RSA-OAEP</a>] MAY be
used to transport AES keys.
AES is added to the set of symmetric content encryption algorithms
defined in [<a href="#ref-CMSALG" title="R.">CMSALG</a>]. The AES content-encryption algorithm, in Cipher
Block Chaining (CBC) mode, for the three different key sizes are
identified by the following object identifiers:
id-aes128-CBC OBJECT IDENTIFIER ::= { aes 2 }
id-aes192-CBC OBJECT IDENTIFIER ::= { aes 22 }
id-aes256-CBC OBJECT IDENTIFIER ::= { aes 42 }
The AlgorithmIdentifier parameters field MUST be present, and the
parameters field MUST contain a AES-IV:
AES-IV ::= OCTET STRING (SIZE(16))
Content encryption algorithm identifiers are located in the
EnvelopedData EncryptedContentInfo contentEncryptionAlgorithm and the
EncryptedData EncryptedContentInfo contentEncryptionAlgorithm fields.
<span class="grey">Schaad Standards Track [Page 9]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-10" ></span>
<span class="grey"><a href="./rfc3565">RFC 3565</a> Use of the AES Encryption Algorithm in CMS July 2003</span>
Content encryption algorithms are used to encrypt the content located
in the EnvelopedData EncryptedContentInfo encryptedContent and the
EncryptedData EncryptedContentInfo encryptedContent fields.
<span class="h2"><a class="selflink" id="section-5" href="#section-5">5</a>. SMIMECapabilities Attribute Conventions</span>
An S/MIME client SHOULD announce the set of cryptographic functions
it supports by using the S/MIME capabilities attribute. This
attribute provides a partial list of object identifiers of
cryptographic functions and MUST be signed by the client. The
algorithm OIDs SHOULD be logically separated in functional categories
and MUST be ordered with respect to their preference.
<a href="./rfc2633">RFC 2633</a> [<a href="#ref-MSG" title=""S/MIME Version 3 Message Specification"">MSG</a>], Section 2.5.2 defines the SMIMECapabilities signed
attribute (defined as a SEQUENCE of SMIMECapability SEQUENCEs) to be
used to specify a partial list of algorithms that the software
announcing the SMIMECapabilities can support.
<span class="h3"><a class="selflink" id="section-5.1" href="#section-5.1">5.1</a>. AES S/MIME Capability Attributes</span>
If an S/MIME client is required to support symmetric encryption with
AES, the capabilities attribute MUST contain the AES object
identifier specified above in the category of symmetric algorithms.
The parameter with this encoding MUST be absent.
The encodings for the mandatory key sizes are:
Key Size Capability
128 30 0B 06 09 60 86 48 01 65 03 04 01 02
196 30 0B 06 09 60 86 48 01 65 03 04 01 16
256 30 0B 06 09 60 86 48 01 65 03 04 01 2A
When a sending agent creates an encrypted message, it has to decide
which type of encryption algorithm to use. In general the decision
process involves information obtained from the capabilities lists
included in messages received from the recipient, as well as other
information such as private agreements, user preferences, legal
restrictions, and so on. If users require AES for symmetric
encryption, the S/MIME clients on both the sending and receiving side
MUST support it, and it MUST be set in the user preferences.
<span class="grey">Schaad Standards Track [Page 10]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-11" ></span>
<span class="grey"><a href="./rfc3565">RFC 3565</a> Use of the AES Encryption Algorithm in CMS July 2003</span>
<span class="h2"><a class="selflink" id="section-6" href="#section-6">6</a>. Security Considerations</span>
If RSA-OAEP [PKCS#1v2.0] and RSA PKCS #1 v1.5 [PKCS#1v1.5] are both
used to transport the same CEK, then an attacker can still use the
Bleichenbacher attack against the RSA PKCS #1 v1.5 encrypted key. It
is generally unadvisable to mix both RSA-OAEP and RSA PKCS#1 v1.5 in
the same set of recipients.
Implementations must protect the RSA private key and the CEK.
Compromise of the RSA private key may result in the disclosure of all
messages protected with that key. Compromise of the CEK may result
in disclosure of the associated encrypted content.
The generation of AES CEKs relies on random numbers. The use of
inadequate pseudo-random number generators (PRNGs) to generate these
values can result in little or no security. An attacker may find it
much easier to reproduce the PRNG environment that produced the keys,
searching the resulting small set of possibilities, rather than brute
force searching the whole key space. The generation of quality
random numbers is difficult. <a href="./rfc1750">RFC 1750</a> [<a href="#ref-RANDOM" title=""Randomness Recommendations for Security"">RANDOM</a>] offers important
guidance in this area.
When wrapping a CEK with a KEK, the KEK MUST always be at least the
same length as the CEK. An attacker will generally work at the
weakest point in an encryption system. This would be the smaller of
the two key sizes for a brute force attack.
Normative References
[<a id="ref-AES">AES</a>] National Institute of Standards. FIPS Pub 197:
Advanced Encryption Standard (AES). 26 November 2001.
[<a id="ref-CMS">CMS</a>] Housley, R., "Cryptographic Message Syntax (CMS)", <a href="./rfc3369">RFC</a>
<a href="./rfc3369">3369</a>, August 2002.
[<a id="ref-AES-WRAP">AES-WRAP</a>] Schaad, J. and R. Housley, "Advanced Encryption
Standard (AES) Key Wrap Algorithm", <a href="./rfc3394">RFC 3394</a>, September
2002.
[<a id="ref-CMSALG">CMSALG</a>] Housley, R., "Cryptographic Message Syntax (CMS)
Algorithms, <a href="./rfc3370">RFC 3370</a>, August 2002.
[<a id="ref-DES">DES</a>] National Institute of Standards and Technology. FIPS
Pub 46: Data Encryption Standard. 15 January 1977.
[<a id="ref-DH">DH</a>] Rescorla, E., "Diffie-Hellman Key Agreement Method",
<a href="./rfc2631">RFC 2631</a>, June 1999.
<span class="grey">Schaad Standards Track [Page 11]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-12" ></span>
<span class="grey"><a href="./rfc3565">RFC 3565</a> Use of the AES Encryption Algorithm in CMS July 2003</span>
[<a id="ref-MUSTSHOULD">MUSTSHOULD</a>] Bradner, S., "Key Words for Use in RFCs to Indicate
Requirement Levels", <a href="https://www.rfc-editor.org/bcp/bcp14">BCP 14</a>, <a href="./rfc2119">RFC 2119</a>, March 1997.
[<a id="ref-RSA-OAEP">RSA-OAEP</a>] Housley, R. "Use of the RSAES-OAEP Key Transport
Algorithm in the Cryptographic Message Syntax (CMS)",
<a href="./rfc3560">RFC 3560</a>, July 2003.
[<a id="ref-X.208-88">X.208-88</a>] CCITT. Recommendation X.208: Specification of Abstract
Syntax Notation One (ASN.1). 1988.
[<a id="ref-X.209-88">X.209-88</a>] CCITT. Recommendation X.209: Specification of Basic
Encoding Rules for Abstract Syntax Notation One
(ASN.1). 1988.
[<a id="ref-X.509-88">X.509-88</a>] CCITT. Recommendation X.509: The Directory -
Authentication Framework. 1988.
Informational References
[<a id="ref-MSG">MSG</a>] Ramsdell, B., Editor, "S/MIME Version 3 Message
Specification", <a href="./rfc2633">RFC 2633</a>, June 1999.
[PKCS#1v1.5] Kaliski, B., "PKCS #1: RSA Encryption, Version 1.5",
<a href="./rfc2313">RFC 2313</a>, March 1998.
[PKCS#1v2.0] Kaliski, B., "PKCS #1: RSA Encryption, Version 2.0",
<a href="./rfc2437">RFC 2437</a>, October 1998.
[<a id="ref-RANDOM">RANDOM</a>] Eastlake, D., Crocker, S. and J. Schiller, "Randomness
Recommendations for Security", <a href="./rfc1750">RFC 1750</a>, December 1994.
[<a id="ref-SYMKEYDIST">SYMKEYDIST</a>] Turner, S., "CMS Symmetric Key Management and
Distribution", Work in Progress, January 2003.
Acknowledgements
This document is the result of contributions from many professionals.
We appreciate the hard work of all members of the IETF S/MIME Working
Group.
<span class="grey">Schaad Standards Track [Page 12]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-13" ></span>
<span class="grey"><a href="./rfc3565">RFC 3565</a> Use of the AES Encryption Algorithm in CMS July 2003</span>
Appendix A ASN.1 Module
CMSAesRsaesOaep {iso(1) member-body(2) us(840) rsadsi(113549)
pkcs(1) pkcs-9(9) smime(16) modules(0) id-mod-cms-aes(19) }
DEFINITIONS IMPLICIT TAGS ::=
BEGIN
-- EXPORTS ALL --
IMPORTS
-- PKIX
AlgorithmIdentifier
FROM PKIXExplicit88 {iso(1) identified-organization(3) dod(6)
internet(1) security(5) mechanisms(5) pkix(7) id-mod(0)
id-pkix1-explicit(18)};
-- AES information object identifiers --
aes OBJECT IDENTIFIER ::= { joint-iso-itu-t(2) country(16) us(840)
organization(1) gov(101) csor(3)_ nistAlgorithms(4) 1 }
-- AES using CBC-chaining mode for key sizes of 128, 192, 256
id-aes128-CBC OBJECT IDENTIFIER ::= { aes 2 }
id-aes192-CBC OBJECT IDENTIFIER ::= { aes 22 }
id-aes256-CBC OBJECT IDENTIFIER ::= { aes 42 }
-- AES-IV is a the parameter for all the above object identifiers.
AES-IV ::= OCTET STRING (SIZE(16))
-- AES Key Wrap Algorithm Identifiers - Parameter is absent
id-aes128-wrap OBJECT IDENTIFIER ::= { aes 5 }
id-aes192-wrap OBJECT IDENTIFIER ::= { aes 25 }
id-aes256-wrap OBJECT IDENTIFIER ::= { aes 45 }
END
Author's Address
Jim Schaad
Soaring Hawk Consulting
EMail: jimsch@exmsft.com
<span class="grey">Schaad Standards Track [Page 13]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-14" ></span>
<span class="grey"><a href="./rfc3565">RFC 3565</a> Use of the AES Encryption Algorithm in CMS July 2003</span>
Full Copyright Statement
Copyright (C) The Internet Society (2003). All Rights Reserved.
This document and translations of it may be copied and furnished to
others, and derivative works that comment on or otherwise explain it
or assist in its implementation may be prepared, copied, published
and distributed, in whole or in part, without restriction of any
kind, provided that the above copyright notice and this paragraph are
included on all such copies and derivative works. However, this
document itself may not be modified in any way, such as by removing
the copyright notice or references to the Internet Society or other
Internet organizations, except as needed for the purpose of
developing Internet standards in which case the procedures for
copyrights defined in the Internet Standards process must be
followed, or as required to translate it into languages other than
English.
The limited permissions granted above are perpetual and will not be
revoked by the Internet Society or its successors or assignees.
This document and the information contained herein is provided on an
"AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING
TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING
BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION
HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF
MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
Acknowledgement
Funding for the RFC Editor function is currently provided by the
Internet Society.
Schaad Standards Track [Page 14]
</pre>
|