draft-ietf-tcpinc-tcpcrypt-03.txt   draft-ietf-tcpinc-tcpcrypt-04.txt 
Network Working Group A. Bittau Network Working Group A. Bittau
Internet-Draft Google Internet-Draft Google
Intended status: Standards Track D. Boneh Intended status: Standards Track D. Boneh
Expires: May 4, 2017 D. Giffin Expires: July 23, 2017 D. Giffin
M. Hamburg M. Hamburg
Stanford University Stanford University
M. Handley M. Handley
University College London University College London
D. Mazieres D. Mazieres
Q. Slack Q. Slack
Stanford University Stanford University
E. Smith E. Smith
Kestrel Institute Kestrel Institute
October 31, 2016 January 19, 2017
Cryptographic protection of TCP Streams (tcpcrypt) Cryptographic protection of TCP Streams (tcpcrypt)
draft-ietf-tcpinc-tcpcrypt-03 draft-ietf-tcpinc-tcpcrypt-04
Abstract Abstract
This document specifies tcpcrypt, a TCP encryption protocol designed This document specifies tcpcrypt, a TCP encryption protocol designed
for use in conjunction with the TCP Encryption Negotiation Option for use in conjunction with the TCP Encryption Negotiation Option
(TCP-ENO) [I-D.ietf-tcpinc-tcpeno]. Tcpcrypt coexists with (TCP-ENO) [I-D.ietf-tcpinc-tcpeno]. Tcpcrypt coexists with
middleboxes by tolerating resegmentation, NATs, and other middleboxes by tolerating resegmentation, NATs, and other
manipulations of the TCP header. The protocol is self-contained and manipulations of the TCP header. The protocol is self-contained and
specifically tailored to TCP implementations, which often reside in specifically tailored to TCP implementations, which often reside in
kernels or other environments in which large external software kernels or other environments in which large external software
skipping to change at page 2, line 4 skipping to change at page 2, line 4
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 May 4, 2017. This Internet-Draft will expire on July 23, 2017.
Copyright Notice Copyright Notice
Copyright (c) 2016 IETF Trust and the persons identified as the Copyright (c) 2017 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
skipping to change at page 2, line 41 skipping to change at page 2, line 41
than English. than English.
Table of Contents Table of Contents
1. Requirements language . . . . . . . . . . . . . . . . . . . . 3 1. Requirements language . . . . . . . . . . . . . . . . . . . . 3
2. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3 2. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3
3. Encryption protocol . . . . . . . . . . . . . . . . . . . . . 3 3. Encryption protocol . . . . . . . . . . . . . . . . . . . . . 3
3.1. Cryptographic algorithms . . . . . . . . . . . . . . . . 4 3.1. Cryptographic algorithms . . . . . . . . . . . . . . . . 4
3.2. Protocol negotiation . . . . . . . . . . . . . . . . . . 5 3.2. Protocol negotiation . . . . . . . . . . . . . . . . . . 5
3.3. Key exchange . . . . . . . . . . . . . . . . . . . . . . 6 3.3. Key exchange . . . . . . . . . . . . . . . . . . . . . . 6
3.4. Session caching . . . . . . . . . . . . . . . . . . . . . 8 3.4. Session ID . . . . . . . . . . . . . . . . . . . . . . . 8
3.5. Data encryption and authentication . . . . . . . . . . . 10 3.5. Session caching . . . . . . . . . . . . . . . . . . . . . 8
3.6. TCP header protection . . . . . . . . . . . . . . . . . . 11 3.6. Data encryption and authentication . . . . . . . . . . . 11
3.7. Re-keying . . . . . . . . . . . . . . . . . . . . . . . . 11 3.7. TCP header protection . . . . . . . . . . . . . . . . . . 12
3.8. Keep-alive . . . . . . . . . . . . . . . . . . . . . . . 12 3.8. Re-keying . . . . . . . . . . . . . . . . . . . . . . . . 12
4. Encodings . . . . . . . . . . . . . . . . . . . . . . . . . . 13 3.9. Keep-alive . . . . . . . . . . . . . . . . . . . . . . . 13
4.1. Key exchange messages . . . . . . . . . . . . . . . . . . 13 4. Encodings . . . . . . . . . . . . . . . . . . . . . . . . . . 14
4.2. Application frames . . . . . . . . . . . . . . . . . . . 15 4.1. Key exchange messages . . . . . . . . . . . . . . . . . . 14
4.2.1. Plaintext . . . . . . . . . . . . . . . . . . . . . . 15 4.2. Application frames . . . . . . . . . . . . . . . . . . . 16
4.2.2. Associated data . . . . . . . . . . . . . . . . . . . 16 4.2.1. Plaintext . . . . . . . . . . . . . . . . . . . . . . 16
4.2.2. Associated data . . . . . . . . . . . . . . . . . . . 17
4.2.3. Frame nonce . . . . . . . . . . . . . . . . . . . . . 17 4.2.3. Frame nonce . . . . . . . . . . . . . . . . . . . . . 17
5. Key agreement schemes . . . . . . . . . . . . . . . . . . . . 18
5. Key agreement schemes . . . . . . . . . . . . . . . . . . . . 17 6. AEAD algorithms . . . . . . . . . . . . . . . . . . . . . . . 19
6. AEAD algorithms . . . . . . . . . . . . . . . . . . . . . . . 18 7. IANA considerations . . . . . . . . . . . . . . . . . . . . . 19
7. IANA considerations . . . . . . . . . . . . . . . . . . . . . 18 8. Security considerations . . . . . . . . . . . . . . . . . . . 20
8. Security considerations . . . . . . . . . . . . . . . . . . . 19 9. Design notes . . . . . . . . . . . . . . . . . . . . . . . . 21
9. Design notes . . . . . . . . . . . . . . . . . . . . . . . . 20 9.1. Asymmetric roles . . . . . . . . . . . . . . . . . . . . 21
9.1. Asymmetric roles . . . . . . . . . . . . . . . . . . . . 20
9.2. Verified liveness . . . . . . . . . . . . . . . . . . . . 21 9.2. Verified liveness . . . . . . . . . . . . . . . . . . . . 21
10. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . 21 10. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . 22
11. References . . . . . . . . . . . . . . . . . . . . . . . . . 21 11. References . . . . . . . . . . . . . . . . . . . . . . . . . 22
11.1. Normative References . . . . . . . . . . . . . . . . . . 21 11.1. Normative References . . . . . . . . . . . . . . . . . . 22
11.2. Informative References . . . . . . . . . . . . . . . . . 22 11.2. Informative References . . . . . . . . . . . . . . . . . 23
Appendix A. Protocol constant values . . . . . . . . . . . . . . 22 Appendix A. Protocol constant values . . . . . . . . . . . . . . 23
Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 23 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 24
1. Requirements language 1. Requirements language
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. Introduction 2. Introduction
This document describes tcpcrypt, an extension to TCP for This document describes tcpcrypt, an extension to TCP for
skipping to change at page 4, line 45 skipping to change at page 4, line 45
T(1) = HMAC-Hash(PRK, T(0) | CONST | 0x01) T(1) = HMAC-Hash(PRK, T(0) | CONST | 0x01)
T(2) = HMAC-Hash(PRK, T(1) | CONST | 0x02) T(2) = HMAC-Hash(PRK, T(1) | CONST | 0x02)
T(3) = HMAC-Hash(PRK, T(2) | CONST | 0x03) T(3) = HMAC-Hash(PRK, T(2) | CONST | 0x03)
... ...
OKM = first L octets of T(1) | T(2) | T(3) | ... OKM = first L octets of T(1) | T(2) | T(3) | ...
Figure 1: The symbol | denotes concatenation, and the counter Figure 1: The symbol | denotes concatenation, and the counter
concatenated to the right of CONST is a single octet. concatenated to the right of CONST is a single octet.
Lastly, once tcpcrypt has been successfully set up, an _authenticated Lastly, once tcpcrypt has been successfully set up and encryption
encryption mode_ is used to protect the confidentiality and integrity keys have been derived, an algorithm for Authenticated Encryption
of all transmitted application data. with Associated Data (AEAD) is used to protect the confidentiality
and integrity of all transmitted application data. AEAD algorithms
use a single key to encrypt their input data and also to generate a
cryptographic tag to accompany the resulting ciphertext; when
decryption is performed, the tag allows authentication of the
encrypted data and of optional, associated plaintext data.
3.2. Protocol negotiation 3.2. Protocol negotiation
Tcpcrypt depends on TCP-ENO [I-D.ietf-tcpinc-tcpeno] to negotiate Tcpcrypt depends on TCP-ENO [I-D.ietf-tcpinc-tcpeno] to negotiate
whether encryption will be enabled for a connection, and also which whether encryption will be enabled for a connection, and also which
key agreement scheme to use. TCP-ENO negotiates the use of a key agreement scheme to use. TCP-ENO negotiates the use of a
particular TCP encryption protocol or _TEP_ by including protocol particular TCP encryption protocol or _TEP_ by including protocol
identifiers in ENO suboptions. This document associates four TEP identifiers in ENO suboptions. This document associates four TEP
identifiers with the tcpcrypt protocol, as listed in Table 1. Future identifiers with the tcpcrypt protocol, as listed in Table 1. Each
standards may associate additional identifiers with tcpcrypt. identifier indicates the use of a particular key-agreement scheme.
Future standards may associate additional identifiers with tcpcrypt.
An active opener that wishes to negotiate the use of tcpcrypt will An active opener that wishes to negotiate the use of tcpcrypt
include an ENO option in its SYN segment. That option will include includes an ENO option in its SYN segment. That option includes
suboptions with TEP identifiers indicating the key-agreement schemes suboptions with tcpcrypt TEP identifiers indicating the key-agreement
it is willing to enable. The active opener MAY additionally include schemes it is willing to enable. The active opener MAY additionally
suboptions indicating support for encryption protocols other than include suboptions indicating support for encryption protocols other
tcpcrypt, as well as other general options as specified by TCP-ENO. than tcpcrypt, as well as global suboptions as specified by TCP-ENO.
If a passive opener receives an ENO option including tcpcrypt TEPs it If a passive opener receives an ENO option including tcpcrypt TEPs it
supports, it MAY then attach an ENO option to its SYN-ACK segment, supports, it MAY then attach an ENO option to its SYN-ACK segment,
including _solely_ the TEP it wishes to enable. including _solely_ the TEP it wishes to enable.
To establish distinct roles for the two hosts in each connection, To establish distinct roles for the two hosts in each connection,
tcpcrypt depends on the role-negotiation mechanism of TCP-ENO tcpcrypt depends on the role-negotiation mechanism of TCP-ENO. As
[I-D.ietf-tcpinc-tcpeno]. As part of the negotiation process, TCP- one result of the negotiation process, TCP-ENO assigns hosts unique
ENO assigns hosts unique roles abstractly called "A" at one end of roles abstractly called "A" at one end of the connection and "B" at
the connection and "B" at the other. Generally, an active opener the other. Generally, an active opener plays the "A" role and a
plays the "A" role and a passive opener plays the "B" role; but in passive opener plays the "B" role; but in the case of simultaneous
the case of simultaneous open, an additional mechanism breaks the open, an additional mechanism breaks the symmetry and assigns
symmetry and assigns different roles to the two hosts. This document different roles to the two hosts. This document adopts the terms
adopts the terms "host A" and "host B" to identify each end of a "host A" and "host B" to identify each end of a connection uniquely,
connection uniquely, following TCP-ENO's designation. following TCP-ENO's designation.
Once two hosts have exchanged SYN segments, the _negotiated TEP_ is ENO suboptions include a flag "v" which indicates the presence of
the last TEP identifier in the SYN segment of host B (that is, the associated, variable-length data. In order to propose fresh key
passive opener in the absence of simultaneous open) that also occurs agreement with a particular tcpcrypt TEP, a host sends a one-byte
in that of host A. If there is no such TEP, hosts MUST disable TCP- suboption containing the TEP identifier and "v = 0". In order to
ENO and tcpcrypt. propose session resumption (described further below) with a
particular TEP, a host sends a variable-length suboption containing
the TEP identifier, the flag "v = 1", and an identifier for a session
previously negotiated with the same host and the same TEP.
The _negotiated suboption_ is the ENO suboption from the SYN segment Once two hosts have exchanged SYN segments, TCP-ENO defines the
of host B that contains the negotiated TEP, if it exists. This _negotiated TEP_ to be the last valid TEP identifier in the SYN
suboption includes a one-bit flag "v" which indicates the presence of segment of host B (that is, the passive opener in the absence of
additional data. For tcpcrypt TEPs, if the negotiated suboption simultaneous open) that also occurs in that of host A. If there is
contains "v = 0", a fresh key agreement will be perfomed as described no such TEP, hosts MUST disable TCP-ENO and tcpcrypt.
below in Section 3.3. If it contains "v = 1", it is a _resumption
suboption_: this indicates that the key-exchange messages will be If the negotiated TEP was sent by host B with "v = 0", it means that
fresh key agreement will be performed as described below in
Section 3.3. If it had "v = 1", the key-exchange messages will be
omitted in favor of determining keys via session-caching as described omitted in favor of determining keys via session-caching as described
in Section 3.4, and protected application data may immediately be in Section 3.5, and protected application data may immediately be
sent as detailed in Section 3.5. sent as detailed in Section 3.6.
Note that the negotiated TEP is determined without reference to the Note that the negotiated TEP is determined without reference to the
"v" bits in ENO suboptions, so if host A offers a resumption "v" bits in ENO suboptions, so if host A offers resumption with a
suboption with a particular TEP and host B replies with a non- particular TEP and host B replies with a non-resumption suboption
resumption suboption with the same TEP, that may become the with the same TEP, that may become the negotiated TEP and fresh key
negotiated suboption and fresh key agreement will be performed. That agreement will be performed. That is, sending a resumption suboption
is, sending a resumption suboption also implies willingness to also implies willingness to perform fresh key agreement with the
perform fresh key-exchange with the indicated TEP. indicated TEP.
As required by TCP-ENO, once a host has both sent and received an ACK As required by TCP-ENO, once a host has both sent and received an ACK
segment containing an ENO option, encryption MUST be enabled and segment containing a valid ENO option, encryption MUST be enabled and
plaintext application data MUST NOT ever be exchanged on the plaintext application data MUST NOT ever be exchanged on the
connection. If the negotiated TEP is among those listed in Table 1, connection. If the negotiated TEP is among those listed in Table 1,
a host MUST follow the protocol described in this document. a host MUST follow the protocol described in this document.
3.3. Key exchange 3.3. Key exchange
Following successful negotiation of a tcpcrypt TEP, all further Following successful negotiation of a tcpcrypt TEP, all further
signaling is performed in the Data portion of TCP segments. Except signaling is performed in the Data portion of TCP segments. Except
when resumption was negotiated (described below in Section 3.4), the when resumption was negotiated (described below in Section 3.5), the
two hosts perform key exchange through two messages, "Init1" and two hosts perform key exchange through two messages, "Init1" and
"Init2", at the start of the data streams of host A and host B, "Init2", at the start of the data streams of host A and host B,
respectively. These messages may span multiple TCP segments and need respectively. These messages may span multiple TCP segments and need
not end at a segment boundary. However, the segment containing the not end at a segment boundary. However, the segment containing the
last byte of an "Init1" or "Init2" message SHOULD have TCP's PSH bit last byte of an "Init1" or "Init2" message SHOULD have TCP's PSH bit
set. set.
The key exchange protocol, in abstract, proceeds as follows: The key exchange protocol, in abstract, proceeds as follows:
A -> B: Init1 = { INIT1_MAGIC, sym-cipher-list, N_A, PK_A } A -> B: Init1 = { INIT1_MAGIC, sym-cipher-list, N_A, PK_A }
B -> A: Init2 = { INIT2_MAGIC, sym-cipher, N_B, PK_B } B -> A: Init2 = { INIT2_MAGIC, sym-cipher, N_B, PK_B }
The concrete format of these messages is specified in further detail The concrete format of these messages is specified in Section 4.1.
in Section 4.1.
The parameters are defined as follows: The parameters are defined as follows:
o "INIT1_MAGIC", "INIT2_MAGIC": constants defined in Table 3. o "INIT1_MAGIC", "INIT2_MAGIC": constants defined in Table 3.
o "sym-cipher-list": a list of symmetric ciphers (AEAD algorithms) o "sym-cipher-list": a list of symmetric ciphers (AEAD algorithms)
acceptable to host A. These are specified in Table 2. acceptable to host A. These are specified in Table 2.
o "sym-cipher": the symmetric cipher selected by host B from the o "sym-cipher": the symmetric cipher selected by host B from the
"sym-cipher-list" sent by host A. "sym-cipher-list" sent by host A.
o "N_A", "N_B": nonces chosen at random by hosts A and B, o "N_A", "N_B": nonces chosen at random by hosts A and B,
respectively. respectively.
o "PK_A", "PK_B": ephemeral public keys for hosts A and B, o "PK_A", "PK_B": ephemeral public keys for hosts A and B,
respectively. These, as well as their corresponding private keys, respectively. These, as well as their corresponding private keys,
are short-lived values that SHOULD be refreshed periodically. The are short-lived values that SHOULD be refreshed periodically. The
private keys SHOULD NOT ever be written to persistent storage. private keys SHOULD NOT ever be written to persistent storage.
The ephemeral secret ("ES") is defined to be the result of the key- The ephemeral secret ("ES") is the result of the key-agreement
agreement algorithm whose inputs are the local host's ephemeral algorithm (see Section 5) indicated by the negotiated TEP. The
private key and the remote host's ephemeral public key. For example, inputs to the algorithm are the local host's ephemeral private key
host A would compute "ES" using its own private key (not transmitted) and the remote host's ephemeral public key. For example, host A
and host B's public key, "PK_B". would compute "ES" using its own private key (not transmitted) and
host B's public key, "PK_B".
The two sides then compute a pseudo-random key ("PRK"), from which The two sides then compute a pseudo-random key ("PRK"), from which
all session keys are derived, as follows: all session keys are derived, as follows:
PRK = Extract (N_A, eno-transcript | Init1 | Init2 | ES) PRK = Extract(N_A, eno-transcript | Init1 | Init2 | ES)
Above, "|" denotes concatenation; "eno-transcript" is the protocol- Above, "|" denotes concatenation; "eno-transcript" is the protocol-
negotiation transcript defined in TCP-ENO; and "Init1" and "Init2" negotiation transcript defined in TCP-ENO; and "Init1" and "Init2"
are the transmitted encodings of the messages described in are the transmitted encodings of the messages described in
Section 4.1. Section 4.1.
A series of "session secrets" and corresponding session identifiers A series of "session secrets" are then computed from "PRK" as
are then computed from "PRK" as follows: follows:
ss[0] = PRK ss[0] = PRK
ss[i] = CPRF (ss[i-1], CONST_NEXTK, K_LEN) ss[i] = CPRF(ss[i-1], CONST_NEXTK, K_LEN)
SID[i] = CPRF (ss[i], CONST_SESSID, K_LEN)
The value "ss[0]" is used to generate all key material for the The value "ss[0]" is used to generate all key material for the
current connection. "SID[0]" is the _bare session ID_ for the current connection. The values "ss[i]" for "i > 0" can be used to
current connection, and will with overwhelming probability be unique avoid public key cryptography when establishing subsequent
for each individual TCP connection. connections between the same two hosts, as described in Section 3.5.
The "CONST_*" values are constants defined in Table 3. The length
The values of "ss[i]" for "i > 0" can be used to avoid public key "K_LEN" depends on the tcpcrypt TEP in use, and is specified in
cryptography when establishing subsequent connections between the Section 5.
same two hosts, as described in Section 3.4. The "CONST_*" values
are constants defined in Table 3. The length "K_LEN" depends on the
tcpcrypt TEP in use, and is specified in Section 5.
To yield the _session ID_ required by TCP-ENO
[I-D.ietf-tcpinc-tcpeno], tcpcrypt concatenates the first byte of the
negotiated suboption (that is, including the "v" bit as transmitted
by host B) with the bare session ID for a particular connection:
session ID = subopt-byte | SID
Given a session secret "ss", the two sides compute a series of master Given a session secret "ss", the two sides compute a series of master
keys as follows: keys as follows:
mk[0] = CPRF (ss, CONST_REKEY, K_LEN) mk[0] = CPRF(ss, CONST_REKEY, K_LEN)
mk[i] = CPRF (mk[i-1], CONST_REKEY, K_LEN) mk[i] = CPRF(mk[i-1], CONST_REKEY, K_LEN)
The particular master key in use is advanced as described in
Section 3.8.
Finally, each master key "mk" is used to generate keys for Finally, each master key "mk" is used to generate keys for
authenticated encryption for the "A" and "B" roles. Key "k_ab" is authenticated encryption for the "A" and "B" roles. Key "k_ab" is
used by host A to encrypt and host B to decrypt, while "k_ba" is used used by host A to encrypt and host B to decrypt, while "k_ba" is used
by host B to encrypt and host A to decrypt. by host B to encrypt and host A to decrypt.
k_ab = CPRF (mk, CONST_KEY_A, ae_keylen) k_ab = CPRF(mk, CONST_KEY_A, ae_keylen)
k_ba = CPRF (mk, CONST_KEY_B, ae_keylen) k_ba = CPRF(mk, CONST_KEY_B, ae_keylen)
The value "ae_keylen" depends on the authenticated-encryption The value "ae_keylen" depends on the authenticated-encryption
algorithm selected, and is given under "Key Length" in Table 2. algorithm selected, and is given under "Key Length" in Table 2.
After host B sends "Init2" or host A receives it, that host may After host B sends "Init2" or host A receives it, that host may
immediately begin transmitting protected application data as immediately begin transmitting protected application data as
described in Section 3.5. described in Section 3.6.
3.4. Session caching If host A receives "Init2" with a "sym-cipher" value that was not
present in the "sym-cipher-list" it previously transmitted in
"Init1", it MUST abort the connection and raise an error condition
distinct from the end-of-file condition.
3.4. Session ID
TCP-ENO requires each TEP to define a _session ID_ value that
uniquely identifies each encrypted connection.
As required, a tcpcrypt session ID begins with the negotiated TEP
identifier along with the "v" bit as transmitted by host B. The
remainder of the ID is derived from the session secret, as follows:
session_id[i] = TEP-byte | CPRF(ss[i], CONST_SESSID, K_LEN)
Again, the length "K_LEN" depends on the TEP, and is specified in
Section 5.
3.5. Session caching
When two hosts have already negotiated session secret "ss[i-1]", they When two hosts have already negotiated session secret "ss[i-1]", they
can establish a new connection without public-key operations using can establish a new connection without public-key operations using
"ss[i]". Willingness to employ this facility is signalled by sending "ss[i]". A host signals willingness to resume with a particular
a SYN segment with a resumption suboption: an ENO suboption session secret by sending a SYN segment with a resumption suboption:
containing the negotiated TEP identifier from the original session that is, an ENO suboption containing the negotiated TEP identifier
and the flag "v = 1" (indicating variable-length data). from the original session and part of an identifier for the session.
An active opener wishing to resume from a cached session may send a The resumption identifier is calculated from a session secret "ss[i]"
resumption suboption whose content is the nine-byte prefix of the as follows:
associated bare session ID:
resume[i] = CPRF(ss[i], CONST_RESUME, 18)
To name a session for resumption, a host sends either the first or
second half of the resumption identifier, according to the role it
played in the original session with secret "ss[0]".
A host that originally played role A and wishes to resume from a
cached session sends a suboption with the first half of the
resumption identifier:
byte 0 1 9 (10 bytes total) byte 0 1 9 (10 bytes total)
+--------+--------+---...---+--------+ +--------+--------+---...---+--------+
| TEP- | SID[i]{0..8} | | TEP- | resume[i]{0..8} |
| byte | | | byte | |
+--------+--------+---...---+--------+ +--------+--------+---...---+--------+
Figure 2: ENO suboption used to initiate session resumption. The Figure 2: Resumption suboption sent when original role was A. The
TEP-byte contains a tcpcrypt TEP identifier and v = 1. TEP-byte contains a tcpcrypt TEP identifier and v = 1.
The active opener MUST use the lowest value of "i" that has not Similarly, a host that originally played role B sends a suboption
already been used to successfully negotiate resumption with the same with the second half of the resumption identifier:
host and for the same pre-session key "ss[0]".
In a particular SYN segment, a host SHOULD NOT send more than one byte 0 1 9 (10 bytes total)
resumption suboption, and MUST NOT send more than one resumption +--------+--------+---...---+--------+
suboption with the same TEP identifier. But in addition to any | TEP- | resume[i]{9..17} |
resumption suboptions, an active opener MAY include non-resumption | byte | |
suboptions describing other key-agreement schemes it supports (in +--------+--------+---...---+--------+
addition to that indicated by the TEP in the resumption suboption).
If the passive opener recognizes the prefix of "SID[i]" and knows Figure 3: Resumption suboption sent when original role was B. The
"ss[i]", it SHOULD (with exceptions specified below) respond with an TEP-byte contains a tcpcrypt TEP identifier and v = 1.
ENO option containing an _empty resumption suboption_ indicating the
same key-exchange scheme; that is, a suboption whose initial byte
gives the TEP identifier from host A's resumption suboption and sets
"v = 1", but whose contents are empty. (The only way to encode this
is as the last ENO suboption.)
Otherwise, the passive opener SHOULD attempt to negotiate fresh key If a passive opener recognizes the identifier-half in a resumption
exchange by responding with a single, non-resumption suboption with suboption it has received and knows "ss[i]", it SHOULD (with
the same TEP as in the received resumption suboption, or with a TEP exceptions specified below) agree to resume from the cached session
from another received suboption. by sending its own resumption suboption, which will contain the other
half of the identifier.
A host MUST ignore a resumption suboption if it has successfully If it does not agree to resumption with a particular TEP, the passive
negotiated resumption in the past, in either role, with the same opener may either request fresh key exchange by responding with a
"SID[i]". In the event that two hosts simultaneously send SYN non-resumption suboption using the same TEP, or else respond to any
segments to each other with the same "SID[i]", but the two segments other received suboption.
are not part of a simultaneous open, both connections will have to
revert to fresh key exchange. To avoid this limitation, If an active opener receives a resumption suboption for a particular
implementations MAY choose to implement session caching such that a TEP and the received identifier-half does not match the "resume[i]"
given pre-session key "ss[0]" is only used for either passive or value whose other half it previously sent in a resumption suboption
active opens at the same host, not both. for the same TEP, it MUST ignore that suboption. In the typical case
that this was the only ENO suboption received, this means the host
MUST disable TCP-ENO and tcpcrypt: that is, it MUST NOT send any more
ENO options and MUST NOT encrypt the connection.
When a host concludes that TCP-ENO negotiation has succeeded for some
TEP that was received in a resumption suboption, it MUST then enable
encryption with that TEP, using the cached session secret, as
described in Section 3.6.
The session ID (Section 3.4) is constructed in the same way for
resumed sessions as it is for fresh ones. In this case the first
byte will always have "v = 1". The remainder of the ID is derived
from the cached session secret.
In the case of simultaneous open where TCP-ENO is able to establish In the case of simultaneous open where TCP-ENO is able to establish
asymmetric roles, two hosts that simultaneously send SYN segments asymmetric roles, two hosts that simultaneously send SYN segments
with resumption suboptions containing the same "SID[i]" may resume with compatible resumption suboptions may resume the associated
the associated session. session.
A host MUST NOT send, and upon receipt MUST ignore, an empty In a particular SYN segment, a host SHOULD NOT send more than one
resumption suboption in a SYN-only segment. resumption suboption, and MUST NOT send more than one resumption
suboption with the same TEP identifier. But in addition to any
resumption suboptions, an active opener MAY include non-resumption
suboptions describing other key-agreement schemes it supports (in
addition to that indicated by the TEP in the resumption suboption).
After using "ss[i]" to compute "mk[0]", implementations SHOULD After using "ss[i]" to compute "mk[0]", implementations SHOULD
compute and cache "ss[i+1]" for possible use by a later session, then compute and cache "ss[i+1]" for possible use by a later session, then
erase "ss[i]" from memory. Hosts SHOULD retain "ss[i+1]" until it is erase "ss[i]" from memory. Hosts SHOULD retain "ss[i+1]" until it is
used or the memory needs to be reclaimed. Hosts SHOULD NOT write a used or the memory needs to be reclaimed. Hosts SHOULD NOT write a
cached "ss[i+1]" value to non-volatile storage. cached "ss[i+1]" value to non-volatile storage.
When proposing resumption, the active opener MUST use the lowest
value of "i" that has not already been used (successfully or not) to
negotiate resumption with the same host and for the same pre-session
key "ss[0]".
A host MUST NOT resume with a session secret if it has ever
successfully negotiated resumption in the past, in either role, with
the same secret. In the event that two hosts simultaneously send SYN
segments to each other that propose resumption with the same session
secret but the two segments are not part of a simultaneous open, both
connections will have to revert to fresh key-exchange. To avoid this
limitation, implementations MAY choose to implement session caching
such that a given pre-session key "ss[0]" is only used for either
passive or active opens at the same host, not both.
When two hosts have previously negotiated a tcpcrypt session, either When two hosts have previously negotiated a tcpcrypt session, either
host may initiate session resumption regardless of which host was the host may initiate session resumption regardless of which host was the
active opener or played the "A" role in the previous session. active opener or played the "A" role in the previous session.
However, a given host must either encrypt with "k_ab" for all However, a given host must either encrypt with "k_ab" for all
sessions derived from the same pre-session key "ss[0]", or with sessions derived from the same pre-session key "ss[0]", or with
"k_ba". Thus, which keys a host uses to send segments is not "k_ba". Thus, which keys a host uses to send segments is not
affected by the role it plays in the current connection: it depends affected by the role it plays in the current connection: it depends
only on whether the host played the "A" or "B" role in the initial only on whether the host played the "A" or "B" role in the initial
session. session.
Implementations that perform session caching MUST provide a means for Implementations that perform session caching MUST provide a means for
applications to control session caching, including flushing cached applications to control session caching, including flushing cached
session secrets associated with an ESTABLISHED connection or session secrets associated with an ESTABLISHED connection or
disabling the use of caching for a particular connection. disabling the use of caching for a particular connection.
The session ID required by TCP-ENO and exposed to applications is 3.6. Data encryption and authentication
constructed in the same way for resumed sessions as it is for fresh
ones, as described above in Section 3.3. In particular, the first
byte of the session ID is the first byte of the current connection's
negotiated suboption, which means the byte will contain "v = 1"; and
the remainder is "SID[i]", the bare session ID for the resumed
session.
3.5. Data encryption and authentication
Following key exchange (or its omission via session caching), all Following key exchange (or its omission via session caching), all
further communication in a tcpcrypt-enabled connection is carried out further communication in a tcpcrypt-enabled connection is carried out
within delimited _application frames_ that are encrypted and within delimited _application frames_ that are encrypted and
authenticated using the agreed keys. authenticated using the agreed keys.
This protection is provided via algorithms for Authenticated This protection is provided via algorithms for Authenticated
Encryption with Associated Data (AEAD). The particular algorithms Encryption with Associated Data (AEAD). The particular algorithms
that may be used are listed in Table 2. One algorithm is selected that may be used are listed in Table 2. One algorithm is selected
during the negotiation described in Section 3.3. during the negotiation described in Section 3.3.
skipping to change at page 10, line 50 skipping to change at page 11, line 46
value, which is then encrypted to yield a frame's "ciphertext" field. value, which is then encrypted to yield a frame's "ciphertext" field.
Chunks must be small enough that the ciphertext (whose length depends Chunks must be small enough that the ciphertext (whose length depends
on the AEAD cipher used, and is generally slightly longer than the on the AEAD cipher used, and is generally slightly longer than the
plaintext) has length less than 2^16 bytes. plaintext) has length less than 2^16 bytes.
An "associated data" value (see Section 4.2.2) is constructed for the An "associated data" value (see Section 4.2.2) is constructed for the
frame. It contains the frame's "control" field and the length of the frame. It contains the frame's "control" field and the length of the
ciphertext. ciphertext.
A "frame nonce" value (see Section 4.2.3) is also constructed for the A "frame nonce" value (see Section 4.2.3) is also constructed for the
frame (but not explicitly transmitted), containing an "offset" field frame but not explicitly transmitted. It contains an "offset" field
whose integer value is the zero-indexed byte offset of the beginning whose integer value is the zero-indexed byte offset of the beginning
of the current application frame in the underlying TCP datastream. of the current application frame in the underlying TCP datastream.
(That is, the offset in the framing stream, not the plaintext (That is, the offset in the framing stream, not the plaintext
application stream.) Because it is strictly necessary for the application stream.) Because it is strictly necessary for the
security of the AEAD algorithm, an implementation MUST NOT ever security of the AEAD algorithm, an implementation MUST NOT ever
transmit distinct frames with the same nonce value under the same transmit distinct frames with the same nonce value under the same
encryption key. In particular, a retransmitted TCP segment MUST encryption key. In particular, a retransmitted TCP segment MUST
contain the same payload bytes for the same TCP sequence numbers, and contain the same payload bytes for the same TCP sequence numbers, and
a host MUST NOT transmit more than 2^64 bytes in the underlying TCP a host MUST NOT transmit more than 2^64 bytes in the underlying TCP
datastream (which would cause the "offset" field to wrap) before re- datastream (which would cause the "offset" field to wrap) before re-
keying. keying.
skipping to change at page 11, line 26 skipping to change at page 12, line 21
[RFC5116], tcpcrypt invokes the AEAD algorithm with the secret key [RFC5116], tcpcrypt invokes the AEAD algorithm with the secret key
"K" set to k_ab or k_ba, according to the host's role as described in "K" set to k_ab or k_ba, according to the host's role as described in
Section 3.3. The plaintext value serves as "P", the associated data Section 3.3. The plaintext value serves as "P", the associated data
as "A", and the frame nonce as "N". The output of the encryption as "A", and the frame nonce as "N". The output of the encryption
operation, "C", is transmitted in the frame's "ciphertext" field. operation, "C", is transmitted in the frame's "ciphertext" field.
When a frame is received, tcpcrypt reconstructs the associated data When a frame is received, tcpcrypt reconstructs the associated data
and frame nonce values (the former contains only data sent in the and frame nonce values (the former contains only data sent in the
clear, and the latter is implicit in the TCP stream), and provides clear, and the latter is implicit in the TCP stream), and provides
these and the ciphertext value to the the AEAD decryption operation. these and the ciphertext value to the the AEAD decryption operation.
The output of this operation is either "P", a plaintext value, or the The output of this operation is either a plaintext value "P" or the
special symbol FAIL. In the latter case, the implementation MUST special symbol FAIL. In the latter case, the implementation MUST
either ignore the frame or abort the connection; but if it aborts, either ignore the frame or abort the connection; but if it aborts,
the implementation MUST raise an error condition distinct from the the implementation MUST raise an error condition distinct from the
end-of-file condition. end-of-file condition.
3.6. TCP header protection 3.7. TCP header protection
The "ciphertext" field of the application frame contains protected The "ciphertext" field of the application frame contains protected
versions of certain TCP header values. versions of certain TCP header values.
When "URGp" is set, the "urgent" value indicates an offset from the When "URGp" is set, the "urgent" value indicates an offset from the
current frame's beginning offset; the sum of these offsets gives the current frame's beginning offset; the sum of these offsets gives the
index of the last byte of urgent data in the application datastream. index of the last byte of urgent data in the application datastream.
When "FINp" is set, it indicates that the sender will send no more When "FINp" is set, it indicates that the sender will send no more
application data after this frame. A receiver MUST ignore the TCP application data after this frame. When the TCP FIN flag differs
FIN flag and instead wait for "FINp" to signal to the local from "FINp", a receiving host MUST either ignore the segment
application that the stream is complete. altogether or abort the connection and raise an error condition
distinct from the end-of-file condition.
3.7. Re-keying 3.8. Re-keying
Re-keying allows hosts to wipe from memory keys that could decrypt Re-keying allows hosts to wipe from memory keys that could decrypt
previously transmitted segments. It also allows the use of AEAD previously transmitted segments. It also allows the use of AEAD
ciphers that can securely encrypt only a bounded number of messages ciphers that can securely encrypt only a bounded number of messages
under a given key. under a given key.
We refer to the two encryption keys (k_ab, k_ba) as a _key-set_. We We refer to the two encryption keys (k_ab, k_ba) as a _key-set_. We
refer to the key-set generated by mk[i] as the key-set with refer to the key-set generated by mk[i] as the key-set with
_generation number_ "i" within a session. Each host maintains a _generation number_ "i" within a session. Each host maintains a
_current generation number_ that it uses to encrypt outgoing frames. _local generation number_ that determines which key-set it uses to
Initially, the two hosts have current generation number 0. encrypt outgoing frames, and a _remote generation number_ equal to
the highest generation used in frames received from its peer.
Initially, these two values are set to zero.
When a host has just incremented its current generation number and A host MAY increment its local generation number beyond the remote
has used the new key-set for the first time to encrypt an outgoing generation number it has recorded. We call this action _initiating
frame, it MUST set that frame's "rekey" field (see Section 4.2) to 1. re-keying_.
It MUST set this field to zero in all other cases.
A host MAY increment its current generation number beyond the highest When a host has incremented its local generation number and uses the
generation it knows the other side to be using. We call this action new key-set for the first time to encrypt an outgoing frame, it MUST
_initiating re-keying_. set "rekey = 1" for that frame. It MUST set this field to zero in
all other cases.
When a host receives a frame with "rekey = 1", it increments its
record of the remote generation number. If the remote generation
number is now greater than the local generation number, the receiver
MUST immediately increment its local generation number to match and
send a frame (with empty application data if necessary) with "rekey =
1".
A host SHOULD NOT initiate more than one concurrent re-key operation A host SHOULD NOT initiate more than one concurrent re-key operation
if it has no data to send; that is, it should not initiate re-keying if it has no data to send; that is, it should not initiate re-keying
with an empty application frame more than once while its record of with an empty application frame more than once while its record of
the remote host's current generation number is less than its own. the remote generation number is less than its own.
On receipt, a host increments its record of the remote host's current
generation number if and only if the "rekey" field is set to 1.
If a received frame's generation number is greater than the
receiver's current generation number, the receiver MUST immediately
increment its current generation number to match. After incrementing
its generation number, if the receiver does not have any application
data to send, it MUST send an empty application frame with the
"rekey" field set to 1.
When retransmitting, implementations must always transmit the same When retransmitting, implementations must always transmit the same
bytes for the same TCP sequence numbers. Thus, a frame in a bytes for the same TCP sequence numbers. Thus, a frame in a
retransmitted segment MUST always be encrypted with the same key as retransmitted segment MUST always be encrypted with the same key as
when it was originally transmitted. when it was originally transmitted.
Implementations SHOULD delete older-generation keys from memory once Implementations SHOULD delete older-generation keys from memory once
they have received all frames they will need to decrypt with the old they have received all frames they will need to decrypt with the old
keys and have encrypted all outgoing frames under the old keys. keys and have encrypted all outgoing frames under the old keys.
3.8. Keep-alive 3.9. Keep-alive
Instead of using TCP Keep-Alives to verify that the remote endpoint Instead of using TCP Keep-Alives to verify that the remote endpoint
is still responsive, tcpcrypt implementations SHOULD employ the re- is still responsive, tcpcrypt implementations SHOULD employ the re-
keying mechanism, as follows. When necessary, a host SHOULD probe keying mechanism for this purpose, as follows. When necessary, a
the liveness of its peer by initiating re-keying as described in host SHOULD probe the liveness of its peer by initiating re-keying
Section 3.7, and then transmitting a new frame (with zero-length and transmitting a new frame immediately (with empty application data
application data if necessary). A host receiving a frame whose key if necessary).
generation number is greater than its current generation number MUST
increment its current generation number and MUST immediately transmit As described in Section 3.8, a host receiving a frame encrypted under
a new frame (with zero-length application data, if necessary). a generation number greater than its own MUST increment its own
generation number and immediately transmit a new frame (with zero-
length application data, if necessary).
Implementations MAY use TCP Keep-Alives for purposes that do not Implementations MAY use TCP Keep-Alives for purposes that do not
require endpoint authentication, as discussed in Section 9.2. require endpoint authentication, as discussed in Section 9.2.
4. Encodings 4. Encodings
This section provides byte-level encodings for values transmitted or This section provides byte-level encodings for values transmitted or
computed by the protocol. computed by the protocol.
4.1. Key exchange messages 4.1. Key exchange messages
skipping to change at page 15, line 37 skipping to change at page 16, line 34
The byte "control" has this structure: The byte "control" has this structure:
bit 7 1 0 bit 7 1 0
+-------+---...---+-------+-------+ +-------+---...---+-------+-------+
| cres | rekey | | cres | rekey |
+-------+---...---+-------+-------+ +-------+---...---+-------+-------+
The seven-bit field "cres" is reserved; implementations MUST set The seven-bit field "cres" is reserved; implementations MUST set
these bits to zero when sending, and MUST ignore them when receiving. these bits to zero when sending, and MUST ignore them when receiving.
The use of the "rekey" field is described in Section 3.7. The use of the "rekey" field is described in Section 3.8.
4.2.1. Plaintext 4.2.1. Plaintext
The "ciphertext" field is the result of applying the negotiated The "ciphertext" field is the result of applying the negotiated
authenticated-encryption algorithm to a "plaintext" value, which has authenticated-encryption algorithm to a "plaintext" value, which has
one of these two formats: one of these two formats:
byte 0 1 plen-1 byte 0 1 plen-1
+-------+-------+---...---+-------+ +-------+-------+---...---+-------+
| flags | data | | flags | data |
skipping to change at page 16, line 35 skipping to change at page 17, line 25
+----+----+----+----+----+----+----+----+ +----+----+----+----+----+----+----+----+
The six-bit value "fres" is reserved; implementations MUST set these The six-bit value "fres" is reserved; implementations MUST set these
six bits to zero when sending, and MUST ignore them when receiving. six bits to zero when sending, and MUST ignore them when receiving.
When the "URGp" bit is set, it indicates that the "urgent" field is When the "URGp" bit is set, it indicates that the "urgent" field is
present, and thus that the plaintext value has the second structure present, and thus that the plaintext value has the second structure
variant above; otherwise the first variant is used. variant above; otherwise the first variant is used.
The meaning of "urgent" and of the flag bits is described in The meaning of "urgent" and of the flag bits is described in
Section 3.6. Section 3.7.
4.2.2. Associated data 4.2.2. Associated data
An application frame's "associated data" (which is supplied to the An application frame's "associated data" (which is supplied to the
AEAD algorithm when decrypting the ciphertext and verifying the AEAD algorithm when decrypting the ciphertext and verifying the
frame's integrity) has this format: frame's integrity) has this format:
byte 0 1 2 byte 0 1 2
+-------+-------+-------+ +-------+-------+-------+
|control| clen | |control| clen |
skipping to change at page 17, line 21 skipping to change at page 18, line 16
+------+------+------+------+ +------+------+------+------+
0 | FRAME_NONCE_MAGIC | 0 | FRAME_NONCE_MAGIC |
+------+------+------+------+ +------+------+------+------+
4 | | 4 | |
+ offset + + offset +
8 | | 8 | |
+------+------+------+------+ +------+------+------+------+
The 4-byte magic constant is defined in Table 3. The 8-byte "offset" The 4-byte magic constant is defined in Table 3. The 8-byte "offset"
field contains an integer in big-endian format. Its value is field contains an integer in big-endian format. Its value is
specified in Section 3.5. specified in Section 3.6.
5. Key agreement schemes 5. Key agreement schemes
The TEP negotiated via TCP-ENO may indicate the use of one of the The TEP negotiated via TCP-ENO may indicate the use of one of the
key-agreement schemes named in Table 1. For example, key-agreement schemes named in Table 1. For example,
"TCPCRYPT_ECDHE_P256" names the tcpcrypt protocol with key-agreement "TCPCRYPT_ECDHE_P256" names the tcpcrypt protocol with key-agreement
scheme ECDHE-P256. scheme ECDHE-P256.
All schemes listed there use HKDF-Expand-SHA256 as the CPRF, and All schemes listed there use HKDF-Expand-SHA256 as the CPRF, and
these lengths for nonces and session keys: these lengths for nonces and session keys:
skipping to change at page 18, line 44 skipping to change at page 19, line 36
| 0x21 | TCPCRYPT_ECDHE_P256 | | 0x21 | TCPCRYPT_ECDHE_P256 |
| 0x22 | TCPCRYPT_ECDHE_P521 | | 0x22 | TCPCRYPT_ECDHE_P521 |
| 0x23 | TCPCRYPT_ECDHE_Curve25519 | | 0x23 | TCPCRYPT_ECDHE_Curve25519 |
| 0x24 | TCPCRYPT_ECDHE_Curve448 | | 0x24 | TCPCRYPT_ECDHE_Curve448 |
+------+---------------------------+ +------+---------------------------+
Table 1: TEP identifiers for use with tcpcrypt Table 1: TEP identifiers for use with tcpcrypt
A "tcpcrypt AEAD parameter" registry needs to be maintained by IANA A "tcpcrypt AEAD parameter" registry needs to be maintained by IANA
as in the following table. The use of encryption is described in as in the following table. The use of encryption is described in
Section 3.5. Section 3.6.
+------------------------+------------+------------+ +------------------------+------------+------------+
| AEAD Algorithm | Key Length | sym-cipher | | AEAD Algorithm | Key Length | sym-cipher |
+------------------------+------------+------------+ +------------------------+------------+------------+
| AEAD_AES_128_GCM | 16 bytes | 0x01 | | AEAD_AES_128_GCM | 16 bytes | 0x01 |
| AEAD_AES_256_GCM | 32 bytes | 0x02 | | AEAD_AES_256_GCM | 32 bytes | 0x02 |
| AEAD_CHACHA20_POLY1305 | 32 bytes | 0x10 | | AEAD_CHACHA20_POLY1305 | 32 bytes | 0x10 |
+------------------------+------------+------------+ +------------------------+------------+------------+
Table 2: Authenticated-encryption algorithms corresponding to sym- Table 2: Authenticated-encryption algorithms corresponding to sym-
skipping to change at page 20, line 35 skipping to change at page 21, line 25
Tcpcrypt uses short-lived public keys to provide forward secrecy. Tcpcrypt uses short-lived public keys to provide forward secrecy.
All currently specified key agreement schemes involve ECDHE-based key All currently specified key agreement schemes involve ECDHE-based key
agreement, meaning a new key can be efficiently computed for each agreement, meaning a new key can be efficiently computed for each
connection. If implementations reuse these parameters, they SHOULD connection. If implementations reuse these parameters, they SHOULD
limit the lifetime of the private parameters, ideally to no more than limit the lifetime of the private parameters, ideally to no more than
two minutes. two minutes.
Attackers cannot force passive openers to move forward in their Attackers cannot force passive openers to move forward in their
session caching chain without guessing the content of the resumption session caching chain without guessing the content of the resumption
suboption, which will be difficult without key knowledge. identifier, which will be difficult without key knowledge.
9. Design notes 9. Design notes
9.1. Asymmetric roles 9.1. Asymmetric roles
Tcpcrypt transforms a shared pseudo-random key (PRK) into Tcpcrypt transforms a shared pseudo-random key (PRK) into
cryptographic session keys for each direction. Doing so requires an cryptographic session keys for each direction. Doing so requires an
asymmetry in the protocol, as the key derivation function must be asymmetry in the protocol, as the key derivation function must be
perturbed differently to generate different keys in each direction. perturbed differently to generate different keys in each direction.
Tcpcrypt includes other asymmetries in the roles of the two hosts, Tcpcrypt includes other asymmetries in the roles of the two hosts,
skipping to change at page 21, line 22 skipping to change at page 22, line 8
segment causes the remote side to send an acknowledgment. segment causes the remote side to send an acknowledgment.
Unfortunately, tcpcrypt cannot cryptographically verify Keep-Alive Unfortunately, tcpcrypt cannot cryptographically verify Keep-Alive
acknowledgments. Hence, an attacker could prolong the existence of a acknowledgments. Hence, an attacker could prolong the existence of a
session at one host after the other end of the connection no longer session at one host after the other end of the connection no longer
exists. (Such an attack might prevent a process with sensitive data exists. (Such an attack might prevent a process with sensitive data
from exiting, giving an attacker more time to compromise a host and from exiting, giving an attacker more time to compromise a host and
extract the sensitive data.) extract the sensitive data.)
Thus, tcpcrypt specifies a way to stimulate the remote host to send Thus, tcpcrypt specifies a way to stimulate the remote host to send
verifiably fresh and authentic data, described in Section 3.8. verifiably fresh and authentic data, described in Section 3.9.
The TCP keep-alive mechanism has also been used for its effects on The TCP keep-alive mechanism has also been used for its effects on
intermediate nodes in the network, such as preventing flow state from intermediate nodes in the network, such as preventing flow state from
expiring at NAT boxes or firewalls. As these purposes do not require expiring at NAT boxes or firewalls. As these purposes do not require
the authentication of endpoints, implementations may safely the authentication of endpoints, implementations may safely
accomplish them using either the existing TCP keep-alive mechanism or accomplish them using either the existing TCP keep-alive mechanism or
tcpcrypt's verified keep-alive mechanism. tcpcrypt's verified keep-alive mechanism.
10. Acknowledgments 10. Acknowledgments
skipping to change at page 21, line 51 skipping to change at page 22, line 37
#N66001-10-2-4088; and by the Stanford Secure Internet of Things #N66001-10-2-4088; and by the Stanford Secure Internet of Things
Project. Project.
11. References 11. References
11.1. Normative References 11.1. Normative References
[I-D.ietf-tcpinc-tcpeno] [I-D.ietf-tcpinc-tcpeno]
Bittau, A., Boneh, D., Giffin, D., Handley, M., Mazieres, Bittau, A., Boneh, D., Giffin, D., Handley, M., Mazieres,
D., and E. Smith, "TCP-ENO: Encryption Negotiation D., and E. Smith, "TCP-ENO: Encryption Negotiation
Option", draft-ietf-tcpinc-tcpeno-06 (work in progress), Option", draft-ietf-tcpinc-tcpeno-07 (work in progress),
October 2016. January 2017.
[ieee1363] [ieee1363]
"IEEE Standard Specifications for Public-Key Cryptography "IEEE Standard Specifications for Public-Key Cryptography
(IEEE Std 1363-2000)", 2000. (IEEE Std 1363-2000)", 2000.
[nist-dss] [nist-dss]
"Digital Signature Standard, FIPS 186-2", 2000. "Digital Signature Standard, FIPS 186-2", 2000.
[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,
skipping to change at page 23, line 4 skipping to change at page 23, line 35
Communication Layers", STD 3, RFC 1122, Communication Layers", STD 3, RFC 1122,
DOI 10.17487/RFC1122, October 1989, DOI 10.17487/RFC1122, October 1989,
<http://www.rfc-editor.org/info/rfc1122>. <http://www.rfc-editor.org/info/rfc1122>.
[tcpcrypt] [tcpcrypt]
Bittau, A., Hamburg, M., Handley, M., Mazieres, D., and D. Bittau, A., Hamburg, M., Handley, M., Mazieres, D., and D.
Boneh, "The case for ubiquitous transport-level Boneh, "The case for ubiquitous transport-level
encryption", USENIX Security , 2010. encryption", USENIX Security , 2010.
Appendix A. Protocol constant values Appendix A. Protocol constant values
+------------+-------------------+ +------------+-------------------+
| Value | Name | | Value | Name |
+------------+-------------------+ +------------+-------------------+
| 0x01 | CONST_NEXTK | | 0x01 | CONST_NEXTK |
| 0x02 | CONST_SESSID | | 0x02 | CONST_SESSID |
| 0x03 | CONST_REKEY | | 0x03 | CONST_REKEY |
| 0x04 | CONST_KEY_A | | 0x04 | CONST_KEY_A |
| 0x05 | CONST_KEY_B | | 0x05 | CONST_KEY_B |
| 0x06 | CONST_RESUME |
| 0x15101a0e | INIT1_MAGIC | | 0x15101a0e | INIT1_MAGIC |
| 0x097105e0 | INIT2_MAGIC | | 0x097105e0 | INIT2_MAGIC |
| 0x44415441 | FRAME_NONCE_MAGIC | | 0x44415441 | FRAME_NONCE_MAGIC |
+------------+-------------------+ +------------+-------------------+
Table 3: Protocol constants Table 3: Protocol constants
Authors' Addresses Authors' Addresses
Andrea Bittau Andrea Bittau
 End of changes. 62 change blocks. 
200 lines changed or deleted 251 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/