draft-ietf-httpbis-encryption-encoding-03.txt   draft-ietf-httpbis-encryption-encoding-04.txt 
HTTP Working Group M. Thomson HTTP Working Group M. Thomson
Internet-Draft Mozilla Internet-Draft Mozilla
Intended status: Standards Track October 9, 2016 Intended status: Standards Track October 31, 2016
Expires: April 12, 2017 Expires: May 4, 2017
Encrypted Content-Encoding for HTTP Encrypted Content-Encoding for HTTP
draft-ietf-httpbis-encryption-encoding-03 draft-ietf-httpbis-encryption-encoding-04
Abstract Abstract
This memo introduces a content coding for HTTP that allows message This memo introduces a content coding for HTTP that allows message
payloads to be encrypted. payloads to be encrypted.
Note to Readers Note to Readers
Discussion of this draft takes place on the HTTP working group Discussion of this draft takes place on the HTTP working group
mailing list (ietf-http-wg@w3.org), which is archived at mailing list (ietf-http-wg@w3.org), which is archived at
skipping to change at page 1, line 41 skipping to change at page 1, line 41
Internet-Drafts are working documents of the Internet Engineering Internet-Drafts are working documents of the Internet Engineering
Task Force (IETF). Note that other groups may also distribute Task Force (IETF). Note that other groups may also distribute
working documents as Internet-Drafts. The list of current Internet- working documents as Internet-Drafts. The list of current Internet-
Drafts is at http://datatracker.ietf.org/drafts/current/. Drafts is at http://datatracker.ietf.org/drafts/current/.
Internet-Drafts are draft documents valid for a maximum of six months Internet-Drafts are draft documents valid for a maximum of six months
and may be updated, replaced, or obsoleted by other documents at any and may be updated, replaced, or obsoleted by other documents at any
time. It is inappropriate to use Internet-Drafts as reference time. It is inappropriate to use Internet-Drafts as reference
material or to cite them other than as "work in progress." material or to cite them other than as "work in progress."
This Internet-Draft will expire on April 12, 2017. This Internet-Draft will expire on May 4, 2017.
Copyright Notice Copyright Notice
Copyright (c) 2016 IETF Trust and the persons identified as the Copyright (c) 2016 IETF Trust and the persons identified as the
document authors. All rights reserved. document authors. All rights reserved.
This document is subject to BCP 78 and the IETF Trust's Legal This document is subject to BCP 78 and the IETF Trust's Legal
Provisions Relating to IETF Documents Provisions Relating to IETF Documents
(http://trustee.ietf.org/license-info) in effect on the date of (http://trustee.ietf.org/license-info) in effect on the date of
publication of this document. Please review these documents publication of this document. Please review these documents
carefully, as they describe your rights and restrictions with respect carefully, as they describe your rights and restrictions with respect
to this document. Code Components extracted from this document must to this document. Code Components extracted from this document must
include Simplified BSD License text as described in Section 4.e of include Simplified BSD License text as described in Section 4.e of
the Trust Legal Provisions and are provided without warranty as the Trust Legal Provisions and are provided without warranty as
described in the Simplified BSD License. described in the Simplified BSD License.
Table of Contents Table of Contents
1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2
1.1. Notational Conventions . . . . . . . . . . . . . . . . . 3 1.1. Notational Conventions . . . . . . . . . . . . . . . . . 3
2. The "aesgcm" HTTP Content Coding . . . . . . . . . . . . . . 4 2. The "aes128gcm" HTTP Content Coding . . . . . . . . . . . . . 3
3. The Encryption HTTP Header Field . . . . . . . . . . . . . . 6 2.1. Encryption Content Coding Header . . . . . . . . . . . . 5
3.1. Encryption Header Field Parameters . . . . . . . . . . . 6 2.2. Content Encryption Key Derivation . . . . . . . . . . . . 6
3.2. Content Encryption Key Derivation . . . . . . . . . . . . 7 2.3. Nonce Derivation . . . . . . . . . . . . . . . . . . . . 7
3.3. Nonce Derivation . . . . . . . . . . . . . . . . . . . . 8 3. Crypto-Key Header Field . . . . . . . . . . . . . . . . . . . 7
4. Crypto-Key Header Field . . . . . . . . . . . . . . . . . . . 8 4. Examples . . . . . . . . . . . . . . . . . . . . . . . . . . 8
5. Examples . . . . . . . . . . . . . . . . . . . . . . . . . . 9 4.1. Encryption of a Response . . . . . . . . . . . . . . . . 8
5.1. Encryption of a Response . . . . . . . . . . . . . . . . 9 4.2. Encryption with Multiple Records . . . . . . . . . . . . 9
5.2. Encryption with Multiple Records . . . . . . . . . . . . 10 5. Security Considerations . . . . . . . . . . . . . . . . . . . 9
5.3. Encryption and Compression . . . . . . . . . . . . . . . 10 5.1. Key and Nonce Reuse . . . . . . . . . . . . . . . . . . . 10
5.4. Encryption with More Than One Key . . . . . . . . . . . . 11 5.2. Data Encryption Limits . . . . . . . . . . . . . . . . . 10
6. Security Considerations . . . . . . . . . . . . . . . . . . . 11 5.3. Content Integrity . . . . . . . . . . . . . . . . . . . . 10
6.1. Key and Nonce Reuse . . . . . . . . . . . . . . . . . . . 11 5.4. Leaking Information in Headers . . . . . . . . . . . . . 11
6.2. Data Encryption Limits . . . . . . . . . . . . . . . . . 12 5.5. Poisoning Storage . . . . . . . . . . . . . . . . . . . . 11
6.3. Content Integrity . . . . . . . . . . . . . . . . . . . . 12 5.6. Sizing and Timing Attacks . . . . . . . . . . . . . . . . 12
6.4. Leaking Information in Headers . . . . . . . . . . . . . 12 6. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 12
6.5. Poisoning Storage . . . . . . . . . . . . . . . . . . . . 13 6.1. The "aes128gcm" HTTP Content Coding . . . . . . . . . . . 12
6.6. Sizing and Timing Attacks . . . . . . . . . . . . . . . . 13 6.2. Crypto-Key Header Field . . . . . . . . . . . . . . . . . 12
7. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 13 6.3. The HTTP Crypto-Key Parameter Registry . . . . . . . . . 12
7.1. The "aesgcm" HTTP Content Coding . . . . . . . . . . . . 13 6.3.1. keyid . . . . . . . . . . . . . . . . . . . . . . . . 13
7.2. Encryption Header Fields . . . . . . . . . . . . . . . . 14 6.3.2. aes128gcm . . . . . . . . . . . . . . . . . . . . . . 13
7.3. The HTTP Encryption Parameter Registry . . . . . . . . . 14 7. References . . . . . . . . . . . . . . . . . . . . . . . . . 13
7.3.1. keyid . . . . . . . . . . . . . . . . . . . . . . . . 15 7.1. Normative References . . . . . . . . . . . . . . . . . . 13
7.3.2. salt . . . . . . . . . . . . . . . . . . . . . . . . 15 7.2. Informative References . . . . . . . . . . . . . . . . . 14
7.3.3. rs . . . . . . . . . . . . . . . . . . . . . . . . . 15 Appendix A. JWE Mapping . . . . . . . . . . . . . . . . . . . . 15
7.4. The HTTP Crypto-Key Parameter Registry . . . . . . . . . 15 Appendix B. Acknowledgements . . . . . . . . . . . . . . . . . . 16
7.4.1. keyid . . . . . . . . . . . . . . . . . . . . . . . . 16 Author's Address . . . . . . . . . . . . . . . . . . . . . . . . 16
7.4.2. aesgcm . . . . . . . . . . . . . . . . . . . . . . . 16
8. References . . . . . . . . . . . . . . . . . . . . . . . . . 16
8.1. Normative References . . . . . . . . . . . . . . . . . . 16
8.2. Informative References . . . . . . . . . . . . . . . . . 17
Appendix A. JWE Mapping . . . . . . . . . . . . . . . . . . . . 18
Appendix B. Acknowledgements . . . . . . . . . . . . . . . . . . 19
Author's Address . . . . . . . . . . . . . . . . . . . . . . . . 19
1. Introduction 1. Introduction
It is sometimes desirable to encrypt the contents of a HTTP message It is sometimes desirable to encrypt the contents of a HTTP message
(request or response) so that when the payload is stored (e.g., with (request or response) so that when the payload is stored (e.g., with
a HTTP PUT), only someone with the appropriate key can read it. a HTTP PUT), only someone with the appropriate key can read it.
For example, it might be necessary to store a file on a server For example, it might be necessary to store a file on a server
without exposing its contents to that server. Furthermore, that same without exposing its contents to that server. Furthermore, that same
file could be replicated to other servers (to make it more resistant file could be replicated to other servers (to make it more resistant
skipping to change at page 4, line 5 skipping to change at page 3, line 41
Key header field that can be used to convey keying material. Key header field that can be used to convey keying material.
1.1. Notational Conventions 1.1. Notational Conventions
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
"SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
document are to be interpreted as described in [RFC2119]. document are to be interpreted as described in [RFC2119].
Base64url encoding is defined in Section 2 of [RFC7515]. Base64url encoding is defined in Section 2 of [RFC7515].
2. The "aesgcm" HTTP Content Coding 2. The "aes128gcm" HTTP Content Coding
The "aesgcm" HTTP content coding indicates that a payload has been The "aes128gcm" HTTP content coding indicates that a payload has been
encrypted using Advanced Encryption Standard (AES) in Galois/Counter encrypted using Advanced Encryption Standard (AES) in Galois/Counter
Mode (GCM) as identified as AEAD_AES_128_GCM in [RFC5116], Mode (GCM) as identified as AEAD_AES_128_GCM in [RFC5116],
Section 5.1. The AEAD_AES_128_GCM algorithm uses a 128 bit content Section 5.1. The AEAD_AES_128_GCM algorithm uses a 128 bit content
encryption key. encryption key.
When this content coding is in use, the Encryption header field Using this content coding requires knowledge of a key. The Crypto-
(Section 3) describes how encryption has been applied. The Crypto- Key header field (Section 3) can be included to describe how the
Key header field (Section 4) can be included to describe how the content encryption key is derived or retrieved. Keys might be
content encryption key is derived or retrieved. provided in messages that are separate from those with encrypted
content using Crypto-Key, or provided through external mechanisms.
The "aesgcm" content coding uses a single fixed set of encryption The "aes128gcm" content coding uses a single fixed set of encryption
primitives. Cipher suite agility is achieved by defining a new primitives. Cipher suite agility is achieved by defining a new
content coding scheme. This ensures that only the HTTP Accept- content coding scheme. This ensures that only the HTTP Accept-
Encoding header field is necessary to negotiate the use of Encoding header field is necessary to negotiate the use of
encryption. encryption.
The "aesgcm" content coding uses a fixed record size. The resulting The "aes128gcm" content coding uses a fixed record size. The final
encoding is either a single record, or a series of fixed-size encoding consists of a header (see Section 2.1), zero or more fixed
records. The final record, or a lone record, MUST be shorter than size encrypted records, and a partial record. The partial record
the fixed record size. MUST be shorter than the fixed record size.
+-----------+ content is rs octets minus padding +-----------+ content is rs octets minus padding
| data | of between 2 and 65537 octets; | data | of between 2 and 65537 octets;
+-----------+ the last record is smaller +-----------+ the last record is smaller
| |
v v
+-----+-----------+ add padding to get rs octets; +-----+-----------+ add padding to get rs octets;
| pad | data | the last record contains | pad | data | the last record contains
+-----+-----------+ up to rs minus 1 octets +-----+-----------+ up to rs minus 1 octets
| |
v v
+--------------------+ encrypt with AEAD_AES_128_GCM; +--------------------+ encrypt with AEAD_AES_128_GCM;
| ciphertext | final size is rs plus 16 octets | ciphertext | final size is rs plus 16 octets
+--------------------+ the last record is smaller +--------------------+ the last record is smaller
The record size determines the length of each portion of plaintext The record size determines the length of each portion of plaintext
that is enciphered, with the exception of the final record, which is that is enciphered, with the exception of the final record, which is
necessarily smaller. The record size defaults to 4096 octets, but necessarily smaller. The record size ("rs") is included in the
can be changed using the "rs" parameter on the Encryption header content coding header (see Section 2.1).
field.
AEAD_AES_128_GCM produces ciphertext 16 octets longer than its input AEAD_AES_128_GCM produces ciphertext 16 octets longer than its input
plaintext. Therefore, the length of each enciphered record other plaintext. Therefore, the length of each enciphered record other
than the last is equal to the value of the "rs" parameter plus 16 than the last is equal to the value of the "rs" parameter plus 16
octets. A receiver MUST fail to decrypt if the final record octets. To prevent an attacker from truncating a stream, an encoder
ciphertext is less than 18 octets in size. Valid records always MUST append a record that contains only padding and is smaller than
the full record size if the final record ends on a record boundary.
A receiver MUST fail to decrypt if the final record ciphertext is
less than 18 octets in size or equal to the record size plus 16 (that
is, the size of a full encrypted record). Valid records always
contain at least two octets of padding and a 16 octet authentication contain at least two octets of padding and a 16 octet authentication
tag. tag.
Each record contains between 2 and 65537 octets of padding, inserted Each record contains between 2 and 65537 octets of padding, inserted
into a record before the enciphered content. Padding consists of a into a record before the enciphered content. Padding consists of a
two octet unsigned integer in network byte order, followed that two octet unsigned integer in network byte order, followed that
number of zero-valued octets. A receiver MUST fail to decrypt if any number of zero-valued octets. A receiver MUST fail to decrypt if any
padding octet other than the first two are non-zero, or a record has padding octet other than the first two are non-zero, or a record has
more padding than the record size can accommodate. more padding than the record size can accommodate.
The nonce for each record is a 96-bit value constructed from the The nonce for each record is a 96-bit value constructed from the
record sequence number and the input keying material. Nonce record sequence number and the input keying material. Nonce
derivation is covered in Section 3.3. derivation is covered in Section 2.3.
The additional data passed to each invocation of AEAD_AES_128_GCM is The additional data passed to each invocation of AEAD_AES_128_GCM is
a zero-length octet sequence. a zero-length octet sequence.
A sequence of full-sized records can be truncated to produce a
shorter sequence of records with valid authentication tags. To
prevent an attacker from truncating a stream, an encoder MUST append
a record that contains only padding and is smaller than the full
record size if the final record ends on a record boundary. A
receiver MUST treat the stream as failed due to truncation if the
final record is the full record size.
A consequence of this record structure is that range requests A consequence of this record structure is that range requests
[RFC7233] and random access to encrypted payload bodies are possible [RFC7233] and random access to encrypted payload bodies are possible
at the granularity of the record size. However, without data from at the granularity of the record size. Partial records at the ends
adjacent ranges, partial records cannot be used. Thus, it is best if of a range cannot be decrypted. Thus, it is best if range requests
range requests start and end on multiples of the record size, plus start and end on record boundaries.
the 16 octet authentication tag size.
Selecting the record size most appropriate for a given situation Selecting the record size most appropriate for a given situation
requires a trade-off. A smaller record size allows decrypted octets requires a trade-off. A smaller record size allows decrypted octets
to be released more rapidly, which can be appropriate for to be released more rapidly, which can be appropriate for
applications that depend on responsiveness. Smaller records also applications that depend on responsiveness. Smaller records also
reduce the additional data required if random access into the reduce the additional data required if random access into the
ciphertext is needed. Applications that depend on being able to pad ciphertext is needed. Applications that depend on being able to pad
by arbitrary amounts cannot increase the record size beyond 65537 by arbitrary amounts cannot increase the record size beyond 65537
octets. octets.
Applications that don't depending on streaming, random access, or Applications that don't depending on streaming, random access, or
arbitrary padding can use larger records, or even a single record. A arbitrary padding can use larger records, or even a single record. A
larger record size reduces the processing and data overheads. larger record size reduces the processing and data overheads.
3. The Encryption HTTP Header Field 2.1. Encryption Content Coding Header
The "Encryption" HTTP header field describes the encrypted content
coding(s) that have been applied to a payload body, and therefore how
those content coding(s) can be removed.
The "Encryption" header field uses the extended ABNF syntax defined
in Section 1.2 of [RFC7230] and the "parameter" and "OWS" rules from
[RFC7231].
Encryption = #encryption_params
encryption_params = [ parameter *( OWS ";" OWS parameter ) ]
If the payload is encrypted more than once (as reflected by having
multiple content codings that imply encryption), each application of
the content coding is reflected in a separate Encryption header field
value in the order in which they were applied.
Encryption header field values with multiple instances of the same
parameter name are invalid.
Servers processing PUT requests MUST persist the value of the
Encryption header field, unless they remove the content coding by
decrypting the payload.
3.1. Encryption Header Field Parameters The content coding uses a header block that includes all parameters
needed to decrypt the content (other than the key). The header block
is placed in the body of a message ahead of the sequence of records.
The following parameters are used in determining the content +-----------+--------+-----------+---------------+
encryption key that is used for encryption: | salt (16) | rs (4) | idlen (1) | keyid (idlen) |
+-----------+--------+-----------+---------------+
keyid: The "keyid" parameter identifies the keying material that is salt: The "salt" parameter comprises the first 16 octets of the
used. When the Crypto-Key header field is used, the "keyid" "aes128gcm" content coding header. The same "salt" parameter
identifies a matching value in that field. The "keyid" parameter value MUST NOT be reused for two different payload bodies that
MUST be used if keying material included in an Crypto-Key header have the same input keying material; generating a random salt for
field is needed to derive the content encryption key. The "keyid" every application of the content coding ensures that content
parameter can also be used to identify keys in an application- encryption key reuse is highly unlikely.
specific fashion.
salt: The "salt" parameter contains a base64url-encoded octets rs: The "rs" or record size parameter contains an unsigned 32-bit
[RFC7515] that is used as salt in deriving a unique content integer in network byte order that describes the record size in
encryption key (see Section 3.2). The "salt" parameter MUST be octets. Note that it is therefore impossible to exceed the
present, and MUST be exactly 16 octets long when decoded. The 2^36-31 limit on plaintext input to AEAD_AES_128_GCM. Values
"salt" parameter MUST NOT be reused for two different payload smaller than 3 are invalid.
bodies that have the same input keying material; generating a
random salt for every application of the content coding ensures
that content encryption key reuse is highly unlikely.
rs: The "rs" parameter contains a positive decimal integer that keyid: The "keyid" parameter can be used to identify the keying
describes the record size in octets. This value MUST be greater material that is used. When the Crypto-Key header field is used,
than 1. For the "aesgcm" content coding, this value MUST NOT be the "keyid" identifies a matching value in that field. The
greater than 2^36-31 (see Section 6.2). The "rs" parameter is "keyid" parameter MUST be used if keying material included in an
optional. If the "rs" parameter is absent, the record size Crypto-Key header field is needed to derive the content encryption
defaults to 4096 octets. key. The "keyid" parameter can also be used to identify keys in
an application-specific fashion.
3.2. Content Encryption Key Derivation 2.2. Content Encryption Key Derivation
In order to allow the reuse of keying material for multiple different In order to allow the reuse of keying material for multiple different
HTTP messages, a content encryption key is derived for each message. HTTP messages, a content encryption key is derived for each message.
The content encryption key is derived from the decoded value of the The content encryption key is derived from the decoded value of the
"salt" parameter using the HMAC-based key derivation function (HKDF) "salt" parameter using the HMAC-based key derivation function (HKDF)
described in [RFC5869] using the SHA-256 hash algorithm [FIPS180-4]. described in [RFC5869] using the SHA-256 hash algorithm [FIPS180-4].
The decoded value of the "salt" parameter is the salt input to HKDF The value of the "salt" parameter is the salt input to HKDF function.
function. The keying material identified by the "keyid" parameter is The keying material identified by the "keyid" parameter is the input
the input keying material (IKM) to HKDF. Input keying material can keying material (IKM) to HKDF. Input keying material can either be
either be prearranged, or can be described using the Crypto-Key prearranged, or can be described using the Crypto-Key header field
header field (Section 4). The extract phase of HKDF therefore (Section 3). The extract phase of HKDF therefore produces a
produces a pseudorandom key (PRK) as follows: pseudorandom key (PRK) as follows:
PRK = HMAC-SHA-256(salt, IKM) PRK = HMAC-SHA-256(salt, IKM)
The info parameter to HKDF is set to the ASCII-encoded string The info parameter to HKDF is set to the ASCII-encoded string
"Content-Encoding: aesgcm", a single zero octet and an optional "Content-Encoding: aes128gcm" and a single zero octet:
context string:
cek_info = "Content-Encoding: aesgcm" || 0x00 || context cek_info = "Content-Encoding: aes128gcm" || 0x00
Unless otherwise specified, the context is a zero length octet Note: Concatenation of octet sequences is represented by the "||"
sequence. Specifications that use this content coding MAY specify operator.
the use of an expanded context to cover additional inputs in the key
derivation.
AEAD_AES_128_GCM requires a 16 octet (128 bit) content encryption key AEAD_AES_128_GCM requires a 16 octet (128 bit) content encryption key
(CEK), so the length (L) parameter to HKDF is 16. The second step of (CEK), so the length (L) parameter to HKDF is 16. The second step of
HKDF can therefore be simplified to the first 16 octets of a single HKDF can therefore be simplified to the first 16 octets of a single
HMAC: HMAC:
CEK = HMAC-SHA-256(PRK, cek_info || 0x01) CEK = HMAC-SHA-256(PRK, cek_info || 0x01)
3.3. Nonce Derivation 2.3. Nonce Derivation
The nonce input to AEAD_AES_128_GCM is constructed for each record. The nonce input to AEAD_AES_128_GCM is constructed for each record.
The nonce for each record is a 12 octet (96 bit) value is produced The nonce for each record is a 12 octet (96 bit) value that is
from the record sequence number and a value derived from the input produced from the record sequence number and a value derived from the
keying material. input keying material.
The input keying material and salt values are input to HKDF with The input keying material and salt values are input to HKDF with
different info and length parameters. different info and length parameters.
The length (L) parameter is 12 octets. The info parameter for the The length (L) parameter is 12 octets. The info parameter for the
nonce is the ASCII-encoded string "Content-Encoding: nonce", a single nonce is the ASCII-encoded string "Content-Encoding: nonce",
zero octet and an context: terminated by a a single zero octet:
nonce_info = "Content-Encoding: nonce" || 0x00 || context
The context for nonce derivation is the same as is used for content nonce_info = "Content-Encoding: nonce" || 0x00
encryption key derivation.
The result is combined with the record sequence number - using The result is combined with the record sequence number - using
exclusive or - to produce the nonce. The record sequence number exclusive or - to produce the nonce. The record sequence number
(SEQ) is a 96-bit unsigned integer in network byte order that starts (SEQ) is a 96-bit unsigned integer in network byte order that starts
at zero. at zero.
Thus, the final nonce for each record is a 12 octet value: Thus, the final nonce for each record is a 12 octet value:
NONCE = HMAC-SHA-256(PRK, nonce_info || 0x01) XOR SEQ NONCE = HMAC-SHA-256(PRK, nonce_info || 0x01) XOR SEQ
This nonce construction prevents removal or reordering of records. This nonce construction prevents removal or reordering of records.
However, it permits truncation of the tail of the sequence (see However, it permits truncation of the tail of the sequence (see
Section 2 for how this is avoided). Section 2 for how this is avoided).
4. Crypto-Key Header Field 3. Crypto-Key Header Field
A Crypto-Key header field can be used to describe the input keying A Crypto-Key header field can be used to describe the input keying
material used in the Encryption header field. material used by the "aes128gcm" content coding.
Ordinarily, this header field will not appear in the same message as
the encrypted content. Including the encryption key with the
encrypted payload reduces the value of using encryption to a somewhat
complicated checksum. However, the Crypto-Key header field could be
used in one message to provision keys for other messages.
The Crypto-Key header field uses the extended ABNF syntax defined in The Crypto-Key header field uses the extended ABNF syntax defined in
Section 1.2 of [RFC7230] and the "parameter" and "OWS" rules from Section 1.2 of [RFC7230] and the "parameter" and "OWS" rules from
[RFC7231]. [RFC7231].
Crypto-Key = #crypto_key_params Crypto-Key = #crypto-key-params
crypto_key_params = [ parameter *( OWS ";" OWS parameter ) ] crypto-key-params = [ parameter *( OWS ";" OWS parameter ) ]
keyid: The "keyid" parameter corresponds to the "keyid" parameter in keyid: The "keyid" parameter corresponds to the "keyid" parameter in
the Encryption header field. the content coding.
aesgcm: The "aesgcm" parameter contains the base64url-encoded octets aes128gcm: The "aes128gcm" parameter contains the base64url-encoded
[RFC7515] of the input keying material for the "aesgcm" content octets [RFC7515] of the input keying material for the "aes128gcm"
coding. content coding.
Crypto-Key header field values with multiple instances of the same Crypto-Key header field values with multiple instances of the same
parameter name are invalid. parameter name in a single crypto-key-params production are invalid.
The input keying material used by the key derivation (see The input keying material used by the key derivation (see
Section 3.2) can be determined based on the information in the Section 2.2) can be determined based on the information in the
Crypto-Key header field. Crypto-Key header field.
The value or values provided in the Crypto-Key header field is valid The value or values provided in the Crypto-Key header field is valid
only for the current HTTP message unless additional information only for the current HTTP message unless additional information
indicates a greater scope. indicates a greater scope.
Alternative methods for determining input keying material MAY be Alternative methods for determining input keying material MAY be
defined by specifications that use this content coding. This defined by specifications that use this content coding. This
document only defines the use of the "aesgcm" parameter which document only defines the use of the "aes128gcm" parameter which
describes an explicit key. describes an explicit key.
The "aesgcm" parameter MUST decode to at least 16 octets in order to The "aes128gcm" parameter MUST decode to at least 16 octets in order
be used as input keying material for "aesgcm" content coding. to be used as input keying material for "aes128gcm" content coding.
5. Examples 4. Examples
This section shows a few examples of the encrypted content coding. This section shows a few examples of the encrypted content coding.
Note: All binary values in the examples in this section use base64url Note: All binary values in the examples in this section use base64url
encoding [RFC7515]. This includes the bodies of requests. encoding [RFC7515]. This includes the bodies of requests.
Whitespace and line wrapping is added to fit formatting constraints. Whitespace and line wrapping is added to fit formatting constraints.
5.1. Encryption of a Response 4.1. Encryption of a Response
Here, a successful HTTP GET response has been encrypted using input Here, a successful HTTP GET response has been encrypted using input
keying material that is identified by a URI. keying material that is identified by the string "a1".
The encrypted data in this example is the UTF-8 encoded string "I am The encrypted data in this example is the UTF-8 encoded string "I am
the walrus". The input keying material is included in the Crypto-Key the walrus". The input keying material is included in the Crypto-Key
header field. The content body contains a single record only and is header field. The content body contains a single record only and is
shown here using base64url encoding for presentation reasons. shown here using base64url encoding for presentation reasons.
HTTP/1.1 200 OK HTTP/1.1 200 OK
Content-Type: application/octet-stream Content-Type: application/octet-stream
Content-Length: 33 Content-Length: 33
Content-Encoding: aesgcm Content-Encoding: aes128gcm
Encryption: keyid="a1"; salt="vr0o6Uq3w_KDWeatc27mUg" Crypto-Key: aes128gcm=B33e_VeFrOyIHwFTIfmesA
Crypto-Key: keyid="a1"; aesgcm="csPJEXBYA5U-Tal9EdJi-w"
VDeU0XxaJkOJDAxPl7h9JD5V8N43RorP7PfpPdZZQuwF 9Y1iaZMzICC05DO3y8dWiAAAopoAzpM9l8LHdpDaO9C-UvT4kttTI_edSsHv1o5b
lWZ5mBYL
Note that the media type has been changed to "application/octet- Note that the media type has been changed to "application/octet-
stream" to avoid exposing information about the content. stream" to avoid exposing information about the content.
Alternatively (and equivalently), the Content-Type header field can
be omitted.
5.2. Encryption with Multiple Records 4.2. Encryption with Multiple Records
This example shows the same encrypted message, but split into records This example shows the same encrypted message, but split into records
of 10 octets each. The first record includes a single additional of 10 octets each. The first record includes a single additional
octet of padding, which causes the end of the content to align with a octet of padding, which causes the end of the content to align with a
record boundary, forcing the creation of a third record that contains record boundary, forcing the creation of a third record that contains
only padding. only padding.
HTTP/1.1 200 OK HTTP/1.1 200 OK
Content-Length: 70 Content-Length: 70
Content-Encoding: aesgcm Content-Encoding: aes128gcm
Encryption: keyid="a1"; salt="4pdat984KmT9BWsU3np0nw"; rs=10 Crypto-Key: keyid="a1"; aes128gcm="BO3ZVPxUlnLORbVGMpbT1Q"
Crypto-Key: keyid="a1"; aesgcm="BO3ZVPxUlnLORbVGMpbT1Q"
uzLfrZ4cbMTC6hlUqHz4NvWZshFlTN3o2RLr6FrIuOKEfl2VrM_jYgoiIyEo
Zvc-ZGwV-RMJejG4M6ZfGysBAdhpPqrLzw
5.3. Encryption and Compression
In this example, a response is first compressed, then encrypted.
Note that this particular encoding might compromise confidentiality
if the contents could be influenced by an attacker.
HTTP/1.1 200 OK
Content-Type: text/html
Content-Encoding: gzip, aesgcm
Transfer-Encoding: chunked
Encryption: keyid="me@example.com";
salt="m2hJ_NttRtFyUiMRPwfpHA"
[encrypted payload]
5.4. Encryption with More Than One Key
Here, a PUT request has been encrypted twice with different input
keying material; decrypting twice is necessary to read the content.
The outer layer of encryption uses a 1200 octet record size.
PUT /thing HTTP/1.1
Host: storage.example.com
Content-Type: application/http
Content-Encoding: aesgcm, aesgcm
Content-Length: 1235
Encryption: keyid="mailto:me@example.com";
salt="NfzOeuV5USPRA-n_9s1Lag",
keyid="bob/keys/123";
salt="bDMSGoc2uobK_IhavSHsHA"; rs=1200
[encrypted payload] _lgOPHdbKmIaLnZC7_8huQAAAAoCYTGkQWUSYylMKzMduBHDCFDwL2oODx8nkh0n
uOTNrh48DaWSm02DiQPzQAOGe6xRAeBj588hH6jQRTh_szFRS2Nwx9Aeuiic
6. Security Considerations 5. Security Considerations
This mechanism assumes the presence of a key management framework This mechanism assumes the presence of a key management framework
that is used to manage the distribution of keys between valid senders that is used to manage the distribution of keys between valid senders
and receivers. Defining key management is part of composing this and receivers. Defining key management is part of composing this
mechanism into a larger application, protocol, or framework. mechanism into a larger application, protocol, or framework.
Implementation of cryptography - and key management in particular - Implementation of cryptography - and key management in particular -
can be difficult. For instance, implementations need to account for can be difficult. For instance, implementations need to account for
the potential for exposing keying material on side channels, such as the potential for exposing keying material on side channels, such as
might be exposed by the time it takes to perform a given operation. might be exposed by the time it takes to perform a given operation.
The requirements for a good implementation of cryptographic The requirements for a good implementation of cryptographic
algorithms can change over time. algorithms can change over time.
6.1. Key and Nonce Reuse 5.1. Key and Nonce Reuse
Encrypting different plaintext with the same content encryption key Encrypting different plaintext with the same content encryption key
and nonce in AES-GCM is not safe [RFC5116]. The scheme defined here and nonce in AES-GCM is not safe [RFC5116]. The scheme defined here
uses a fixed progression of nonce values. Thus, a new content uses a fixed progression of nonce values. Thus, a new content
encryption key is needed for every application of the content coding. encryption key is needed for every application of the content coding.
Since input keying material can be reused, a unique "salt" parameter Since input keying material can be reused, a unique "salt" parameter
is needed to ensure a content encryption key is not reused. is needed to ensure a content encryption key is not reused.
If a content encryption key is reused - that is, if input keying If a content encryption key is reused - that is, if input keying
material and salt are reused - this could expose the plaintext and material and salt are reused - this could expose the plaintext and
the authentication key, nullifying the protection offered by the authentication key, nullifying the protection offered by
encryption. Thus, if the same input keying material is reused, then encryption. Thus, if the same input keying material is reused, then
the salt parameter MUST be unique each time. This ensures that the the salt parameter MUST be unique each time. This ensures that the
content encryption key is not reused. An implementation SHOULD content encryption key is not reused. An implementation SHOULD
generate a random salt parameter for every message; a counter could generate a random salt parameter for every message; a counter could
achieve the same result. achieve the same result.
6.2. Data Encryption Limits 5.2. Data Encryption Limits
There are limits to the data that AEAD_AES_128_GCM can encipher. The There are limits to the data that AEAD_AES_128_GCM can encipher. The
maximum record size is 2^36-31 [RFC5116]. In order to preserve a maximum value for the record size is limited by the size of the "rs"
2^-40 probability of indistinguishability under chosen plaintext field in the header (see Section 2.1), which ensures that the 2^36-31
attack (IND-CPA), the total amount of plaintext that can be limit for a single application of AEAD_AES_128_GCM is not reached
enciphered MUST be less than 2^44.5 blocks [AEBounds]. [RFC5116]. In order to preserve a 2^-40 probability of
indistinguishability under chosen plaintext attack (IND-CPA), the
total amount of plaintext that can be enciphered MUST be less than
2^44.5 blocks of 16 octets [AEBounds].
If rs is a multiple of 16 octets, this means 398 terabytes can be If rs is a multiple of 16 octets, this means 398 terabytes can be
encrypted safely, including padding. However, if the record size is encrypted safely, including padding. However, if the record size is
a multiple of 16 octets, the total amount of data that can be safely not a multiple of 16 octets, the total amount of data that can be
encrypted is reduced. The worst case is a record size of 3 octets, safely encrypted is reduced proportionally. The worst case is a
for which at most 74 terabytes of plaintext can be encrypted, of record size of 3 octets, for which at most 74 terabytes of plaintext
which at least two-thirds is padding. can be encrypted, of which at least two-thirds is padding.
6.3. Content Integrity 5.3. Content Integrity
This mechanism only provides content origin authentication. The This mechanism only provides content origin authentication. The
authentication tag only ensures that an entity with access to the authentication tag only ensures that an entity with access to the
content encryption key produced the encrypted data. content encryption key produced the encrypted data.
Any entity with the content encryption key can therefore produce Any entity with the content encryption key can therefore produce
content that will be accepted as valid. This includes all recipients content that will be accepted as valid. This includes all recipients
of the same HTTP message. of the same HTTP message.
Furthermore, any entity that is able to modify both the Encryption Furthermore, any entity that is able to modify both the Encryption
skipping to change at page 12, line 34 skipping to change at page 11, line 4
This mechanism only provides content origin authentication. The This mechanism only provides content origin authentication. The
authentication tag only ensures that an entity with access to the authentication tag only ensures that an entity with access to the
content encryption key produced the encrypted data. content encryption key produced the encrypted data.
Any entity with the content encryption key can therefore produce Any entity with the content encryption key can therefore produce
content that will be accepted as valid. This includes all recipients content that will be accepted as valid. This includes all recipients
of the same HTTP message. of the same HTTP message.
Furthermore, any entity that is able to modify both the Encryption Furthermore, any entity that is able to modify both the Encryption
header field and the HTTP message body can replace the contents. header field and the HTTP message body can replace the contents.
Without the content encryption key or the input keying material, Without the content encryption key or the input keying material,
modifications to or replacement of parts of a payload body are not modifications to or replacement of parts of a payload body are not
possible. possible.
6.4. Leaking Information in Headers 5.4. Leaking Information in Headers
Because only the payload body is encrypted, information exposed in Because only the payload body is encrypted, information exposed in
header fields is visible to anyone who can read the HTTP message. header fields is visible to anyone who can read the HTTP message.
This could expose side-channel information. This could expose side-channel information.
For example, the Content-Type header field can leak information about For example, the Content-Type header field can leak information about
the payload body. the payload body.
There are a number of strategies available to mitigate this threat, There are a number of strategies available to mitigate this threat,
depending upon the application's threat model and the users' depending upon the application's threat model and the users'
skipping to change at page 13, line 22 skipping to change at page 11, line 39
in other representations, etc.), omit the relevant headers, and/ in other representations, etc.), omit the relevant headers, and/
or normalize them. In the case of Content-Type, this could be or normalize them. In the case of Content-Type, this could be
accomplished by always sending Content-Type: application/octet- accomplished by always sending Content-Type: application/octet-
stream (the most generic media type), or no Content-Type at all. stream (the most generic media type), or no Content-Type at all.
3. If it is considered sensitive information and it is not possible 3. If it is considered sensitive information and it is not possible
to convey it elsewhere, encapsulate the HTTP message using the to convey it elsewhere, encapsulate the HTTP message using the
application/http media type (Section 8.3.2 of [RFC7230]), application/http media type (Section 8.3.2 of [RFC7230]),
encrypting that as the payload of the "outer" message. encrypting that as the payload of the "outer" message.
6.5. Poisoning Storage 5.5. Poisoning Storage
This mechanism only offers encryption of content; it does not perform This mechanism only offers encryption of content; it does not perform
authentication or authorization, which still needs to be performed authentication or authorization, which still needs to be performed
(e.g., by HTTP authentication [RFC7235]). (e.g., by HTTP authentication [RFC7235]).
This is especially relevant when a HTTP PUT request is accepted by a This is especially relevant when a HTTP PUT request is accepted by a
server; if the request is unauthenticated, it becomes possible for a server; if the request is unauthenticated, it becomes possible for a
third party to deny service and/or poison the store. third party to deny service and/or poison the store.
6.6. Sizing and Timing Attacks 5.6. Sizing and Timing Attacks
Applications using this mechanism need to be aware that the size of Applications using this mechanism need to be aware that the size of
encrypted messages, as well as their timing, HTTP methods, URIs and encrypted messages, as well as their timing, HTTP methods, URIs and
so on, may leak sensitive information. so on, may leak sensitive information.
This risk can be mitigated through the use of the padding that this This risk can be mitigated through the use of the padding that this
mechanism provides. Alternatively, splitting up content into mechanism provides. Alternatively, splitting up content into
segments and storing the separately might reduce exposure. HTTP/2 segments and storing the separately might reduce exposure. HTTP/2
[RFC7540] combined with TLS [RFC5246] might be used to hide the size [RFC7540] combined with TLS [RFC5246] might be used to hide the size
of individual messages. of individual messages.
7. IANA Considerations 6. IANA Considerations
7.1. The "aesgcm" HTTP Content Coding 6.1. The "aes128gcm" HTTP Content Coding
This memo registers the "aesgcm" HTTP content coding in the HTTP This memo registers the "aes128gcm" HTTP content coding in the HTTP
Content Codings Registry, as detailed in Section 2. Content Codings Registry, as detailed in Section 2.
o Name: aesgcm o Name: aes128gcm
o Description: AES-GCM encryption with a 128-bit content encryption o Description: AES-GCM encryption with a 128-bit content encryption
key key
o Reference: this specification o Reference: this specification
7.2. Encryption Header Fields 6.2. Crypto-Key Header Field
This memo registers the "Encryption" HTTP header field in the
Permanent Message Header Registry, as detailed in Section 3.
o Field name: Encryption
o Protocol: HTTP
o Status: Standard
o Reference: this specification
o Notes:
This memo registers the "Crypto-Key" HTTP header field in the This memo registers the "Crypto-Key" HTTP header field in the
Permanent Message Header Registry, as detailed in Section 4. Permanent Message Header Registry, as detailed in Section 3.
o Field name: Crypto-Key o Field name: Crypto-Key
o Protocol: HTTP o Protocol: HTTP
o Status: Standard o Status: Standard
o Reference: this specification o Reference: this specification
o Notes: o Notes:
7.3. The HTTP Encryption Parameter Registry 6.3. The HTTP Crypto-Key Parameter Registry
This memo establishes a registry for parameters used by the
"Encryption" header field under the "Hypertext Transfer Protocol
(HTTP) Parameters" grouping. The "Hypertext Transfer Protocol (HTTP)
Encryption Parameters" registry operates under an "Specification
Required" policy [RFC5226].
Entries in this registry are expected to include the following
information:
o Parameter Name: The name of the parameter.
o Purpose: A brief description of the purpose of the parameter.
o Reference: A reference to a specification that defines the
semantics of the parameter.
The initial contents of this registry are:
7.3.1. keyid
o Parameter Name: keyid
o Purpose: Identify the key that is in use.
o Reference: this document
7.3.2. salt
o Parameter Name: salt
o Purpose: Provide a source of entropy for derivation of a content
encryption key. This value is mandatory.
o Reference: this document
7.3.3. rs
o Parameter Name: rs
o Purpose: The size of the encrypted records.
o Reference: this document
7.4. The HTTP Crypto-Key Parameter Registry
This memo establishes a registry for parameters used by the "Crypto- This memo establishes a registry for parameters used by the "Crypto-
Key" header field under the "Hypertext Transfer Protocol (HTTP) Key" header field under the "Hypertext Transfer Protocol (HTTP)
Parameters" grouping. The "Hypertext Transfer Protocol (HTTP) Parameters" grouping. The "Hypertext Transfer Protocol (HTTP)
Crypto-Key Parameters" operates under an "Specification Required" Crypto-Key Parameters" operates under an "Specification Required"
policy [RFC5226]. policy [RFC5226].
Entries in this registry are expected to include the following Entries in this registry are expected to include the following
information: information:
o Parameter Name: The name of the parameter. o Parameter Name: The name of the parameter.
o Purpose: A brief description of the purpose of the parameter. o Purpose: A brief description of the purpose of the parameter.
o Reference: A reference to a specification that defines the o Reference: A reference to a specification that defines the
semantics of the parameter. semantics of the parameter.
The initial contents of this registry are: The initial contents of this registry are:
7.4.1. keyid 6.3.1. keyid
o Parameter Name: keyid o Parameter Name: keyid
o Purpose: Identify the key that is in use. o Purpose: Identify the key that is in use.
o Reference: this document o Reference: this document
7.4.2. aesgcm 6.3.2. aes128gcm
o Parameter Name: aesgcm o Parameter Name: aes128gcm
o Purpose: Provide an explicit input keying material value for the o Purpose: Provide an explicit input keying material value for the
aesgcm content coding. aes128gcm content coding.
o Reference: this document o Reference: this document
8. References 7. References
8.1. Normative References 7.1. Normative References
[FIPS180-4] [FIPS180-4]
Department of Commerce, National., "NIST FIPS 180-4, Department of Commerce, National., "NIST FIPS 180-4,
Secure Hash Standard", March 2012, Secure Hash Standard", March 2012,
<http://csrc.nist.gov/publications/fips/fips180-4/ <http://csrc.nist.gov/publications/fips/fips180-4/
fips-180-4.pdf>. fips-180-4.pdf>.
[RFC2119] Bradner, S., "Key words for use in RFCs to Indicate [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate
Requirement Levels", BCP 14, RFC 2119, Requirement Levels", BCP 14, RFC 2119,
DOI 10.17487/RFC2119, March 1997, DOI 10.17487/RFC2119, March 1997,
skipping to change at page 17, line 19 skipping to change at page 14, line 29
[RFC7231] Fielding, R., Ed. and J. Reschke, Ed., "Hypertext Transfer [RFC7231] Fielding, R., Ed. and J. Reschke, Ed., "Hypertext Transfer
Protocol (HTTP/1.1): Semantics and Content", RFC 7231, Protocol (HTTP/1.1): Semantics and Content", RFC 7231,
DOI 10.17487/RFC7231, June 2014, DOI 10.17487/RFC7231, June 2014,
<http://www.rfc-editor.org/info/rfc7231>. <http://www.rfc-editor.org/info/rfc7231>.
[RFC7515] Jones, M., Bradley, J., and N. Sakimura, "JSON Web [RFC7515] Jones, M., Bradley, J., and N. Sakimura, "JSON Web
Signature (JWS)", RFC 7515, DOI 10.17487/RFC7515, May Signature (JWS)", RFC 7515, DOI 10.17487/RFC7515, May
2015, <http://www.rfc-editor.org/info/rfc7515>. 2015, <http://www.rfc-editor.org/info/rfc7515>.
8.2. Informative References 7.2. Informative References
[AEBounds] [AEBounds]
Luykx, A. and K. Paterson, "Limits on Authenticated Luykx, A. and K. Paterson, "Limits on Authenticated
Encryption Use in TLS", March 2016, Encryption Use in TLS", March 2016,
<http://www.isg.rhul.ac.uk/~kp/TLS-AEbounds.pdf>. <http://www.isg.rhul.ac.uk/~kp/TLS-AEbounds.pdf>.
[RFC4880] Callas, J., Donnerhacke, L., Finney, H., Shaw, D., and R. [RFC4880] Callas, J., Donnerhacke, L., Finney, H., Shaw, D., and R.
Thayer, "OpenPGP Message Format", RFC 4880, Thayer, "OpenPGP Message Format", RFC 4880,
DOI 10.17487/RFC4880, November 2007, DOI 10.17487/RFC4880, November 2007,
<http://www.rfc-editor.org/info/rfc4880>. <http://www.rfc-editor.org/info/rfc4880>.
skipping to change at page 18, line 10 skipping to change at page 15, line 24
[RFC7516] Jones, M. and J. Hildebrand, "JSON Web Encryption (JWE)", [RFC7516] Jones, M. and J. Hildebrand, "JSON Web Encryption (JWE)",
RFC 7516, DOI 10.17487/RFC7516, May 2015, RFC 7516, DOI 10.17487/RFC7516, May 2015,
<http://www.rfc-editor.org/info/rfc7516>. <http://www.rfc-editor.org/info/rfc7516>.
[RFC7540] Belshe, M., Peon, R., and M. Thomson, Ed., "Hypertext [RFC7540] Belshe, M., Peon, R., and M. Thomson, Ed., "Hypertext
Transfer Protocol Version 2 (HTTP/2)", RFC 7540, Transfer Protocol Version 2 (HTTP/2)", RFC 7540,
DOI 10.17487/RFC7540, May 2015, DOI 10.17487/RFC7540, May 2015,
<http://www.rfc-editor.org/info/rfc7540>. <http://www.rfc-editor.org/info/rfc7540>.
[XMLENC] Eastlake, D., Reagle, J., Imamura, T., Dillaway, B., and [XMLENC] Eastlake, D., Reagle, J., Hirsch, F., Roessler, T.,
E. Simon, "XML Encryption Syntax and Processing", W3C Imamura, T., Dillaway, B., Simon, E., Yiu, K., and M.
REC , December 2002, <http://www.w3.org/TR/xmlenc-core/>. Nystroem, "XML Encryption Syntax and Processing", W3C
Recommendation REC-xmlenc-core1-20130411 , January 2013,
<https://www.w3.org/TR/2013/REC-xmlenc-core1-20130411>.
Appendix A. JWE Mapping Appendix A. JWE Mapping
The "aesgcm" content coding can be considered as a sequence of JSON The "aes128gcm" content coding can be considered as a sequence of
Web Encryption (JWE) objects [RFC7516], each corresponding to a JSON Web Encryption (JWE) objects [RFC7516], each corresponding to a
single fixed size record that includes leading padding. The single fixed size record that includes leading padding. The
following transformations are applied to a JWE object that might be following transformations are applied to a JWE object that might be
expressed using the JWE Compact Serialization: expressed using the JWE Compact Serialization:
o The JWE Protected Header is fixed to the value { "alg": "dir", o The JWE Protected Header is fixed to the value { "alg": "dir",
"enc": "A128GCM" }, describing direct encryption using AES-GCM "enc": "A128GCM" }, describing direct encryption using AES-GCM
with a 128-bit content encryption key. This header is not with a 128-bit content encryption key. This header is not
transmitted, it is instead implied by the value of the Content- transmitted, it is instead implied by the value of the Content-
Encoding header field. Encoding header field.
o The JWE Encrypted Key is empty, as stipulated by the direct o The JWE Encrypted Key is empty, as stipulated by the direct
encryption algorithm. encryption algorithm.
o The JWE Initialization Vector ("iv") for each record is set to the o The JWE Initialization Vector ("iv") for each record is set to the
exclusive or of the 96-bit record sequence number, starting at exclusive or of the 96-bit record sequence number, starting at
zero, and a value derived from the input keying material (see zero, and a value derived from the input keying material (see
Section 3.3). This value is also not transmitted. Section 2.3). This value is also not transmitted.
o The final value is the concatenated JWE Ciphertext and the JWE o The final value is the concatenated header, JWE Ciphertext, and
Authentication Tag, both expressed without base64url encoding. JWE Authentication Tag, all expressed without base64url encoding.
The "." separator is omitted, since the length of these fields is The "." separator is omitted, since the length of these fields is
known. known.
Thus, the example in Section 5.1 can be rendered using the JWE Thus, the example in Section 4.1 can be rendered using the JWE
Compact Serialization as: Compact Serialization as:
eyAiYWxnIjogImRpciIsICJlbmMiOiAiQTEyOEdDTSIgfQ..31iQYc1v4a36EgyJ. eyAiYWxnIjogImRpciIsICJlbmMiOiAiQTEyOEdDTSIgfQ..31iQYc1v4a36EgyJ.
VDeU0XxaJkOJDAxPl7h9JD4.VfDeN0aKz-z36T3WWULsBQ AM6TPZfCx3aQ2jvQvlL0-JLb.21Mj951Kwe_WjluVZnmYFgs
Where the first line represents the fixed JWE Protected Header, an Where the first line represents the fixed JWE Protected Header, an
empty JWE Encrypted Key, and the algorithmically-determined JWE empty JWE Encrypted Key, and the algorithmically-determined JWE
Initialization Vector. The second line contains the encoded body, Initialization Vector. The second line contains the encoded body,
split into JWE Ciphertext and JWE Authentication Tag. split into JWE Ciphertext and JWE Authentication Tag.
Appendix B. Acknowledgements Appendix B. Acknowledgements
Mark Nottingham was an original author of this document. Mark Nottingham was an original author of this document.
The following people provided valuable input: Richard Barnes, David The following people provided valuable input: Richard Barnes, David
Benjamin, Peter Beverloo, Mike Jones, Stephen Farrell, Adam Langley, Benjamin, Peter Beverloo, JR Conlin, Mike Jones, Stephen Farrell,
John Mattsson, Eric Rescorla, and Jim Schaad. Adam Langley, John Mattsson, Julian Reschke, Eric Rescorla, Jim
Schaad, and Magnus Westerlund.
Author's Address Author's Address
Martin Thomson Martin Thomson
Mozilla Mozilla
Email: martin.thomson@gmail.com Email: martin.thomson@gmail.com
 End of changes. 79 change blocks. 
298 lines changed or deleted 181 lines changed or added

This html diff was produced by rfcdiff 1.45. The latest version is available from http://tools.ietf.org/tools/rfcdiff/