draft-ietf-httpbis-encryption-encoding-00.txt | draft-ietf-httpbis-encryption-encoding-01.txt | |||
---|---|---|---|---|
Network Working Group M. Thomson | HTTP Working Group M. Thomson | |||
Internet-Draft Mozilla | Internet-Draft Mozilla | |||
Intended status: Standards Track December 22, 2015 | Intended status: Standards Track March 20, 2016 | |||
Expires: June 24, 2016 | Expires: September 21, 2016 | |||
Encrypted Content-Encoding for HTTP | Encrypted Content-Encoding for HTTP | |||
draft-ietf-httpbis-encryption-encoding-00 | draft-ietf-httpbis-encryption-encoding-01 | |||
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 | ||||
Discussion of this draft takes place on the HTTP working group | ||||
mailing list (ietf-http-wg@w3.org), which is archived at | ||||
https://lists.w3.org/Archives/Public/ietf-http-wg/ . | ||||
Working Group information can be found at http://httpwg.github.io/ ; | ||||
source code and issues list for this draft can be found at | ||||
https://github.com/httpwg/http-extensions/labels/encryption . | ||||
Status of This Memo | Status of This Memo | |||
This Internet-Draft is submitted in full conformance with the | This Internet-Draft is submitted in full conformance with the | |||
provisions of BCP 78 and BCP 79. | provisions of BCP 78 and BCP 79. | |||
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 June 24, 2016. | This Internet-Draft will expire on September 21, 2016. | |||
Copyright Notice | Copyright Notice | |||
Copyright (c) 2015 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 . . . . . . . . . . . . . . . . . . . . . . . . 2 | 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3 | |||
1.1. Notational Conventions . . . . . . . . . . . . . . . . . 3 | 1.1. Notational Conventions . . . . . . . . . . . . . . . . . 3 | |||
2. The "aesgcm128" HTTP Content Encoding . . . . . . . . . . . . 3 | 2. The "aesgcm" HTTP Content Encoding . . . . . . . . . . . . . 4 | |||
3. The Encryption HTTP Header Field . . . . . . . . . . . . . . 5 | 3. The Encryption HTTP Header Field . . . . . . . . . . . . . . 5 | |||
3.1. Encryption Header Field Parameters . . . . . . . . . . . 6 | 3.1. Encryption Header Field Parameters . . . . . . . . . . . 6 | |||
3.2. Content Encryption Key Derivation . . . . . . . . . . . . 6 | 3.2. Content Encryption Key Derivation . . . . . . . . . . . . 7 | |||
3.3. Nonce Derivation . . . . . . . . . . . . . . . . . . . . 7 | 3.3. Nonce Derivation . . . . . . . . . . . . . . . . . . . . 7 | |||
4. Crypto-Key Header Field . . . . . . . . . . . . . . . . . . . 8 | 4. Crypto-Key Header Field . . . . . . . . . . . . . . . . . . . 8 | |||
4.1. Explicit Key . . . . . . . . . . . . . . . . . . . . . . 8 | 4.1. Explicit Key . . . . . . . . . . . . . . . . . . . . . . 9 | |||
4.2. Diffie-Hellman . . . . . . . . . . . . . . . . . . . . . 9 | 4.2. Diffie-Hellman . . . . . . . . . . . . . . . . . . . . . 9 | |||
4.3. Pre-shared Authentication Secrets . . . . . . . . . . . . 10 | 4.3. Pre-shared Authentication Secrets . . . . . . . . . . . . 10 | |||
5. Examples . . . . . . . . . . . . . . . . . . . . . . . . . . 11 | 5. Examples . . . . . . . . . . . . . . . . . . . . . . . . . . 11 | |||
5.1. Successful GET Response . . . . . . . . . . . . . . . . . 11 | 5.1. Successful GET Response . . . . . . . . . . . . . . . . . 11 | |||
5.2. Encryption and Compression . . . . . . . . . . . . . . . 11 | 5.2. Encryption and Compression . . . . . . . . . . . . . . . 12 | |||
5.3. Encryption with More Than One Key . . . . . . . . . . . . 11 | 5.3. Encryption with More Than One Key . . . . . . . . . . . . 12 | |||
5.4. Encryption with Explicit Key . . . . . . . . . . . . . . 12 | 5.4. Encryption with Explicit Key . . . . . . . . . . . . . . 12 | |||
5.5. Diffie-Hellman Encryption . . . . . . . . . . . . . . . . 12 | 5.5. Encryption with Multiple Records . . . . . . . . . . . . 13 | |||
6. Security Considerations . . . . . . . . . . . . . . . . . . . 13 | 5.6. Diffie-Hellman Encryption . . . . . . . . . . . . . . . . 13 | |||
6.1. Key and Nonce Reuse . . . . . . . . . . . . . . . . . . . 13 | 5.7. Diffie-Hellman with Authentication Secret . . . . . . . . 14 | |||
6.2. Content Integrity . . . . . . . . . . . . . . . . . . . . 13 | 6. Security Considerations . . . . . . . . . . . . . . . . . . . 14 | |||
6.3. Leaking Information in Headers . . . . . . . . . . . . . 14 | 6.1. Key and Nonce Reuse . . . . . . . . . . . . . . . . . . . 15 | |||
6.4. Poisoning Storage . . . . . . . . . . . . . . . . . . . . 14 | 6.2. Content Integrity . . . . . . . . . . . . . . . . . . . . 15 | |||
6.5. Sizing and Timing Attacks . . . . . . . . . . . . . . . . 15 | 6.3. Leaking Information in Headers . . . . . . . . . . . . . 15 | |||
7. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 15 | 6.4. Poisoning Storage . . . . . . . . . . . . . . . . . . . . 16 | |||
7.1. The "aesgcm128" HTTP Content Encoding . . . . . . . . . . 15 | 6.5. Sizing and Timing Attacks . . . . . . . . . . . . . . . . 16 | |||
7.2. Encryption Header Fields . . . . . . . . . . . . . . . . 15 | 7. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 16 | |||
7.3. The HTTP Encryption Parameter Registry . . . . . . . . . 16 | 7.1. The "aesgcm" HTTP Content Encoding . . . . . . . . . . . 16 | |||
7.3.1. keyid . . . . . . . . . . . . . . . . . . . . . . . . 16 | 7.2. Encryption Header Fields . . . . . . . . . . . . . . . . 17 | |||
7.3.2. salt . . . . . . . . . . . . . . . . . . . . . . . . 16 | 7.3. The HTTP Encryption Parameter Registry . . . . . . . . . 17 | |||
7.3.3. rs . . . . . . . . . . . . . . . . . . . . . . . . . 17 | 7.3.1. keyid . . . . . . . . . . . . . . . . . . . . . . . . 18 | |||
7.4. The HTTP Crypto-Key Parameter Registry . . . . . . . . . 17 | 7.3.2. salt . . . . . . . . . . . . . . . . . . . . . . . . 18 | |||
7.4.1. keyid . . . . . . . . . . . . . . . . . . . . . . . . 17 | 7.3.3. rs . . . . . . . . . . . . . . . . . . . . . . . . . 18 | |||
7.4.2. aesgcm128 . . . . . . . . . . . . . . . . . . . . . . 17 | 7.4. The HTTP Crypto-Key Parameter Registry . . . . . . . . . 18 | |||
7.4.3. dh . . . . . . . . . . . . . . . . . . . . . . . . . 18 | 7.4.1. keyid . . . . . . . . . . . . . . . . . . . . . . . . 19 | |||
8. References . . . . . . . . . . . . . . . . . . . . . . . . . 18 | 7.4.2. aesgcm . . . . . . . . . . . . . . . . . . . . . . . 19 | |||
8.1. Normative References . . . . . . . . . . . . . . . . . . 18 | 7.4.3. dh . . . . . . . . . . . . . . . . . . . . . . . . . 19 | |||
8.2. Informative References . . . . . . . . . . . . . . . . . 19 | 8. References . . . . . . . . . . . . . . . . . . . . . . . . . 19 | |||
Appendix A. JWE Mapping . . . . . . . . . . . . . . . . . . . . 20 | 8.1. Normative References . . . . . . . . . . . . . . . . . . 19 | |||
Appendix B. Acknowledgements . . . . . . . . . . . . . . . . . . 21 | 8.2. Informative References . . . . . . . . . . . . . . . . . 20 | |||
Author's Address . . . . . . . . . . . . . . . . . . . . . . . . 21 | Appendix A. JWE Mapping . . . . . . . . . . . . . . . . . . . . 21 | |||
Appendix B. Intermediate Values for Encryption . . . . . . . . . 22 | ||||
Appendix C. Acknowledgements . . . . . . . . . . . . . . . . . . 23 | ||||
Author's Address . . . . . . . . . . . . . . . . . . . . . . . . 23 | ||||
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 3, line 42 ¶ | skipping to change at page 4, line 5 ¶ | |||
identify keys will depend on the use case. Though a complete key | identify keys will depend on the use case. Though a complete key | |||
management system is not described, this document defines an Crypto- | management system is not described, this document defines an Crypto- | |||
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]. | |||
2. The "aesgcm128" HTTP Content Encoding | Base64url encoding is defined in Section 2 of [RFC7515]. | |||
The "aesgcm128" HTTP content-coding indicates that a payload has been | 2. The "aesgcm" HTTP Content Encoding | |||
The "aesgcm" 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 | When this content-coding is in use, the Encryption header field | |||
(Section 3) describes how encryption has been applied. The Crypto- | (Section 3) describes how encryption has been applied. The Crypto- | |||
Key header field (Section 4) 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. | content encryption key is derived or retrieved. | |||
The "aesgcm128" content-coding uses a single fixed set of encryption | The "aesgcm" 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 "aesgcm128" content-coding uses a fixed record size. The | The "aesgcm" content-coding uses a fixed record size. The resulting | |||
resulting encoding is a series of fixed-size records, with a final | encoding is a series of fixed-size records, with a final record that | |||
record that is one or more octets shorter than a fixed sized record. | is one or more octets shorter than a fixed sized record. | |||
+------+ input of between rs-256 | +------+ input of between rs-65537 | |||
| data | and rs-1 octets | | data | and rs-2 octets | |||
+------+ (one fewer for the last record) | +------+ (one fewer for the last record) | |||
| | | | |||
v | v | |||
+-----+-----------+ | +-----+-----------+ | |||
| pad | data | add padding to form plaintext | | pad | data | add padding to form plaintext | |||
+-----+-----------+ | +-----+-----------+ | |||
| | | | |||
v | v | |||
+--------------------+ | +--------------------+ | |||
| ciphertext | encrypt with AEAD_AES_128_GCM | | ciphertext | encrypt with AEAD_AES_128_GCM | |||
skipping to change at page 4, line 45 ¶ | skipping to change at page 5, line 10 ¶ | |||
field. | field. | |||
AEAD_AES_128_GCM expands ciphertext to be 16 octets longer than its | AEAD_AES_128_GCM expands ciphertext to be 16 octets longer than its | |||
input plaintext. Therefore, the length of each enciphered record | input plaintext. Therefore, the length of each enciphered record | |||
other than the last is equal to the value of the "rs" parameter plus | other 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 | 16 octets. A receiver MUST fail to decrypt if the final record | |||
ciphertext is 16 octets or less in size. Valid records always | ciphertext is 16 octets or less in size. Valid records always | |||
contain at least one byte of padding and a 16 octet authentication | contain at least one byte of padding and a 16 octet authentication | |||
tag. | tag. | |||
Each record contains between 1 and 256 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 | |||
length byte, followed that number of zero-valued octets. A receiver | two octet unsigned integer in network byte order, followed that | |||
MUST fail to decrypt if any padding octet other than the first is | number of zero-valued octets. A receiver MUST fail to decrypt if any | |||
non-zero, or a record has more padding than the record size can | padding octet other than the first two are non-zero, or a record has | |||
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 3.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 | A sequence of full-sized records can be truncated to produce a | |||
shorter sequence of records with valid authentication tags. To | shorter sequence of records with valid authentication tags. To | |||
skipping to change at page 6, line 21 ¶ | skipping to change at page 6, line 35 ¶ | |||
The following parameters are used in determining the content | The following parameters are used in determining the content | |||
encryption key that is used for encryption: | encryption key that is used for encryption: | |||
keyid: The "keyid" parameter contains a string that identifies the | keyid: The "keyid" parameter contains a string that identifies the | |||
keying material that is used. The "keyid" parameter SHOULD be | keying material that is used. The "keyid" parameter SHOULD be | |||
included, unless key identification is guaranteed by other means. | included, unless key identification is guaranteed by other means. | |||
The "keyid" parameter MUST be used if keying material included in | The "keyid" parameter MUST be used if keying material included in | |||
an Crypto-Key header field is needed to derive the content | an Crypto-Key header field is needed to derive the content | |||
encryption key. | encryption key. | |||
salt: The "salt" parameter contains a base64 URL-encoded octets that | salt: The "salt" parameter contains a base64url-encoded octets | |||
is used as salt in deriving a unique content encryption key (see | [RFC7515] that is used as salt in deriving a unique content | |||
Section 3.2). The "salt" parameter MUST be present, and MUST be | encryption key (see Section 3.2). The "salt" parameter MUST be | |||
exactly 16 octets long when decoded. The "salt" parameter MUST | present, and MUST be exactly 16 octets long when decoded. The | |||
NOT be reused for two different payload bodies that have the same | "salt" parameter MUST NOT be reused for two different payload | |||
input keying material; generating a random salt for every | bodies that have the same input keying material; generating a | |||
application of the content encoding ensures that content | random salt for every application of the content encoding ensures | |||
encryption key reuse is highly unlikely. | that content encryption key reuse is highly unlikely. | |||
rs: The "rs" parameter contains a positive decimal integer that | rs: The "rs" parameter contains a positive decimal integer that | |||
describes the record size in octets. This value MUST be greater | describes the record size in octets. This value MUST be greater | |||
than 1. If the "rs" parameter is absent, the record size defaults | than 1. If the "rs" parameter is absent, the record size defaults | |||
to 4096 octets. | to 4096 octets. | |||
3.2. Content Encryption Key Derivation | 3.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. | |||
skipping to change at page 7, line 6 ¶ | skipping to change at page 7, line 22 ¶ | |||
The decoded value of the "salt" parameter is the salt input to HKDF | The decoded value of the "salt" parameter is the salt input to HKDF | |||
function. The keying material identified by the "keyid" parameter is | function. The keying material identified by the "keyid" parameter is | |||
the input keying material (IKM) to HKDF. Input keying material can | the input keying material (IKM) to HKDF. Input keying material can | |||
either be prearranged, or can be described using the Crypto-Key | either be prearranged, or can be described using the Crypto-Key | |||
header field (Section 4). The first step of HKDF is therefore: | header field (Section 4). The first step of HKDF is therefore: | |||
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: aesgcm128", a single zero octet and an optional | "Content-Encoding: aesgcm", a single zero octet and an optional | |||
context string: | context string: | |||
cek_info = "Content-Encoding: aesgcm128" || 0x00 || context | cek_info = "Content-Encoding: aesgcm" || 0x00 || context | |||
Unless otherwise specified, the context is a zero length octet | Unless otherwise specified, the context is a zero length octet | |||
sequence. Specifications that use this content encoding MAY specify | sequence. Specifications that use this content encoding MAY specify | |||
the use of an expanded context to cover additional inputs in the key | the use of an expanded context to cover additional inputs in the key | |||
derivation. | derivation. | |||
AEAD_AES_128_GCM requires a 16 octet (128 bit) content encryption | AEAD_AES_128_GCM requires a 16 octet (128 bit) content encryption | |||
key, so the length (L) parameter to HKDF is 16. The second step of | key, 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: | |||
skipping to change at page 8, line 21 ¶ | skipping to change at page 8, line 37 ¶ | |||
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" rule from [RFC7231]. | Section 1.2 of [RFC7230] and the "parameter" rule from [RFC7231]. | |||
Crypto-Key = #crypto_key_params | Crypto-Key = #crypto_key_params | |||
crypto_key_params = [ parameter *( ";" parameter ) ] | crypto_key_params = [ parameter *( ";" 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 Encryption header field. | |||
aesgcm128: The "aesgcm128" parameter contains the URL-safe base64 | aesgcm: The "aesgcm" parameter contains the base64url-encoded octets | |||
[RFC4648] octets of the input keying material. | [RFC7515] of the input keying material. | |||
dh: The "dh" parameter contains an ephemeral Diffie-Hellman share. | dh: The "dh" parameter contains an ephemeral Diffie-Hellman share. | |||
This form of the header field can be used to encrypt content for a | This form of the header field can be used to encrypt content for a | |||
specific recipient. | specific recipient. | |||
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 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 3.2) can be determined based on the information in the | |||
skipping to change at page 8, line 49 ¶ | skipping to change at page 9, line 20 ¶ | |||
Note that different methods for determining input keying material | Note that different methods for determining input keying material | |||
will produce different amounts of data. The HKDF process ensures | will produce different amounts of data. The HKDF process ensures | |||
that the final content encryption key is the necessary size. | that the final content encryption key is the necessary size. | |||
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-encoding. | defined by specifications that use this content-encoding. | |||
4.1. Explicit Key | 4.1. Explicit Key | |||
The "aesgcm128" parameter is decoded and used as the input keying | The "aesgcm" parameter is decoded and used as the input keying | |||
material for the "aesgcm128" content encoding. The "aesgcm128" | material for the "aesgcm" content encoding. The "aesgcm" parameter | |||
parameter MUST decode to at least 16 octets in order to be used as | MUST decode to at least 16 octets in order to be used as input keying | |||
input keying material for "aesgcm128" content encoding. | material for "aesgcm" content encoding. | |||
Other key determination parameters can be ignored if the "aesgcm128" | Other key determination parameters can be ignored if the "aesgcm" | |||
parameter is present. | parameter is present. | |||
4.2. Diffie-Hellman | 4.2. Diffie-Hellman | |||
The "dh" parameter is included to describe a Diffie-Hellman share, | The "dh" parameter is included to describe a Diffie-Hellman share, | |||
either modp (or finite field) Diffie-Hellman [DH] or elliptic curve | either modp (or finite field) Diffie-Hellman [DH] or elliptic curve | |||
Diffie-Hellman (ECDH) [RFC4492]. | Diffie-Hellman (ECDH) [RFC4492]. | |||
This share is combined with other information at the recipient to | This share is combined with other information at the recipient to | |||
determine the HKDF input keying material. In order for the exchange | determine the HKDF input keying material. In order for the exchange | |||
skipping to change at page 10, line 14 ¶ | skipping to change at page 10, line 31 ¶ | |||
context = label || 0x00 || | context = label || 0x00 || | |||
length(recipient_public) || recipient_public || | length(recipient_public) || recipient_public || | |||
length(sender_public) || sender_public | length(sender_public) || sender_public | |||
The two length fields are encoded as a two octet unsigned integer in | The two length fields are encoded as a two octet unsigned integer in | |||
network byte order. | network byte order. | |||
Specifications that rely on an Diffie-Hellman exchange for | Specifications that rely on an Diffie-Hellman exchange for | |||
determining input keying material MUST either specify the parameters | determining input keying material MUST either specify the parameters | |||
for Diffie-Hellman (group parameters, or curves and point format) | for Diffie-Hellman (label, group parameters, or curves and point | |||
that are used, or describe how those parameters are negotiated | format) that are used, or describe how those parameters are | |||
between sender and receiver. | negotiated between sender and receiver. | |||
4.3. Pre-shared Authentication Secrets | 4.3. Pre-shared Authentication Secrets | |||
Key derivation MAY be extended to include an additional | Key derivation MAY be extended to include an additional | |||
authentication secret. Such a secret is shared between the sender | authentication secret. Such a secret is shared between the sender | |||
and receiver of a message using other means. | and receiver of a message using other means. | |||
A pre-shared authentication secret is not explicitly signaled in | A pre-shared authentication secret is not explicitly signaled in | |||
either the Encryption or Crypto-Key header fields. Use of this | either the Encryption or Crypto-Key header fields. Use of this | |||
additional step depends on prior agreement. | additional step depends on prior agreement. | |||
skipping to change at page 11, line 9 ¶ | skipping to change at page 11, line 26 ¶ | |||
provided to the final key derivation stages. Alternatively, this | provided to the final key derivation stages. Alternatively, this | |||
phase can be viewed as always having a zero-length context. | phase can be viewed as always having a zero-length context. | |||
Note that in the absence of an authentication secret, the input | Note that in the absence of an authentication secret, the input | |||
keying material is simply the raw keying material: | keying material is simply the raw keying material: | |||
IKM = raw_key | IKM = raw_key | |||
5. Examples | 5. Examples | |||
This section shows a few examples of the content encoding. | ||||
Note: All binary values in the examples in this section use the URL | ||||
and filename safe variant of base64 [RFC4648]. This includes the | ||||
bodies of requests. Whitespace in these values is added to fit | ||||
formatting constraints. | ||||
5.1. Successful GET Response | 5.1. Successful GET Response | |||
HTTP/1.1 200 OK | HTTP/1.1 200 OK | |||
Content-Type: application/octet-stream | Content-Type: application/octet-stream | |||
Content-Encoding: aesgcm128 | Content-Encoding: aesgcm | |||
Connection: close | Connection: close | |||
Encryption: keyid="http://example.org/bob/keys/123"; | Encryption: keyid="http://example.org/bob/keys/123"; | |||
salt="XZwpw6o37R-6qoZjw6KwAw" | salt="XZwpw6o37R-6qoZjw6KwAw" | |||
[encrypted payload] | [encrypted payload] | |||
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 a URI. | |||
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. | |||
5.2. Encryption and Compression | 5.2. Encryption and Compression | |||
In this example, a response is first compressed, then encrypted. | ||||
Note that this particular encoding might compromise confidentiality | ||||
if the contents of the response could be influenced by an attacker. | ||||
HTTP/1.1 200 OK | HTTP/1.1 200 OK | |||
Content-Type: text/html | Content-Type: text/html | |||
Content-Encoding: aesgcm128, gzip | Content-Encoding: gzip, aesgcm | |||
Transfer-Encoding: chunked | Transfer-Encoding: chunked | |||
Encryption: keyid="mailto:me@example.com"; | Encryption: keyid="mailto:me@example.com"; | |||
salt="m2hJ_NttRtFyUiMRPwfpHA" | salt="m2hJ_NttRtFyUiMRPwfpHA" | |||
[encrypted payload] | [encrypted payload] | |||
5.3. Encryption with More Than One Key | 5.3. 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 | PUT /thing HTTP/1.1 | |||
Host: storage.example.com | Host: storage.example.com | |||
Content-Type: application/http | Content-Type: application/http | |||
Content-Encoding: aesgcm128, aesgcm128 | Content-Encoding: aesgcm, aesgcm | |||
Content-Length: 1234 | Content-Length: 1235 | |||
Encryption: keyid="mailto:me@example.com"; | Encryption: keyid="mailto:me@example.com"; | |||
salt="NfzOeuV5USPRA-n_9s1Lag", | salt="NfzOeuV5USPRA-n_9s1Lag", | |||
keyid="http://example.org/bob/keys/123"; | keyid="http://example.org/bob/keys/123"; | |||
salt="bDMSGoc2uobK_IhavSHsHA"; rs=1200 | salt="bDMSGoc2uobK_IhavSHsHA"; rs=1200 | |||
[encrypted payload] | [encrypted payload] | |||
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. | ||||
5.4. Encryption with Explicit Key | 5.4. Encryption with Explicit Key | |||
This example shows the UTF-8 encoded string "I am the walrus" | ||||
encrypted using an directly provided value for the input keying | ||||
material. The content body contains a single record only and is | ||||
shown here using base64url encoding for presentation reasons. | ||||
HTTP/1.1 200 OK | HTTP/1.1 200 OK | |||
Content-Length: 32 | Content-Length: 33 | |||
Content-Encoding: aesgcm128 | Content-Encoding: aesgcm | |||
Encryption: keyid="a1"; salt="vr0o6Uq3w_KDWeatc27mUg" | Encryption: keyid="a1"; salt="vr0o6Uq3w_KDWeatc27mUg" | |||
Crypto-Key: keyid="a1"; aesgcm128="csPJEXBYA5U-Tal9EdJi-w" | Crypto-Key: keyid="a1"; aesgcm="csPJEXBYA5U-Tal9EdJi-w" | |||
fuag8ThIRIazSHKUqJ5OduR75UgEUuM76J8UFwadEvg | VDeU0XxaJkOJDAxPl7h9JD5V8N43RorP7PfpPdZZQuwF | |||
This example shows the string "I am the walrus" encrypted using an | 5.5. Encryption with Multiple Records | |||
directly provided value for the input keying material. The content | ||||
body contains a single record only and is shown here encoded in URL- | ||||
safe base64 for presentation reasons only. | ||||
5.5. Diffie-Hellman Encryption | This example shows the same encrypted message, but split into records | |||
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 | ||||
record boundary, forcing the creation of a third record that contains | ||||
only padding. | ||||
HTTP/1.1 200 OK | HTTP/1.1 200 OK | |||
Content-Length: 32 | Content-Length: 70 | |||
Content-Encoding: aesgcm128 | Content-Encoding: aesgcm | |||
Encryption: keyid="a1"; salt="4pdat984KmT9BWsU3np0nw"; rs=10 | ||||
Crypto-Key: keyid="a1"; aesgcm="BO3ZVPxUlnLORbVGMpbT1Q" | ||||
uzLfrZ4cbMTC6hlUqHz4NvWZshFlTN3o2RLr6FrIuOKEfl2VrM_jYgoiIyEo | ||||
Zvc-ZGwV-RMJejG4M6ZfGysBAdhpPqrLzw | ||||
5.6. Diffie-Hellman Encryption | ||||
HTTP/1.1 200 OK | ||||
Content-Length: 33 | ||||
Content-Encoding: aesgcm | ||||
Encryption: keyid="dhkey"; salt="Qg61ZJRva_XBE9IEUelU3A" | Encryption: keyid="dhkey"; salt="Qg61ZJRva_XBE9IEUelU3A" | |||
Crypto-Key: keyid="dhkey"; | Crypto-Key: keyid="dhkey"; | |||
dh="BDgpRKok2GZZDmS4r63vbJSUtcQx4Fq1V58-6-3NbZzS | dh="BDgpRKok2GZZDmS4r63vbJSUtcQx4Fq1V58-6-3NbZzS | |||
TlZsQiCEDTQy3CZ0ZMsqeqsEb7qW2blQHA4S48fynTk" | TlZsQiCEDTQy3CZ0ZMsqeqsEb7qW2blQHA4S48fynTk" | |||
G6j_sfKg0qebO62yXpTCayN2KV24QitNiTvLgcFiEj0 | yqD2bapcx14XxUbtwjiGx69eHE3Yd6AqXcwBpT2Kd1uy | |||
This example shows the same string, "I am the walrus", encrypted | This example shows the same string, "I am the walrus", encrypted | |||
using ECDH over the P-256 curve [FIPS186], which is identified with | using ECDH over the P-256 curve [FIPS186], which is identified with | |||
the label "P-256" encoded in ASCII. The content body is shown here | the label "P-256" encoded in ASCII. The content body is shown here | |||
encoded in URL-safe base64 for presentation reasons only. | encoded in URL-safe base64url for presentation reasons only. | |||
The receiver (in this case, the HTTP client) uses a key pair that is | The receiver (in this case, the HTTP client) uses a key pair that is | |||
identified by the string "dhkey" and the sender (the server) uses a | identified by the string "dhkey" and the sender (the server) uses a | |||
key pair for which the public share is included in the "dh" parameter | key pair for which the public share is included in the "dh" parameter | |||
above. The keys shown below use uncompressed points [X9.62] encoded | above. The keys shown below use uncompressed points [X9.62] encoded | |||
using URL-safe base64. Line wrapping is added for presentation | using base64url. Line wrapping is added for presentation purposes | |||
purposes only. | only. | |||
Receiver: | Receiver: | |||
private key: 9FWl15_QUQAWDaD3k3l50ZBZQJ4au27F1V4F0uLSD_M | private key: 9FWl15_QUQAWDaD3k3l50ZBZQJ4au27F1V4F0uLSD_M | |||
public key: BCEkBjzL8Z3C-oi2Q7oE5t2Np-p7osjGLg93qUP0wvqR | public key: BCEkBjzL8Z3C-oi2Q7oE5t2Np-p7osjGLg93qUP0wvqR | |||
T21EEWyf0cQDQcakQMqz4hQKYOQ3il2nNZct4HgAUQU | T21EEWyf0cQDQcakQMqz4hQKYOQ3il2nNZct4HgAUQU | |||
Sender: | Sender: | |||
private key: vG7TmzUX9NfVR4XUGBkLAFu8iDyQe-q_165JkkN0Vlw | private key: vG7TmzUX9NfVR4XUGBkLAFu8iDyQe-q_165JkkN0Vlw | |||
public key: <the value of the "dh" parameter> | public key: <the value of the "dh" parameter> | |||
5.7. Diffie-Hellman with Authentication Secret | ||||
This example shows the same receiver key pair from Section 5.6, but | ||||
with a shared authentication secret of "R29vIGdvbyBnJyBqb29iIQ". | ||||
HTTP/1.1 200 OK | ||||
Content-Length: 33 | ||||
Content-Encoding: aesgcm | ||||
Encryption: keyid="dhkey"; salt="lngarbyKfMoi9Z75xYXmkg" | ||||
Crypto-Key: keyid="dhkey"; | ||||
dh="BNoRDbb84JGm8g5Z5CFxurSqsXWJ11ItfXEWYVLE85Y7 | ||||
CYkDjXsIEc4aqxYaQ1G8BqkXCJ6DPpDrWtdWj_mugHU" | ||||
6nqAQUME8hNqw5J3kl8cpVVJylXKYqZOeseZG8UueKpA | ||||
The sender's private key used in this example is "nCScek-QpEjmOOlT- | ||||
rQ38nZzvdPlqa00Zy0i6m2OJvY". Intermediate values for this example | ||||
are included in Appendix B. | ||||
6. Security Considerations | 6. 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 | |||
skipping to change at page 15, line 23 ¶ | skipping to change at page 16, line 46 ¶ | |||
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 | 7. IANA Considerations | |||
7.1. The "aesgcm128" HTTP Content Encoding | 7.1. The "aesgcm" HTTP Content Encoding | |||
This memo registers the "encrypted" HTTP content-coding in the HTTP | This memo registers the "encrypted" HTTP content-coding in the HTTP | |||
Content Codings Registry, as detailed in Section 2. | Content Codings Registry, as detailed in Section 2. | |||
o Name: aesgcm128 | o Name: aesgcm | |||
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 | 7.2. Encryption Header Fields | |||
This memo registers the "Encryption" HTTP header field in the | This memo registers the "Encryption" HTTP header field in the | |||
Permanent Message Header Registry, as detailed in Section 3. | Permanent Message Header Registry, as detailed in Section 3. | |||
skipping to change at page 17, line 18 ¶ | skipping to change at page 18, line 40 ¶ | |||
o Purpose: The size of the encrypted records. | o Purpose: The size of the encrypted records. | |||
o Reference: this document | o Reference: this document | |||
7.4. The HTTP Crypto-Key Parameter Registry | 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) | |||
Encryption 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 | |||
skipping to change at page 17, line 41 ¶ | skipping to change at page 19, line 15 ¶ | |||
The initial contents of this registry are: | The initial contents of this registry are: | |||
7.4.1. keyid | 7.4.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. aesgcm128 | 7.4.2. aesgcm | |||
o Parameter Name: aesgcm128 | o Parameter Name: aesgcm | |||
o Purpose: Provide an explicit input keying material value for the | o Purpose: Provide an explicit input keying material value for the | |||
aesgcm128 content encoding. | aesgcm content encoding. | |||
o Reference: this document | o Reference: this document | |||
7.4.3. dh | 7.4.3. dh | |||
o Parameter Name: dh | o Parameter Name: dh | |||
o Purpose: Carry a modp or elliptic curve Diffie-Hellman share used | o Purpose: Carry a modp or elliptic curve Diffie-Hellman share used | |||
to derive input keying material. | to derive input keying material. | |||
skipping to change at page 18, line 39 ¶ | skipping to change at page 20, line 11 ¶ | |||
Requirement Levels", BCP 14, RFC 2119, | Requirement Levels", BCP 14, RFC 2119, | |||
DOI 10.17487/RFC2119, March 1997, | DOI 10.17487/RFC2119, March 1997, | |||
<http://www.rfc-editor.org/info/rfc2119>. | <http://www.rfc-editor.org/info/rfc2119>. | |||
[RFC4492] Blake-Wilson, S., Bolyard, N., Gupta, V., Hawk, C., and B. | [RFC4492] Blake-Wilson, S., Bolyard, N., Gupta, V., Hawk, C., and B. | |||
Moeller, "Elliptic Curve Cryptography (ECC) Cipher Suites | Moeller, "Elliptic Curve Cryptography (ECC) Cipher Suites | |||
for Transport Layer Security (TLS)", RFC 4492, | for Transport Layer Security (TLS)", RFC 4492, | |||
DOI 10.17487/RFC4492, May 2006, | DOI 10.17487/RFC4492, May 2006, | |||
<http://www.rfc-editor.org/info/rfc4492>. | <http://www.rfc-editor.org/info/rfc4492>. | |||
[RFC4648] Josefsson, S., "The Base16, Base32, and Base64 Data | ||||
Encodings", RFC 4648, DOI 10.17487/RFC4648, October 2006, | ||||
<http://www.rfc-editor.org/info/rfc4648>. | ||||
[RFC5116] McGrew, D., "An Interface and Algorithms for Authenticated | [RFC5116] McGrew, D., "An Interface and Algorithms for Authenticated | |||
Encryption", RFC 5116, DOI 10.17487/RFC5116, January 2008, | Encryption", RFC 5116, DOI 10.17487/RFC5116, January 2008, | |||
<http://www.rfc-editor.org/info/rfc5116>. | <http://www.rfc-editor.org/info/rfc5116>. | |||
[RFC5869] Krawczyk, H. and P. Eronen, "HMAC-based Extract-and-Expand | [RFC5869] Krawczyk, H. and P. Eronen, "HMAC-based Extract-and-Expand | |||
Key Derivation Function (HKDF)", RFC 5869, | Key Derivation Function (HKDF)", RFC 5869, | |||
DOI 10.17487/RFC5869, May 2010, | DOI 10.17487/RFC5869, May 2010, | |||
<http://www.rfc-editor.org/info/rfc5869>. | <http://www.rfc-editor.org/info/rfc5869>. | |||
[RFC7230] Fielding, R., Ed. and J. Reschke, Ed., "Hypertext Transfer | [RFC7230] Fielding, R., Ed. and J. Reschke, Ed., "Hypertext Transfer | |||
Protocol (HTTP/1.1): Message Syntax and Routing", | Protocol (HTTP/1.1): Message Syntax and Routing", | |||
RFC 7230, DOI 10.17487/RFC7230, June 2014, | RFC 7230, DOI 10.17487/RFC7230, June 2014, | |||
<http://www.rfc-editor.org/info/rfc7230>. | <http://www.rfc-editor.org/info/rfc7230>. | |||
[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 | ||||
Signature (JWS)", RFC 7515, DOI 10.17487/RFC7515, May | ||||
2015, <http://www.rfc-editor.org/info/rfc7515>. | ||||
8.2. Informative References | 8.2. Informative References | |||
[FIPS186] National Institute of Standards and Technology (NIST), | [FIPS186] National Institute of Standards and Technology (NIST), | |||
"Digital Signature Standard (DSS)", NIST PUB 186-4 , July | "Digital Signature Standard (DSS)", NIST PUB 186-4 , July | |||
2013. | 2013. | |||
[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 20, line 20 ¶ | skipping to change at page 21, line 43 ¶ | |||
[X9.62] ANSI, "Public Key Cryptography For The Financial Services | [X9.62] ANSI, "Public Key Cryptography For The Financial Services | |||
Industry: The Elliptic Curve Digital Signature Algorithm | Industry: The Elliptic Curve Digital Signature Algorithm | |||
(ECDSA)", ANSI X9.62 , 1998. | (ECDSA)", ANSI X9.62 , 1998. | |||
[XMLENC] Eastlake, D., Reagle, J., Imamura, T., Dillaway, B., and | [XMLENC] Eastlake, D., Reagle, J., Imamura, T., Dillaway, B., and | |||
E. Simon, "XML Encryption Syntax and Processing", W3C | E. Simon, "XML Encryption Syntax and Processing", W3C | |||
REC , December 2002, <http://www.w3.org/TR/xmlenc-core/>. | REC , December 2002, <http://www.w3.org/TR/xmlenc-core/>. | |||
Appendix A. JWE Mapping | Appendix A. JWE Mapping | |||
The "aesgcm128" content encoding can be considered as a sequence of | The "aesgcm" content encoding can be considered as a sequence of JSON | |||
JSON Web Encryption (JWE) objects [RFC7516], each corresponding to a | Web Encryption (JWE) objects [RFC7516], each corresponding to a | |||
single fixed size record. The following transformations are applied | single fixed size record that includes leading padding. The | |||
to a JWE object that might be expressed using the JWE Compact | following transformations are applied to a JWE object that might be | |||
Serialization: | expressed using the JWE Compact Serialization: | |||
o The JWE Protected Header is fixed to a value { "alg": "dir", | o The JWE Protected Header is fixed to a 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. | |||
skipping to change at page 20, line 48 ¶ | skipping to change at page 22, line 23 ¶ | |||
Section 3.3). This value is also not transmitted. | Section 3.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 JWE Ciphertext and the JWE | |||
Authentication Tag, both expressed without URL-safe Base 64 | Authentication Tag, both expressed without URL-safe Base 64 | |||
encoding. The "." separator is omitted, since the length of these | encoding. The "." separator is omitted, since the length of these | |||
fields is known. | fields is known. | |||
Thus, the example in Section 5.4 can be rendered using the JWE | Thus, the example in Section 5.4 can be rendered using the JWE | |||
Compact Serialization as: | Compact Serialization as: | |||
eyAiYWxnIjogImRpciIsICJlbmMiOiAiQTEyOEdDTSIgfQ..AAAAAAAAAAAAAAAA. | eyAiYWxnIjogImRpciIsICJlbmMiOiAiQTEyOEdDTSIgfQ..31iQYc1v4a36EgyJ. | |||
LwTC-fwdKh8de0smD2jfzA.eh1vURhu65M2lxhctbbntA | VDeU0XxaJkOJDAxPl7h9JD4.VfDeN0aKz-z36T3WWULsBQ | |||
Where the first line represents the fixed JWE Protected Header, JWE | ||||
Encrypted Key, and JWE Initialization Vector, all of which are | ||||
determined algorithmically. The second line contains the encoded | ||||
body, split into JWE Ciphertext and JWE Authentication Tag. | ||||
Appendix B. Acknowledgements | Where the first line represents the fixed JWE Protected Header, an | |||
empty JWE Encrypted Key, and the algorithmically-determined JWE | ||||
Initialization Vector. The second line contains the encoded body, | ||||
split into JWE Ciphertext and JWE Authentication Tag. | ||||
Appendix B. Intermediate Values for Encryption | ||||
The intermediate values calculated for the example in Section 5.7 are | ||||
shown here. The following are inputs to the calculation: | ||||
Plaintext: SSBhbSB0aGUgd2FscnVz | ||||
Sender public key: BNoRDbb84JGm8g5Z5CFxurSqsXWJ11ItfXEWYVLE85Y7 | ||||
CYkDjXsIEc4aqxYaQ1G8BqkXCJ6DPpDrWtdWj_mugHU | ||||
Sender private key: nCScek-QpEjmOOlT-rQ38nZzvdPlqa00Zy0i6m2OJvY | ||||
Receiver public key: BCEkBjzL8Z3C-oi2Q7oE5t2Np-p7osjGLg93qUP0wvqR | ||||
T21EEWyf0cQDQcakQMqz4hQKYOQ3il2nNZct4HgAUQU | ||||
Receiver private key: 9FWl15_QUQAWDaD3k3l50ZBZQJ4au27F1V4F0uLSD_M | ||||
Salt: lngarbyKfMoi9Z75xYXmkg | ||||
Note that knowledge of just one of the private keys is necessary. | ||||
The sender randomly generates the salt value, whereas salt is input | ||||
to the receiver. | ||||
This produces the following intermediate values: | ||||
Shared secret (raw_key): RNjC-NVW4BGJbxWPW7G2mowsLeDa53LYKYm4-NOQ6Y | ||||
Input keying material (IKM): EhpZec37Ptm4IRD5-jtZ0q6r1iK5vYmY1tZwtN8 | ||||
fbZY | ||||
Context for content encryption key derivation: | ||||
Q29udGVudC1FbmNvZGluZzogYWVzZ2NtAFAtMjU2AABB BCEkBjzL8Z3C- | ||||
oi2Q7oE5t2Np-p7osjGLg93qUP0wvqR | ||||
T21EEWyf0cQDQcakQMqz4hQKYOQ3il2nNZct4HgAUQUA | ||||
QQTaEQ22_OCRpvIOWeQhcbq0qrF1iddSLX1xFmFSxPOW | ||||
OwmJA417CBHOGqsWGkNRvAapFwiegz6Q61rXVo_5roB1 | ||||
Content encryption key (CEK): AN2-xhvFWeYh5z0fcDu0Ww | ||||
Context for nonce derivation: Q29udGVudC1FbmNvZGluZzogbm9uY2UAUC0yNT | ||||
YAAEEE ISQGPMvxncL6iLZDugTm3Y2n6nuiyMYuD3epQ_TC-pFP | ||||
bUQRbJ_RxANBxqRAyrPiFApg5DeKXac1ly3geABRBQBB | ||||
BNoRDbb84JGm8g5Z5CFxurSqsXWJ11ItfXEWYVLE85Y7 | ||||
CYkDjXsIEc4aqxYaQ1G8BqkXCJ6DPpDrWtdWj_mugHU | ||||
Base nonce: JY1Okw5rw1Drkg9J | ||||
When the CEK and nonce are used with AES GCM and the padded plaintext | ||||
of AABJIGFtIHRoZSB3YWxydXM, the final ciphertext is | ||||
6nqAQUME8hNqw5J3kl8cpVVJylXKYqZOeseZG8UueKpA, as shown in the | ||||
example. | ||||
Appendix C. 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, Mike Jones, Stephen Farrell, Adam Langley, | |||
John Mattsson, Eric Rescorla, and Jim Schaad. | John Mattsson, Eric Rescorla, and Jim Schaad. | |||
Author's Address | Author's Address | |||
Martin Thomson | Martin Thomson | |||
End of changes. 55 change blocks. | ||||
114 lines changed or deleted | 228 lines changed or added | |||
This html diff was produced by rfcdiff 1.44. The latest version is available from http://tools.ietf.org/tools/rfcdiff/ |