idnits 2.17.1 draft-ietf-httpbis-encryption-encoding-09.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- No issues found here. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year -- The document date (April 18, 2017) is 2565 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) -- Possible downref: Non-RFC (?) normative reference: ref. 'FIPS180-4' ** Downref: Normative reference to an Informational RFC: RFC 5869 ** Obsolete normative reference: RFC 7230 (Obsoleted by RFC 9110, RFC 9112) ** Obsolete normative reference: RFC 7231 (Obsoleted by RFC 9110) -- Obsolete informational reference (is this intentional?): RFC 5246 (Obsoleted by RFC 8446) -- Obsolete informational reference (is this intentional?): RFC 7233 (Obsoleted by RFC 9110) -- Obsolete informational reference (is this intentional?): RFC 7235 (Obsoleted by RFC 9110) -- Obsolete informational reference (is this intentional?): RFC 7540 (Obsoleted by RFC 9113) Summary: 3 errors (**), 0 flaws (~~), 1 warning (==), 6 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 HTTP Working Group M. Thomson 3 Internet-Draft Mozilla 4 Intended status: Standards Track April 18, 2017 5 Expires: October 20, 2017 7 Encrypted Content-Encoding for HTTP 8 draft-ietf-httpbis-encryption-encoding-09 10 Abstract 12 This memo introduces a content coding for HTTP that allows message 13 payloads to be encrypted. 15 Note to Readers 17 Discussion of this draft takes place on the HTTP working group 18 mailing list (ietf-http-wg@w3.org), which is archived at 19 https://lists.w3.org/Archives/Public/ietf-http-wg/ . 21 Working Group information can be found at http://httpwg.github.io/ ; 22 source code and issues list for this draft can be found at 23 https://github.com/httpwg/http-extensions/labels/encryption . 25 Status of This Memo 27 This Internet-Draft is submitted in full conformance with the 28 provisions of BCP 78 and BCP 79. 30 Internet-Drafts are working documents of the Internet Engineering 31 Task Force (IETF). Note that other groups may also distribute 32 working documents as Internet-Drafts. The list of current Internet- 33 Drafts is at http://datatracker.ietf.org/drafts/current/. 35 Internet-Drafts are draft documents valid for a maximum of six months 36 and may be updated, replaced, or obsoleted by other documents at any 37 time. It is inappropriate to use Internet-Drafts as reference 38 material or to cite them other than as "work in progress." 40 This Internet-Draft will expire on October 20, 2017. 42 Copyright Notice 44 Copyright (c) 2017 IETF Trust and the persons identified as the 45 document authors. All rights reserved. 47 This document is subject to BCP 78 and the IETF Trust's Legal 48 Provisions Relating to IETF Documents 49 (http://trustee.ietf.org/license-info) in effect on the date of 50 publication of this document. Please review these documents 51 carefully, as they describe your rights and restrictions with respect 52 to this document. Code Components extracted from this document must 53 include Simplified BSD License text as described in Section 4.e of 54 the Trust Legal Provisions and are provided without warranty as 55 described in the Simplified BSD License. 57 Table of Contents 59 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2 60 1.1. Notational Conventions . . . . . . . . . . . . . . . . . 3 61 2. The "aes128gcm" HTTP Content Coding . . . . . . . . . . . . . 3 62 2.1. Encryption Content Coding Header . . . . . . . . . . . . 5 63 2.2. Content Encryption Key Derivation . . . . . . . . . . . . 6 64 2.3. Nonce Derivation . . . . . . . . . . . . . . . . . . . . 6 65 3. Examples . . . . . . . . . . . . . . . . . . . . . . . . . . 7 66 3.1. Encryption of a Response . . . . . . . . . . . . . . . . 7 67 3.2. Encryption with Multiple Records . . . . . . . . . . . . 8 68 4. Security Considerations . . . . . . . . . . . . . . . . . . . 8 69 4.1. Automatic Decryption . . . . . . . . . . . . . . . . . . 9 70 4.2. Message Truncation . . . . . . . . . . . . . . . . . . . 9 71 4.3. Key and Nonce Reuse . . . . . . . . . . . . . . . . . . . 9 72 4.4. Data Encryption Limits . . . . . . . . . . . . . . . . . 9 73 4.5. Content Integrity . . . . . . . . . . . . . . . . . . . . 10 74 4.6. Leaking Information in Header Fields . . . . . . . . . . 10 75 4.7. Poisoning Storage . . . . . . . . . . . . . . . . . . . . 11 76 4.8. Sizing and Timing Attacks . . . . . . . . . . . . . . . . 11 77 5. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 12 78 5.1. The "aes128gcm" HTTP Content Coding . . . . . . . . . . . 12 79 6. References . . . . . . . . . . . . . . . . . . . . . . . . . 12 80 6.1. Normative References . . . . . . . . . . . . . . . . . . 12 81 6.2. Informative References . . . . . . . . . . . . . . . . . 13 82 Appendix A. JWE Mapping . . . . . . . . . . . . . . . . . . . . 14 83 Appendix B. Acknowledgements . . . . . . . . . . . . . . . . . . 15 84 Author's Address . . . . . . . . . . . . . . . . . . . . . . . . 15 86 1. Introduction 88 It is sometimes desirable to encrypt the contents of a HTTP message 89 (request or response) so that when the payload is stored (e.g., with 90 a HTTP PUT), only someone with the appropriate key can read it. 92 For example, it might be necessary to store a file on a server 93 without exposing its contents to that server. Furthermore, that same 94 file could be replicated to other servers (to make it more resistant 95 to server or network failure), downloaded by clients (to make it 96 available offline), etc. without exposing its contents. 98 These uses are not met by the use of TLS [RFC5246], since it only 99 encrypts the channel between the client and server. 101 This document specifies a content coding (Section 3.1.2 of [RFC7231]) 102 for HTTP to serve these and other use cases. 104 This content coding is not a direct adaptation of message-based 105 encryption formats - such as those that are described by [RFC4880], 106 [RFC5652], [RFC7516], and [XMLENC] - which are not suited to stream 107 processing, which is necessary for HTTP. The format described here 108 follows more closely to the lower level constructs described in 109 [RFC5116]. 111 To the extent that message-based encryption formats use the same 112 primitives, the format can be considered as sequence of encrypted 113 messages with a particular profile. For instance, Appendix A 114 explains how the format is congruent with a sequence of JSON Web 115 Encryption [RFC7516] values with a fixed header. 117 This mechanism is likely only a small part of a larger design that 118 uses content encryption. How clients and servers acquire and 119 identify keys will depend on the use case. In particular, a key 120 management system is not described. 122 1.1. Notational Conventions 124 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 125 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 126 document are to be interpreted as described in [RFC2119]. 128 2. The "aes128gcm" HTTP Content Coding 130 The "aes128gcm" HTTP content coding indicates that a payload has been 131 encrypted using Advanced Encryption Standard (AES) in Galois/Counter 132 Mode (GCM) as identified as AEAD_AES_128_GCM in [RFC5116], 133 Section 5.1. The AEAD_AES_128_GCM algorithm uses a 128 bit content 134 encryption key. 136 Using this content coding requires knowledge of a key. How this key 137 is acquired is not defined in this document. 139 The "aes128gcm" content coding uses a single fixed set of encryption 140 primitives. Cipher suite agility is achieved by defining a new 141 content coding scheme. This ensures that only the HTTP Accept- 142 Encoding header field is necessary to negotiate the use of 143 encryption. 145 The "aes128gcm" content coding uses a fixed record size. The final 146 encoding consists of a header (see Section 2.1) and zero or more 147 fixed size encrypted records; the final record can be smaller than 148 the record size. 150 The record size determines the length of each portion of plaintext 151 that is enciphered. The record size ("rs") is included in the 152 content coding header (see Section 2.1). 154 +-----------+ content 155 | data | any length up to rs-17 octets 156 +-----------+ 157 | 158 v 159 +-----------+-----+ add a delimiter octet (0x01 or 0x02) 160 | data | pad | then 0x00-valued octets to rs-16 161 +-----------+-----+ (or less on the last record) 162 | 163 v 164 +--------------------+ encrypt with AEAD_AES_128_GCM; 165 | ciphertext | final size is rs; 166 +--------------------+ the last record can be smaller 168 AEAD_AES_128_GCM produces ciphertext 16 octets longer than its input 169 plaintext. Therefore, the unencrypted content of each record is 170 shorter than the record size by 16 octets. Valid records always 171 contain at least a padding delimiter octet and a 16 octet 172 authentication tag. 174 Each record contains a single padding delimiter octet followed by any 175 number of zero octets. The last record uses a padding delimiter 176 octet set to the value 2, all other records have a padding delimiter 177 octet value of 1. 179 On decryption, the padding delimiter is the last non-zero valued 180 octet of the record. A decrypter MUST fail if the record contains no 181 non-zero octet. A decrypter MUST fail if the last record contains a 182 padding delimiter with a value other than 2 or if any record other 183 than the last contains a padding delimiter with a value other than 1. 185 The nonce for each record is a 96-bit value constructed from the 186 record sequence number and the input keying material. Nonce 187 derivation is covered in Section 2.3. 189 The additional data passed to each invocation of AEAD_AES_128_GCM is 190 a zero-length octet sequence. 192 A consequence of this record structure is that range requests 193 [RFC7233] and random access to encrypted payload bodies are possible 194 at the granularity of the record size. Partial records at the ends 195 of a range cannot be decrypted. Thus, it is best if range requests 196 start and end on record boundaries. Note however that random access 197 to specific parts of encrypted data could be confounded by the 198 presence of padding. 200 Selecting the record size most appropriate for a given situation 201 requires a trade-off. A smaller record size allows decrypted octets 202 to be released more rapidly, which can be appropriate for 203 applications that depend on responsiveness. Smaller records also 204 reduce the additional data required if random access into the 205 ciphertext is needed. 207 Applications that don't depending on streaming, random access, or 208 arbitrary padding can use larger records, or even a single record. A 209 larger record size reduces processing and data overheads. 211 2.1. Encryption Content Coding Header 213 The content coding uses a header block that includes all parameters 214 needed to decrypt the content (other than the key). The header block 215 is placed in the body of a message ahead of the sequence of records. 217 +-----------+--------+-----------+---------------+ 218 | salt (16) | rs (4) | idlen (1) | keyid (idlen) | 219 +-----------+--------+-----------+---------------+ 221 salt: The "salt" parameter comprises the first 16 octets of the 222 "aes128gcm" content coding header. The same "salt" parameter 223 value MUST NOT be reused for two different payload bodies that 224 have the same input keying material; generating a random salt for 225 every application of the content coding ensures that content 226 encryption key reuse is highly unlikely. 228 rs: The "rs" or record size parameter contains an unsigned 32-bit 229 integer in network byte order that describes the record size in 230 octets. Note that it is therefore impossible to exceed the 231 2^36-31 limit on plaintext input to AEAD_AES_128_GCM. Values 232 smaller than 18 are invalid. 234 idlen: The "idlen" parameter is an unsigned 8-bit integer that 235 defines the length of the "keyid" parameter. 237 keyid: The "keyid" parameter can be used to identify the keying 238 material that is used. This field is the length determined by the 239 "idlen" parameter. Recipients that receive a message are expected 240 to know how to retrieve keys; the "keyid" parameter might be input 241 to that process. A "keyid" parameter SHOULD be a UTF-8 [RFC3629] 242 encoded string, particularly where the identifier might need to be 243 rendered in a textual form. 245 2.2. Content Encryption Key Derivation 247 In order to allow the reuse of keying material for multiple different 248 HTTP messages, a content encryption key is derived for each message. 249 The content encryption key is derived from the "salt" parameter using 250 the HMAC-based key derivation function (HKDF) described in [RFC5869] 251 using the SHA-256 hash algorithm [FIPS180-4]. 253 The value of the "salt" parameter is the salt input to HKDF function. 254 The keying material identified by the "keyid" parameter is the input 255 keying material (IKM) to HKDF. Input keying material is expected to 256 be provided to recipients separately. The extract phase of HKDF 257 therefore produces a pseudorandom key (PRK) as follows: 259 PRK = HMAC-SHA-256(salt, IKM) 261 The info parameter to HKDF is set to the ASCII-encoded string 262 "Content-Encoding: aes128gcm" and a single zero octet: 264 cek_info = "Content-Encoding: aes128gcm" || 0x00 266 Note(1): Concatenation of octet sequences is represented by the "||" 267 operator. 269 Note(2): The strings used here and in Section 2.3 do not include a 270 terminating 0x00 octet, as is used in some programming languages. 272 AEAD_AES_128_GCM requires a 16 octet (128 bit) content encryption key 273 (CEK), so the length (L) parameter to HKDF is 16. The second step of 274 HKDF can therefore be simplified to the first 16 octets of a single 275 HMAC: 277 CEK = HMAC-SHA-256(PRK, cek_info || 0x01) 279 2.3. Nonce Derivation 281 The nonce input to AEAD_AES_128_GCM is constructed for each record. 282 The nonce for each record is a 12 octet (96 bit) value that is 283 derived from the record sequence number, input keying material, and 284 salt. 286 The input keying material and salt values are input to HKDF with 287 different info and length parameters. 289 The length (L) parameter is 12 octets. The info parameter for the 290 nonce is the ASCII-encoded string "Content-Encoding: nonce", 291 terminated by a a single zero octet: 293 nonce_info = "Content-Encoding: nonce" || 0x00 295 The result is combined with the record sequence number - using 296 exclusive or - to produce the nonce. The record sequence number 297 (SEQ) is a 96-bit unsigned integer in network byte order that starts 298 at zero. 300 Thus, the final nonce for each record is a 12 octet value: 302 NONCE = HMAC-SHA-256(PRK, nonce_info || 0x01) XOR SEQ 304 This nonce construction prevents removal or reordering of records. 306 3. Examples 308 This section shows a few examples of the encrypted content coding. 310 Note: All binary values in the examples in this section use Base 64 311 Encoding with URL and Filename Safe Alphabet [RFC4648]. This 312 includes the bodies of requests. Whitespace and line wrapping is 313 added to fit formatting constraints. 315 3.1. Encryption of a Response 317 Here, a successful HTTP GET response has been encrypted. This uses a 318 record size of 4096 and no padding (just the single octet padding 319 delimiter), so only a partial record is present. The input keying 320 material is identified by an empty string (that is, the "keyid" field 321 in the header is zero octets in length). 323 The encrypted data in this example is the UTF-8 encoded string "I am 324 the walrus". The input keying material is the value "yqdlZ- 325 tYemfogSmv7Ws5PQ" (in base64url). The 54 octet content body contains 326 a single record and is shown here using 71 base64url characters for 327 presentation reasons. 329 HTTP/1.1 200 OK 330 Content-Type: application/octet-stream 331 Content-Length: 54 332 Content-Encoding: aes128gcm 334 I1BsxtFttlv3u_Oo94xnmwAAEAAA-NAVub2qFgBEuQKRapoZu-IxkIva3MEB1PD- 335 ly8Thjg 336 Note that the media type has been changed to "application/octet- 337 stream" to avoid exposing information about the content. 338 Alternatively (and equivalently), the Content-Type header field can 339 be omitted. 341 Intermediate values for this example (all shown using base64url): 343 salt (from header) = I1BsxtFttlv3u_Oo94xnmw 344 PRK = zyeH5phsIsgUyd4oiSEIy35x-gIi4aM7y0hCF8mwn9g 345 CEK = _wniytB-ofscZDh4tbSjHw 346 NONCE = Bcs8gkIRKLI8GeI8 347 unencrypted data = SSBhbSB0aGUgd2FscnVzAg 349 3.2. Encryption with Multiple Records 351 This example shows the same message with input keying material of 352 "BO3ZVPxUlnLORbVGMpbT1Q". In this example, the plaintext is split 353 into records of 25 octets each (that is, the "rs" field in the header 354 is 25). The first record includes one 0x00 padding octet. This 355 means that there are 7 octets of message in the first record, and 8 356 in the second. A key identifier of the UTF-8 encoded string "a1" is 357 also included in the header. 359 HTTP/1.1 200 OK 360 Content-Length: 73 361 Content-Encoding: aes128gcm 363 uNCkWiNYzKTnBN9ji3-qWAAAABkCYTHOG8chz_gnvgOqdGYovxyjuqRyJFjEDyoF 364 1Fvkj6hQPdPHI51OEUKEpgz3SsLWIqS_uA 366 4. Security Considerations 368 This mechanism assumes the presence of a key management framework 369 that is used to manage the distribution of keys between valid senders 370 and receivers. Defining key management is part of composing this 371 mechanism into a larger application, protocol, or framework. 373 Implementation of cryptography - and key management in particular - 374 can be difficult. For instance, implementations need to account for 375 the potential for exposing keying material on side channels, such as 376 might be exposed by the time it takes to perform a given operation. 377 The requirements for a good implementation of cryptographic 378 algorithms can change over time. 380 4.1. Automatic Decryption 382 As a content coding, a "aes128gcm" content coding might be 383 automatically removed by a receiver in way that is not obvious to the 384 ultimate consumer of a message. Recipients that depend on content 385 origin authentication using this mechanism MUST reject messages that 386 don't include the "aes128gcm" content coding. 388 4.2. Message Truncation 390 This content encoding is designed to permit the incremental 391 processing of large messages. It also permits random access to 392 plaintext in a limited fashion. The content encoding permits a 393 receiver to detect when a message is truncated. 395 A partially delivered message MUST NOT be processed as though the 396 entire message was successfully delivered. For instance, a partially 397 delivered message cannot be cached as though it were complete. 399 An attacker might exploit willingness to process partial messages to 400 cause a receiver to remain in a specific intermediate state. 401 Implementations performing processing on partial messages need to 402 ensure that any intermediate processing states don't advantage an 403 attacker. 405 4.3. Key and Nonce Reuse 407 Encrypting different plaintext with the same content encryption key 408 and nonce in AES-GCM is not safe [RFC5116]. The scheme defined here 409 uses a fixed progression of nonce values. Thus, a new content 410 encryption key is needed for every application of the content coding. 411 Since input keying material can be reused, a unique "salt" parameter 412 is needed to ensure a content encryption key is not reused. 414 If a content encryption key is reused - that is, if input keying 415 material and salt are reused - this could expose the plaintext and 416 the authentication key, nullifying the protection offered by 417 encryption. Thus, if the same input keying material is reused, then 418 the salt parameter MUST be unique each time. This ensures that the 419 content encryption key is not reused. An implementation SHOULD 420 generate a random salt parameter for every message. 422 4.4. Data Encryption Limits 424 There are limits to the data that AEAD_AES_128_GCM can encipher. The 425 maximum value for the record size is limited by the size of the "rs" 426 field in the header (see Section 2.1), which ensures that the 2^36-31 427 limit for a single application of AEAD_AES_128_GCM is not reached 429 [RFC5116]. In order to preserve a 2^-40 probability of 430 indistinguishability under chosen plaintext attack (IND-CPA), the 431 total amount of plaintext that can be enciphered with the key derived 432 from the same input keying material and salt MUST be less than 2^44.5 433 blocks of 16 octets [AEBounds]. 435 If the record size is a multiple of 16 octets, this means 398 436 terabytes can be encrypted safely, including padding and overhead. 437 However, if the record size is not a multiple of 16 octets, the total 438 amount of data that can be safely encrypted is reduced because 439 partial AES blocks are encrypted. The worst case is a record size of 440 18 octets, for which at most 74 terabytes of plaintext can be 441 encrypted, of which at least half is padding. 443 4.5. Content Integrity 445 This mechanism only provides content origin authentication. The 446 authentication tag only ensures that an entity with access to the 447 content encryption key produced the encrypted data. 449 Any entity with the content encryption key can therefore produce 450 content that will be accepted as valid. This includes all recipients 451 of the same HTTP message. 453 Furthermore, any entity that is able to modify both the Content- 454 Encoding header field and the HTTP message body can replace the 455 contents. Without the content encryption key or the input keying 456 material, modifications to or replacement of parts of a payload body 457 are not possible. 459 4.6. Leaking Information in Header Fields 461 Because only the payload body is encrypted, information exposed in 462 header fields is visible to anyone who can read the HTTP message. 463 This could expose side-channel information. 465 For example, the Content-Type header field can leak information about 466 the payload body. 468 There are a number of strategies available to mitigate this threat, 469 depending upon the application's threat model and the users' 470 tolerance for leaked information: 472 1. Determine that it is not an issue. For example, if it is 473 expected that all content stored will be "application/json", or 474 another very common media type, exposing the Content-Type header 475 field could be an acceptable risk. 477 2. If it is considered sensitive information and it is possible to 478 determine it through other means (e.g., out of band, using hints 479 in other representations, etc.), omit the relevant headers, and/ 480 or normalize them. In the case of Content-Type, this could be 481 accomplished by always sending Content-Type: application/octet- 482 stream (the most generic media type), or no Content-Type at all. 484 3. If it is considered sensitive information and it is not possible 485 to convey it elsewhere, encapsulate the HTTP message using the 486 application/http media type (Section 8.3.2 of [RFC7230]), 487 encrypting that as the payload of the "outer" message. 489 4.7. Poisoning Storage 491 This mechanism only offers data origin authentication; it does not 492 perform authentication or authorization of the message creator, which 493 could still need to be performed (e.g., by HTTP authentication 494 [RFC7235]). 496 This is especially relevant when a HTTP PUT request is accepted by a 497 server without decrypting the payload; if the request is 498 unauthenticated, it becomes possible for a third party to deny 499 service and/or poison the store. 501 4.8. Sizing and Timing Attacks 503 Applications using this mechanism need to be aware that the size of 504 encrypted messages, as well as their timing, HTTP methods, URIs and 505 so on, may leak sensitive information. See for example [NETFLIX] or 506 [CLINIC]. 508 This risk can be mitigated through the use of the padding that this 509 mechanism provides. Alternatively, splitting up content into 510 segments and storing them separately might reduce exposure. HTTP/2 511 [RFC7540] combined with TLS [RFC5246] might be used to hide the size 512 of individual messages. 514 Developing a padding strategy is difficult. A good padding strategy 515 can depend on context. Common strategies include padding to a small 516 set of fixed lengths, padding to multiples of a value, or padding to 517 powers of 2. Even a good strategy can still cause size information 518 to leak if processing activity of a recipient can be observed. This 519 is especially true if the trailing records of a message contain only 520 padding. Distributing non-padding data across records is recommended 521 to avoid leaking size information. 523 5. IANA Considerations 525 5.1. The "aes128gcm" HTTP Content Coding 527 This memo registers the "aes128gcm" HTTP content coding in the HTTP 528 Content Codings Registry, as detailed in Section 2. 530 o Name: aes128gcm 532 o Description: AES-GCM encryption with a 128-bit content encryption 533 key 535 o Reference: this specification 537 6. References 539 6.1. Normative References 541 [FIPS180-4] 542 National Institute of Standards and Technology, U.S. 543 Department of Commerce, "NIST FIPS 180-4, Secure Hash 544 Standard", DOI 10.6028/NIST.FIPS.180-4, August 2015, 545 . 548 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 549 Requirement Levels", BCP 14, RFC 2119, 550 DOI 10.17487/RFC2119, March 1997, 551 . 553 [RFC3629] Yergeau, F., "UTF-8, a transformation format of ISO 554 10646", STD 63, RFC 3629, DOI 10.17487/RFC3629, November 555 2003, . 557 [RFC5116] McGrew, D., "An Interface and Algorithms for Authenticated 558 Encryption", RFC 5116, DOI 10.17487/RFC5116, January 2008, 559 . 561 [RFC5869] Krawczyk, H. and P. Eronen, "HMAC-based Extract-and-Expand 562 Key Derivation Function (HKDF)", RFC 5869, 563 DOI 10.17487/RFC5869, May 2010, 564 . 566 [RFC7230] Fielding, R., Ed. and J. Reschke, Ed., "Hypertext Transfer 567 Protocol (HTTP/1.1): Message Syntax and Routing", 568 RFC 7230, DOI 10.17487/RFC7230, June 2014, 569 . 571 [RFC7231] Fielding, R., Ed. and J. Reschke, Ed., "Hypertext Transfer 572 Protocol (HTTP/1.1): Semantics and Content", RFC 7231, 573 DOI 10.17487/RFC7231, June 2014, 574 . 576 6.2. Informative References 578 [AEBounds] 579 Luykx, A. and K. Paterson, "Limits on Authenticated 580 Encryption Use in TLS", March 2016, 581 . 583 [CLINIC] Miller, B., Huang, L., Joseph, A., and J. Tygar, "I Know 584 Why You Went to the Clinic: Risks and Realization of HTTPS 585 Traffic Analysis", March 2014, . 588 [NETFLIX] Reed, A. and M. Kranch, "Identifying HTTPS-Protected 589 Netflix Videos in Real-Time", Proceedings of the Seventh 590 ACM on Conference on Data and Application Security and 591 Privacy - CODASPY '17 , DOI 10.1145/3029806.3029821, 2017. 593 [RFC4648] Josefsson, S., "The Base16, Base32, and Base64 Data 594 Encodings", RFC 4648, DOI 10.17487/RFC4648, October 2006, 595 . 597 [RFC4880] Callas, J., Donnerhacke, L., Finney, H., Shaw, D., and R. 598 Thayer, "OpenPGP Message Format", RFC 4880, 599 DOI 10.17487/RFC4880, November 2007, 600 . 602 [RFC5246] Dierks, T. and E. Rescorla, "The Transport Layer Security 603 (TLS) Protocol Version 1.2", RFC 5246, 604 DOI 10.17487/RFC5246, August 2008, 605 . 607 [RFC5652] Housley, R., "Cryptographic Message Syntax (CMS)", STD 70, 608 RFC 5652, DOI 10.17487/RFC5652, September 2009, 609 . 611 [RFC7233] Fielding, R., Ed., Lafon, Y., Ed., and J. Reschke, Ed., 612 "Hypertext Transfer Protocol (HTTP/1.1): Range Requests", 613 RFC 7233, DOI 10.17487/RFC7233, June 2014, 614 . 616 [RFC7235] Fielding, R., Ed. and J. Reschke, Ed., "Hypertext Transfer 617 Protocol (HTTP/1.1): Authentication", RFC 7235, 618 DOI 10.17487/RFC7235, June 2014, 619 . 621 [RFC7516] Jones, M. and J. Hildebrand, "JSON Web Encryption (JWE)", 622 RFC 7516, DOI 10.17487/RFC7516, May 2015, 623 . 625 [RFC7540] Belshe, M., Peon, R., and M. Thomson, Ed., "Hypertext 626 Transfer Protocol Version 2 (HTTP/2)", RFC 7540, 627 DOI 10.17487/RFC7540, May 2015, 628 . 630 [XMLENC] Eastlake, D., Reagle, J., Hirsch, F., Roessler, T., 631 Imamura, T., Dillaway, B., Simon, E., Yiu, K., and M. 632 Nystroem, "XML Encryption Syntax and Processing", W3C 633 Recommendation REC-xmlenc-core1-20130411, January 2013, 634 . 636 Appendix A. JWE Mapping 638 The "aes128gcm" content coding can be considered as a sequence of 639 JSON Web Encryption (JWE) objects [RFC7516], each corresponding to a 640 single fixed size record that includes trailing padding. The 641 following transformations are applied to a JWE object that might be 642 expressed using the JWE Compact Serialization: 644 o The JWE Protected Header is fixed to the value { "alg": "dir", 645 "enc": "A128GCM" }, describing direct encryption using AES-GCM 646 with a 128-bit content encryption key. This header is not 647 transmitted, it is instead implied by the value of the Content- 648 Encoding header field. 650 o The JWE Encrypted Key is empty, as stipulated by the direct 651 encryption algorithm. 653 o The JWE Initialization Vector ("iv") for each record is set to the 654 exclusive or of the 96-bit record sequence number, starting at 655 zero, and a value derived from the input keying material (see 656 Section 2.3). This value is also not transmitted. 658 o The final value is the concatenated header, JWE Ciphertext, and 659 JWE Authentication Tag, all expressed without base64url encoding. 660 The "." separator is omitted, since the length of these fields is 661 known. 663 Thus, the example in Section 3.1 can be rendered using the JWE 664 Compact Serialization as: 666 eyAiYWxnIjogImRpciIsICJlbmMiOiAiQTEyOEdDTSIgfQ..Bcs8gkIRKLI8GeI8. 667 -NAVub2qFgBEuQKRapoZuw.4jGQi9rcwQHU8P6XLxOGOA 669 Where the first line represents the fixed JWE Protected Header, an 670 empty JWE Encrypted Key, and the algorithmically-determined JWE 671 Initialization Vector. The second line contains the encoded body, 672 split into JWE Ciphertext and JWE Authentication Tag. 674 Appendix B. Acknowledgements 676 Mark Nottingham was an original author of this document. 678 The following people provided valuable input: Richard Barnes, David 679 Benjamin, Peter Beverloo, JR Conlin, Mike Jones, Stephen Farrell, 680 Adam Langley, James Manger, John Mattsson, Julian Reschke, Eric 681 Rescorla, Jim Schaad, and Magnus Westerlund. 683 Author's Address 685 Martin Thomson 686 Mozilla 688 Email: martin.thomson@gmail.com