< draft-barnes-mls-protocol-00.txt   draft-barnes-mls-protocol-01.txt >
Network Working Group R. Barnes Network Working Group R. Barnes
Internet-Draft Cisco Internet-Draft Cisco
Intended status: Informational J. Millican Intended status: Informational J. Millican
Expires: August 6, 2018 Facebook Expires: January 3, 2019 Facebook
E. Omara E. Omara
Google Google
K. Cohn-Gordon K. Cohn-Gordon
University of Oxford University of Oxford
R. Robert R. Robert
Wire Wire
February 02, 2018 July 02, 2018
The Messaging Layer Security (MLS) Protocol The Messaging Layer Security (MLS) Protocol
draft-barnes-mls-protocol-00 draft-barnes-mls-protocol-01
Abstract Abstract
Messaging applications are increasingly making use of end-to-end Messaging applications are increasingly making use of end-to-end
security mechanisms to ensure that messages are only accessible to security mechanisms to ensure that messages are only accessible to
the communicating endpoints, and not to any servers involved in the communicating endpoints, and not to any servers involved in
delivering messages. Establishing keys to provide such protections delivering messages. Establishing keys to provide such protections
is challenging for group chat settings, in which more than two is challenging for group chat settings, in which more than two
participants need to agree on a key but may not be online at the same participants need to agree on a key but may not be online at the same
time. In this document, we specify a key establishment protocol that time. In this document, we specify a key establishment protocol that
skipping to change at page 1, line 46 skipping to change at page 1, line 46
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 https://datatracker.ietf.org/drafts/current/. Drafts is at https://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 August 6, 2018. This Internet-Draft will expire on January 3, 2019.
Copyright Notice Copyright Notice
Copyright (c) 2018 IETF Trust and the persons identified as the Copyright (c) 2018 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
(https://trustee.ietf.org/license-info) in effect on the date of (https://trustee.ietf.org/license-info) in effect on the date of
publication of this document. Please review these documents publication of this document. Please review these documents
carefully, as they describe your rights and restrictions with respect carefully, as they describe your rights and restrictions with respect
to this document. Code Components extracted from this document must to this document. Code Components extracted from this document must
include Simplified BSD License text as described in Section 4.e of include Simplified BSD License text as described in Section 4.e of
the Trust Legal Provisions and are provided without warranty as the Trust Legal Provisions and are provided without warranty as
described in the Simplified BSD License. described in the Simplified BSD License.
Table of Contents Table of Contents
1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3
2. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 4 2. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 4
3. Basic Assumptions . . . . . . . . . . . . . . . . . . . . . . 4 3. Basic Assumptions . . . . . . . . . . . . . . . . . . . . . . 5
4. Protocol Overview . . . . . . . . . . . . . . . . . . . . . . 5 4. Protocol Overview . . . . . . . . . . . . . . . . . . . . . . 5
5. Binary Trees . . . . . . . . . . . . . . . . . . . . . . . . 9 5. Binary Trees . . . . . . . . . . . . . . . . . . . . . . . . 9
5.1. Terminology . . . . . . . . . . . . . . . . . . . . . . . 9 5.1. Terminology . . . . . . . . . . . . . . . . . . . . . . . 9
5.2. Merkle Trees . . . . . . . . . . . . . . . . . . . . . . 11 5.2. Merkle Trees . . . . . . . . . . . . . . . . . . . . . . 11
5.2.1. Merkle Proofs . . . . . . . . . . . . . . . . . . . . 12 5.2.1. Merkle Proofs . . . . . . . . . . . . . . . . . . . . 12
5.3. Ratchet Trees . . . . . . . . . . . . . . . . . . . . . . 12 5.3. Ratchet Trees . . . . . . . . . . . . . . . . . . . . . . 12
5.3.1. Blank Ratchet Tree Nodes . . . . . . . . . . . . . . 13 5.3.1. Ratchet Trees for ART . . . . . . . . . . . . . . . . 13
6. Group State . . . . . . . . . . . . . . . . . . . . . . . . . 14 5.3.2. Ratchet Trees for TreeKEM . . . . . . . . . . . . . . 13
6.1. Cryptographic Objects . . . . . . . . . . . . . . . . . . 15 5.3.3. Ratchet Tree Updates . . . . . . . . . . . . . . . . 14
6.1.1. Curve25519 with SHA-256 . . . . . . . . . . . . . . . 15 5.3.4. Blank Ratchet Tree Nodes . . . . . . . . . . . . . . 15
6.1.2. P-256 with SHA-256 . . . . . . . . . . . . . . . . . 16 6. Group State . . . . . . . . . . . . . . . . . . . . . . . . . 16
6.2. Key Schedule . . . . . . . . . . . . . . . . . . . . . . 17 6.1. Cryptographic Objects . . . . . . . . . . . . . . . . . . 17
7. Initialization Keys . . . . . . . . . . . . . . . . . . . . . 18 6.1.1. ART with Curve25519 and SHA-256 . . . . . . . . . . . 18
7.1. UserInitKey . . . . . . . . . . . . . . . . . . . . . . . 18 6.1.2. ART with P-256 and SHA-256 . . . . . . . . . . . . . 18
7.2. GroupInitKey . . . . . . . . . . . . . . . . . . . . . . 19 6.1.3. TreeKEM with Curve25519, SHA-256, and AES-128-GCM . . 19
8. Handshake Messages . . . . . . . . . . . . . . . . . . . . . 20 6.1.4. TreeKEM with P-256, SHA-256, and AES-128-GCM . . . . 19
8.1. Init . . . . . . . . . . . . . . . . . . . . . . . . . . 22 6.2. Direct Paths . . . . . . . . . . . . . . . . . . . . . . 20
8.2. GroupAdd . . . . . . . . . . . . . . . . . . . . . . . . 22 6.3. Key Schedule . . . . . . . . . . . . . . . . . . . . . . 21
8.3. UserAdd . . . . . . . . . . . . . . . . . . . . . . . . . 23 7. Initialization Keys . . . . . . . . . . . . . . . . . . . . . 22
8.4. Update . . . . . . . . . . . . . . . . . . . . . . . . . 24 7.1. UserInitKey . . . . . . . . . . . . . . . . . . . . . . . 23
8.5. Delete . . . . . . . . . . . . . . . . . . . . . . . . . 24 7.2. GroupInitKey . . . . . . . . . . . . . . . . . . . . . . 23
9. Sequencing of State Changes . . . . . . . . . . . . . . . . . 25 8. Handshake Messages . . . . . . . . . . . . . . . . . . . . . 24
9.1. Server-side enforced ordering . . . . . . . . . . . . . . 26 8.1. Init . . . . . . . . . . . . . . . . . . . . . . . . . . 26
9.2. Client-side enforced ordering . . . . . . . . . . . . . . 26 8.2. GroupAdd . . . . . . . . . . . . . . . . . . . . . . . . 26
10. Message Protection . . . . . . . . . . . . . . . . . . . . . 26 8.3. UserAdd . . . . . . . . . . . . . . . . . . . . . . . . . 27
11. Security Considerations . . . . . . . . . . . . . . . . . . . 27 8.4. Update . . . . . . . . . . . . . . . . . . . . . . . . . 28
11.1. Confidentiality of the Group Secrets . . . . . . . . . . 28 8.5. Remove . . . . . . . . . . . . . . . . . . . . . . . . . 29
11.2. Authentication . . . . . . . . . . . . . . . . . . . . . 28 9. Sequencing of State Changes . . . . . . . . . . . . . . . . . 29
11.3. Forward and post-compromise security . . . . . . . . . . 28 9.1. Server-Enforced Ordering . . . . . . . . . . . . . . . . 30
11.4. Init Key Reuse . . . . . . . . . . . . . . . . . . . . . 29 9.2. Client-Enforced Ordering . . . . . . . . . . . . . . . . 31
12. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 29 9.3. Merging Updates . . . . . . . . . . . . . . . . . . . . . 31
13. Contributors . . . . . . . . . . . . . . . . . . . . . . . . 29 10. Message Protection . . . . . . . . . . . . . . . . . . . . . 32
14. References . . . . . . . . . . . . . . . . . . . . . . . . . 30 11. Security Considerations . . . . . . . . . . . . . . . . . . . 33
14.1. Normative References . . . . . . . . . . . . . . . . . . 30 11.1. Confidentiality of the Group Secrets . . . . . . . . . . 33
14.2. Informative References . . . . . . . . . . . . . . . . . 30 11.2. Authentication . . . . . . . . . . . . . . . . . . . . . 34
Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 31 11.3. Forward and post-compromise security . . . . . . . . . . 34
11.4. Init Key Reuse . . . . . . . . . . . . . . . . . . . . . 34
12. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 35
13. Contributors . . . . . . . . . . . . . . . . . . . . . . . . 35
14. References . . . . . . . . . . . . . . . . . . . . . . . . . 35
14.1. Normative References . . . . . . . . . . . . . . . . . . 35
14.2. Informative References . . . . . . . . . . . . . . . . . 36
Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 37
1. Introduction 1. Introduction
DISCLAIMER: This is a work-in-progress draft of MLS and has not yet DISCLAIMER: This is a work-in-progress draft of MLS and has not yet
seen significant security analysis. It should not be used as a basis seen significant security analysis. It should not be used as a basis
for building production systems. for building production systems.
RFC EDITOR: PLEASE REMOVE THE FOLLOWING PARAGRAPH The source for this RFC EDITOR: PLEASE REMOVE THE FOLLOWING PARAGRAPH The source for this
draft is maintained in GitHub. Suggested changes should be submitted draft is maintained in GitHub. Suggested changes should be submitted
as pull requests at https://github.com/ekr/mls-protocol. as pull requests at https://github.com/ekr/mls-protocol.
Instructions are on that page as well. Editorial changes can be Instructions are on that page as well. Editorial changes can be
managed in GitHub, but any substantive change should be discussed on managed in GitHub, but any substantive change should be discussed on
the MLS mailing list. the MLS mailing list.
Groups of agents who want to send each other encrypted messages need A group of agents who want to send each other encrypted messages
a way to derive shared symmetric encryption keys. For two parties, needs a way to derive shared symmetric encryption keys. For two
this problem has been studied thoroughly, with the Double Ratchet parties, this problem has been studied thoroughly, with the Double
emerging as a common solution [doubleratchet] [signal]. Channels Ratchet emerging as a common solution [doubleratchet] [signal].
implementing the Double Ratchet enjoy fine-grained forward secrecy as Channels implementing the Double Ratchet enjoy fine-grained forward
well as post-compromise security, but are nonetheless efficient secrecy as well as post-compromise security, but are nonetheless
enough for heavy use over low-bandwidth networks. efficient enough for heavy use over low-bandwidth networks.
For groups of size greater than two, a common strategy is to For a group of size greater than two, a common strategy is to
unilaterally broadcast symmetric "sender" keys over existing shared unilaterally broadcast symmetric "sender" keys over existing shared
symmetric channels, and then for each agent to send messages to the symmetric channels, and then for each agent to send messages to the
group encrypted with their own sender key. Unfortunately, while this group encrypted with their own sender key. Unfortunately, while this
improves efficiency over pairwise broadcast of individual messages improves efficiency over pairwise broadcast of individual messages
and (with the addition of a hash ratchet) provides forward secrecy, and (with the addition of a hash ratchet) provides forward secrecy,
it is difficult to achieve post-compromise security with sender keys. it is difficult to achieve post-compromise security with sender keys.
An adversary who learns a sender key can often indefinitely and An adversary who learns a sender key can often indefinitely and
passively eavesdrop on that sender's messages. Generating and passively eavesdrop on that sender's messages. Generating and
distributing a new sender key provides a form of post-compromise distributing a new sender key provides a form of post-compromise
security with regard to that sender. However, it requires security with regard to that sender. However, it requires
computation and communications resources that scale linearly as the computation and communications resources that scale linearly as the
size of the group. size of the group.
In this document, we describe a protocol based on tree structures In this document, we describe a protocol based on tree structures
that enable asynchronous group keying with forward secrecy and post- that enable asynchronous group keying with forward secrecy and post-
compromise security. The use of "asynchronous ratcheting trees" compromise security. This document describes two candidate
[art] allows the members of the group to derive and update shared approaches, one using "asynchronous ratcheting trees" [art], the
keys with costs that scale as the log of the group size. The use of other using an asynchronous key-encapsulation mechanism for tree
Merkle trees to store identity information allows strong structures called TreeKEM. Both mechanisms allow the members of the
authentication of group membership, again with logarithmic cost. group to derive and update shared keys with costs that scale as the
log of the group size. The use of Merkle trees to store identity
information allows strong authentication of group membership, again
with logarithmic cost.
2. Terminology 2. Terminology
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].
[TODO: The architecture document uses "Client" instead of [TODO: The architecture document uses "Client" instead of
"Participant". Harmonize terminology.] "Participant". Harmonize terminology.]
skipping to change at page 4, line 50 skipping to change at page 5, line 13
sender of a message. sender of a message.
Terminology specific to tree computations is described in Section 5. Terminology specific to tree computations is described in Section 5.
We use the TLS presentation language [I-D.ietf-tls-tls13] to describe We use the TLS presentation language [I-D.ietf-tls-tls13] to describe
the structure of protocol messages. the structure of protocol messages.
3. Basic Assumptions 3. Basic Assumptions
This protocol is designed to execute in the context of a Messaging This protocol is designed to execute in the context of a Messaging
Service (MS) as described in [I-D.rescorla-mls-architecture]. In Service (MS) as described in [I-D.omara-mls-architecture]. In
particular, we assume the MS provides the following services: particular, we assume the MS provides the following services:
o A long-term identity key provider which allows participants to o A long-term identity key provider which allows participants to
authenticate protocol messages in a group. These keys MUST be authenticate protocol messages in a group. These keys MUST be
kept for the lifetime of the group as there is no mechanism in the kept for the lifetime of the group as there is no mechanism in the
protocol for changing a participant's identity key. protocol for changing a participant's identity key.
o A broadcast channel, for each group, which will relay a message to o A broadcast channel, for each group, which will relay a message to
all members of a group. For the most part, we assume that this all members of a group. For the most part, we assume that this
channel delivers messages in the same order to all participants. channel delivers messages in the same order to all participants.
skipping to change at page 8, line 32 skipping to change at page 8, line 32
| | |state.init() | | | | |state.init() | |
| | | | | | | | | |
To enforce forward secrecy and post-compromise security of messages, To enforce forward secrecy and post-compromise security of messages,
each participant periodically updates its leaf key, the DH key pair each participant periodically updates its leaf key, the DH key pair
that represents its contribution to the group key. Any member of the that represents its contribution to the group key. Any member of the
group can send an Update at any time by generating a fresh leaf key group can send an Update at any time by generating a fresh leaf key
pair and sending an Update message that describes how to update the pair and sending an Update message that describes how to update the
group key with that new key pair. Once all participants have group key with that new key pair. Once all participants have
processed this message, the group's secrets will be unknown to an processed this message, the group's secrets will be unknown to an
attacker that had compromised the sender's prior DH leaf private key. attacker that had compromised the sender's prior leaf private key.
It is left to the application to determine the interval of time It is left to the application to determine the interval of time
between Update messages. This policy could require a change for each between Update messages. This policy could require a change for each
message, or it could require sending an update every week or more. message, or it could require sending an update every week or more.
Group Group
A B ... Z Directory Channel A B ... Z Directory Channel
| | | | | | | | | |
| Update(A) | | | | | Update(A) | | | |
|---------------------------------------------------------->| |---------------------------------------------------------->|
skipping to change at page 9, line 32 skipping to change at page 9, line 32
| | | | | | | | | |
| | | | | | | | | |
5. Binary Trees 5. Binary Trees
The protocol uses two types of binary tree structures: The protocol uses two types of binary tree structures:
o Merkle trees for efficiently committing to a set of group o Merkle trees for efficiently committing to a set of group
participants. participants.
o Asynchronous ratcheting trees for deriving shared secrets among o Ratchet trees for deriving shared secrets among this group of
this group of participants. participants.
The two trees in the protocol share a common structure, allowing us The two trees in the protocol share a common structure, allowing us
to maintain a direct mapping between their nodes when manipulating to maintain a direct mapping between their nodes when manipulating
group membership. The "nth" leaf in each tree is owned by the "nth" group membership. The "nth" leaf in each tree is owned by the "nth"
group participant. group participant.
5.1. Terminology 5.1. Terminology
We use a common set of terminology to refer to both types of binary We use a common set of terminology to refer to both types of binary
tree. tree.
Trees consist of various different types of _nodes_. A node is a Trees consist of various different types of _nodes_. A node is a
_leaf_ if it has no children, and a _parent_ otherwise; note that all _leaf_ if it has no children, and a _parent_ otherwise; note that all
parents in our Merkle or asynchronous ratcheting trees have precisely parents in our Merkle or ratchet trees have precisely two children, a
two children, a _left_ child and a _right_ child. A node is the _left_ child and a _right_ child. A node is the _root_ of a tree if
_root_ of a tree if it has no parents, and _intermediate_ if it has it has no parents, and _intermediate_ if it has both children and
both children and parents. The _descendants_ of a node are that parents. The _descendants_ of a node are that node, its children,
node, its children, and the descendants of its children, and we say a and the descendants of its children, and we say a tree _contains_ a
tree _contains_ a node if that node is a descendant of the root of node if that node is a descendant of the root of the tree. Nodes are
the tree. Nodes are _siblings_ if they share the same parent. _siblings_ if they share the same parent.
A _subtree_ of a tree is the tree given by the descendants of any A _subtree_ of a tree is the tree given by the descendants of any
node, the _head_ of the subtree The _size_ of a tree or subtree is node, the _head_ of the subtree The _size_ of a tree or subtree is
the number of leaf nodes it contains. For a given parent node, its the number of leaf nodes it contains. For a given parent node, its
_left subtree_ is the subtree with its left child as head _left subtree_ is the subtree with its left child as head
(respectively _right subtree_). (respectively _right subtree_).
All trees used in this protocol are left-balanced binary trees. A All trees used in this protocol are left-balanced binary trees. A
binary tree is _full_ (and _balanced_) if it its size is a power of binary tree is _full_ (and _balanced_) if it its size is a power of
two and for any parent node in the tree, its left and right subtrees two and for any parent node in the tree, its left and right subtrees
skipping to change at page 11, line 13 skipping to change at page 11, line 13
o The frontier of the tree is (ABCD, EF, G) o The frontier of the tree is (ABCD, EF, G)
ABCDEFG ABCDEFG
/ \ / \
/ \ / \
/ \ / \
ABCD EFG ABCD EFG
/ \ / \ / \ / \
/ \ / \ / \ / \
AB CD EF \ AB CD EF \
/ \ / \ / \ \ / \ / \ / \ \
A B C D E F G A B C D E F G
We extend both types of tree to include a concept of "blank" nodes; We extend both types of tree to include a concept of "blank" nodes;
which are used to replace group members who have been removed. We which are used to replace group members who have been removed. We
expand on how these are used and implemented in the sections below. expand on how these are used and implemented in the sections below.
(Note that left-balanced binary trees are the same structure that is (Note that left-balanced binary trees are the same structure that is
used for the Merkle trees in the Certificate Transparency protocol used for the Merkle trees in the Certificate Transparency protocol
[I-D.ietf-trans-rfc6962-bis].) [I-D.ietf-trans-rfc6962-bis].)
5.2. Merkle Trees 5.2. Merkle Trees
skipping to change at page 12, line 24 skipping to change at page 12, line 24
A || B)" as "AB". A || B)" as "AB".
ABCD ABCD
/ \ / \
AB CD* AB CD*
/ \ / \ / \ / \
A B* C D A B* C D
5.3. Ratchet Trees 5.3. Ratchet Trees
Ratchet trees are used for generating shared group secrets. These Ratchet trees are used for generating shared group secrets. In this
are constructed as a series of Diffie-Hellman keys in a binary tree section, we describe the structure of a ratchet tree, along with two
arrangement, with each user knowing their direct path, and thus being ways to manage a ratchet tree, called ART and TreeKEM.
able to compute the shared root secret.
To construct these trees, we require: To construct these trees, we require:
o a Diffie-Hellman finite-field group or elliptic curve; o A Diffie-Hellman finite-field group or elliptic curve
o a Derive-Key-Pair function that produces a key pair from an octet o A Derive-Key-Pair function that produces a key pair from an octet
string, such as the output of a DH computation string
Each node in a ratchet tree contains up to three values: o A hash function (TreeKEM only)
A ratchet tree is a left-balanced binary tree, in which each node
contains up to three values:
o A secret octet string (optional) o A secret octet string (optional)
o A DH private key (optional) o An asymmetric private key (optional)
o A DH public key o An asymmetric public key
To compute the private values (secret and private key) for a given The private key and public key for a node are derived from its secret
node, one must first know the private key from one of its children, value using the Derive-Key-Pair operation.
and the public key from the other child. Then the value of the
parent is computed as follows:
o secret = DH(L, R) The relationships between nodes are different for ART and TreeKEM.
In either case, the ratchet tree structure ensures the following
property: A party can compute the secret value for the root of the
tree if and only if that party holds the secret value for another
node lower in the tree (together with public information). Each
participant holds one leaf secret; each participant can update the
root secret by changing their leaf secret.
5.3.1. Ratchet Trees for ART
In ART the contents of a parent node are computed from its children
as follows:
o parent_secret = DH(left_child, right_child)
o parent_private, parent_public = Derive-Key-Pair(parent_secret)
o private, public = Derive-Key-Pair(secret)
Ratchet trees are constructed as left-balanced trees, defined such Ratchet trees are constructed as left-balanced trees, defined such
that each parent node's key pair is derived from the Diffie-Hellman that each parent node's key pair is derived from the Diffie-Hellman
shared secret of its two child nodes. To compute the root secret and shared secret of its two child nodes. To compute the root secret and
private key, a participant must know the public keys of nodes in its private key, a participant must know the public keys of nodes in its
copath, as well as its own leaf private key. copath, as well as its own leaf private key.
For example, the ratchet tree consisting of the private keys (A, B, For example, the ratchet tree consisting of the private keys (A, B,
C, D) is constructed as follows: C, D) is constructed as follows:
DH(DH(AB), DH(CD)) DH(DH(AB), DH(CD))
/ \ / \
DH(AB) DH(CD) DH(AB) DH(CD)
/ \ / \ / \ / \
A B C D A B C D
Ratchet trees constructed this way provide the property that one must 5.3.2. Ratchet Trees for TreeKEM
hold at least one private key from the tree to compute the secret
root key. With all participants holding one leaf private key; this
allows any individual to update their own key and change the shared
root key, such that only group members can compute the new key.
5.3.1. Blank Ratchet Tree Nodes In TreeKEM, the contents of a parent node are computed from one of
its children as follows:
o parent_secret = Hash(child_secret)
o parent_private, parent_public = Derive-Key-Pair(parent_secret)
The contents of the parent are based on the latest-updated child.
For example, if participants with leaf secrets A, B, C, and D join a
group in that order, then the resulting tree will have the following
structure:
H(H(D))
/ \
H(B) H(D)
/ \ / \
A B C D
If the first participant subsequently changes its leaf secret to be
X, then the tree will have the following structure.
H(H(X))
/ \
H(X) H(D)
/ \ / \
X B C D
5.3.3. Ratchet Tree Updates
In order to update the state of the group such as adding and removing
participants, MLS messages are used to make changes to the group's
ratchet tree. While the details of update processing differ between
ART and TreeKEM (as described below), in both cases the participant
proposing an update to the tree transmits a representation of a set
of tree nodes along the direct path from a leaf to the root. Other
participants in the group can use these nodes to update their view of
the tree, aligning their copy of the tree to the sender's.
In ART, the transmitted nodes are represented by their public keys.
Receivers process an update with the following steps:
1. Replace the public keys in the cached tree with the received
values
2. Whenever a public key is updated for a node whose sibling has a
private key populated:
* Perform a DH operation and update the node's parent
* Repeat the prior step until reaching the root
In TreeKEM, the sender transmits a node by sending the public key for
the node and an encrypted version of the secret value for the node.
The secret value is encrypted in such a way that it can be decrypted
only by holders of the private key for one of its children, namely
the child that is not in the direct path being transmitted. (That
is, each node in the direct path is encrypted for holders of the
private key for a node in the corresponding copath.) For leaf nodes,
no encrypted secret is transmitted.
A TreeKEM update is processed with the following steps:
1. Compute the updated secret values * Identify a node in the direct
path for which the local participant has the private key *
Decrypt the secret value for that node * Compute secret values
for ancestors of that node by hashing the decrypted secret
2. Merge the updated secrets into the tree * Replace the public keys
for nodes on the direct path with the received public keys * For
nodes where an updated secret was computed in step 1, replace the
secret value for the node with the updated value
For example, suppose we had the following tree:
G
/ \
/ \
E F
/ \ / \
A B C D
If an update is made along the direct path B-E-G, then the following
values will be transmitted (using pk(X) to represent the public key
corresponding to the secret value X and E(K, S) to represent public-
key encryption to the public key K of the secret value S):
+------------+-------------+
| Public Key | Ciphertext |
+------------+-------------+
| pk(G) | E(pk(F), G) |
| | |
| pk(E) | E(pk(A), E) |
| | |
| pk(B) | |
+------------+-------------+
5.3.4. Blank Ratchet Tree Nodes
Nodes in a ratchet tree can have a special value "_", used to Nodes in a ratchet tree can have a special value "_", used to
indicate that the node should be ignored during path computations. indicate that the node should be ignored during path computations.
Such nodes are used to replace leaves when participants are deleted Such nodes are used to replace leaves when participants are deleted
from the group. from the group.
If any node in the copath of a leaf is _, it should be ignored during If any node in the copath of a leaf is _, it should be ignored during
the computation of the path. For example, the tree consisting of the the computation of the path. For example, the tree consisting of the
private keys (A, _, C, D) is constructed as follows: private keys (A, _, C, D) is constructed as follows for ART:
DH(A, DH(CD)) DH(A, DH(CD))
/ \ / \
A DH(CD) A DH(CD)
/ \ / \ / \ / \
A _ C D A _ C D
Replacing a node by _ in TreeKEM, means performing an update on any
leaf without sending the new key to the the blanked leaf. In the
following example, participant A update its key to A' and derive the
new sequence of keys up-to the path. Here A only send H(H(A')) to
the parent node of C and D but does not send H(A') to B which evicts
it from the Group. ~~~~~ H(H(A')) / \ H(A') H(C) / \ / \ A' _ C D
~~~~~
If two sibling nodes are both _, their parent value also becomes _. If two sibling nodes are both _, their parent value also becomes _.
Blank nodes effectively result in an unbalanced tree, but allow the Blank nodes effectively result in an unbalanced tree, but allow the
tree management to behave as for a balanced tree for programming tree management to behave as for a balanced tree for programming
simplicity. simplicity.
6. Group State 6. Group State
The state of an MLS group at a given time comprises: The state of an MLS group at a given time comprises:
skipping to change at page 15, line 21 skipping to change at page 17, line 34
6.1. Cryptographic Objects 6.1. Cryptographic Objects
Each MLS session uses a single ciphersuite that specifies the Each MLS session uses a single ciphersuite that specifies the
following primitives to be used in group key computations: following primitives to be used in group key computations:
o A hash function o A hash function
o A Diffie-Hellman finite-field group or elliptic curve o A Diffie-Hellman finite-field group or elliptic curve
o An AEAD encryption algorithm (TreeKEM only) [RFC5116]
The ciphersuite must also specify an algorithm "Derive-Key-Pair" that The ciphersuite must also specify an algorithm "Derive-Key-Pair" that
maps octet strings with the same length as the output of the hash maps octet strings with the same length as the output of the hash
function to key pairs for the Diffie-Hellman group. function to key pairs for the asymmetric encryption scheme.
Public keys and Merkle tree nodes used in the protocol are opaque Public keys and Merkle tree nodes used in the protocol are opaque
values in a format defined by the ciphersuite, using the following values in a format defined by the ciphersuite, using the following
four types: four types:
uint16 CipherSuite; uint16 CipherSuite;
opaque DHPublicKey<1..2^16-1>; opaque DHPublicKey<1..2^16-1>;
opaque SignaturePublicKey<1..2^16-1>; opaque SignaturePublicKey<1..2^16-1>;
opaque MerkleNode<1..255> opaque MerkleNode<1..255>
[[OPEN ISSUE: In some cases we will want to include a raw key when we [[OPEN ISSUE: In some cases we will want to include a raw key when we
sign and in others we may want to include an identity or a sign and in others we may want to include an identity or a
certificate containing the key. This type needs to be extended to certificate containing the key. This type needs to be extended to
accommodate that.]] accommodate that.]]
6.1.1. Curve25519 with SHA-256 6.1.1. ART with Curve25519 and SHA-256
This ciphersuite uses the following primitives: This ciphersuite uses the following primitives:
o Hash function: SHA-256 o Hash function: SHA-256
o Diffie-Hellman group: Curve25519 [RFC7748] o Diffie-Hellman group: Curve25519 [RFC7748]
o AEAD: N/A
Given an octet string X, the private key produced by the Derive-Key- Given an octet string X, the private key produced by the Derive-Key-
Pair operation is SHA-256(X). (Recall that any 32-octet string is a Pair operation is SHA-256(X). (Recall that any 32-octet string is a
valid Curve25519 private key.) The corresponding public key is valid Curve25519 private key.) The corresponding public key is
X25519(SHA-256(X), 9). X25519(SHA-256(X), 9).
Implementations SHOULD use the approach specified in [RFC7748] to Implementations SHOULD use the approach specified in [RFC7748] to
calculate the Diffie-Hellman shared secret. Implementations MUST calculate the Diffie-Hellman shared secret. Implementations MUST
check whether the computed Diffie-Hellman shared secret is the all- check whether the computed Diffie-Hellman shared secret is the all-
zero value and abort if so, as described in Section 6 of [RFC7748]. zero value and abort if so, as described in Section 6 of [RFC7748].
If implementers use an alternative implementation of these elliptic If implementers use an alternative implementation of these elliptic
curves, they SHOULD perform the additional checks specified in curves, they SHOULD perform the additional checks specified in
Section 7 of {{RFC7748]} Section 7 of [RFC7748]
6.1.2. P-256 with SHA-256 6.1.2. ART with P-256 and SHA-256
This ciphersuite uses the following primitives: This ciphersuite uses the following primitives:
o Hash function: SHA-256 o Hash function: SHA-256
o Diffie-Hellman group: secp256r1 (NIST P-256) o Diffie-Hellman group: secp256r1 (NIST P-256)
o AEAD: N/A
Given an octet string X, the private key produced by the Derive-Key- Given an octet string X, the private key produced by the Derive-Key-
Pair operation is SHA-256(X), interpreted as a big-endian integer. Pair operation is SHA-256(X), interpreted as a big-endian integer.
The corresponding public key is the result of multiplying the The corresponding public key is the result of multiplying the
standard P-256 base point by this integer. standard P-256 base point by this integer.
P-256 ECDH calculations (including parameter and key generation as P-256 ECDH calculations (including parameter and key generation as
well as the shared secret calculation) are performed according to well as the shared secret calculation) are performed according to
[IEEE1363] using the ECKAS-DH1 scheme with the identity map as key [IEEE1363] using the ECKAS-DH1 scheme with the identity map as key
derivation function (KDF), so that the shared secret is the derivation function (KDF), so that the shared secret is the
x-coordinate of the ECDH shared secret elliptic curve point x-coordinate of the ECDH shared secret elliptic curve point
skipping to change at page 17, line 5 skipping to change at page 19, line 20
Clients MUST validate remote public values by ensuring that the point Clients MUST validate remote public values by ensuring that the point
is a valid point on the elliptic curve. The appropriate validation is a valid point on the elliptic curve. The appropriate validation
procedures are defined in Section 4.3.7 of [X962] and alternatively procedures are defined in Section 4.3.7 of [X962] and alternatively
in Section 5.6.2.3 of [keyagreement]. This process consists of three in Section 5.6.2.3 of [keyagreement]. This process consists of three
steps: (1) verify that the value is not the point at infinity (O), steps: (1) verify that the value is not the point at infinity (O),
(2) verify that for Y = (x, y) both integers are in the correct (2) verify that for Y = (x, y) both integers are in the correct
interval, (3) ensure that (x, y) is a correct solution to the interval, (3) ensure that (x, y) is a correct solution to the
elliptic curve equation. For these curves, implementers do not need elliptic curve equation. For these curves, implementers do not need
to verify membership in the correct subgroup. to verify membership in the correct subgroup.
6.2. Key Schedule 6.1.3. TreeKEM with Curve25519, SHA-256, and AES-128-GCM
This ciphersuite uses the following primities:
o Hash function: SHA-256
o Diffie-Hellman group: Curve25519 [RFC7748]
o AEAD: AES-128-GCM
DH and Derive-Key-Pair operations are performed in the same way as
the corresponding ART ciphersuite.
Encryption keys are derived from shared secrets by taking the first
16 bytes of H(Z), where Z is the shared secret and H is SHA-256.
6.1.4. TreeKEM with P-256, SHA-256, and AES-128-GCM
This ciphersuite uses the following primities:
o Hash function: P-256
o Diffie-Hellman group: secp256r1 (NIST P-256)
o AEAD: AES-128-GCM
DH and Derive-Key-Pair operations are performed in the same way as
the corresponding ART ciphersuite.
Encryption keys are derived from shared secrets by taking the first
16 bytes of H(Z), where Z is the shared secret and H is SHA-256.
6.2. Direct Paths
As described in Section 5.3.3, each MLS message needs to transmit
node values along the direct path from a leaf to the root. In ART,
this simply entails sending the public key for each node. In
TreeKEM, the path contains a public key for the leaf node, and a
public key and encrypted secret value for intermediate nodes in the
path. In both cases, the path is ordered from the leaf to the root;
each node MUST be the parent of its predecessor.
DHPublicKey ARTPath<0..2^16-1>;
struct {
DHPublicKey ephemeral_key;
opaque nonce<0..255>;
opaque ciphertext<0..255>;
} ECIESCiphertext;
struct {
DHPublicKey public_key;
ECIESCiphertext ciphertext;
} TreeKEMNode;
struct {
DHPublicKey leaf;
TreeKEMNode intermediates<0..2^16-1>;
} TreeKEMPath;
struct {
select (mode) {
case ART: ARTPath;
case TreeKEM: TreeKEMPath;
};
} DirectPath;
When using TreeKEM, the ECIESCiphertext values encoding the encrypted
secret values are computed as follows:
o Generate an ephemeral DH key pair (x, x*G) in the DH group
specified by the ciphersuite in use
o Compute the shared secret Z with the node's other child
o Generate a fresh nonce N
o Encrypt the node's secret value using the AEAD algorithm specified
by the ciphersuite in use, with the following inputs:
* Key: A key derived from Z as specified by the ciphersuite
* Nonce: A random nonce N of the size required by the algorithm
* Additional Authenticated Data: The empty octet string
* Plaintext: The secret value, without any further formatting
o Encode the ECIESCiphertext with the following values:
* ephemeral_key: The ephemeral public key x*G
* nonce: The random nonce N
* ciphertext: The AEAD output
Decryption is performed in the corresponding way, using the private
key of the non-updated child and the ephemeral public key transmitted
in the message.
6.3. Key Schedule
Group keys are derived using the HKDF-Extract and HKDF-Expand Group keys are derived using the HKDF-Extract and HKDF-Expand
functions as defined in [RFC5869], as well as the functions defined functions as defined in [RFC5869], as well as the functions defined
below: below:
Derive-Secret(Secret, Label, ID, Epoch, Msg) = Derive-Secret(Secret, Label, ID, Epoch, Msg) =
HKDF-Expand(Secret, HkdfLabel, Length) HKDF-Expand(Secret, HkdfLabel, Length)
Where HkdfLabel is specified as: Where HkdfLabel is specified as:
skipping to change at page 17, line 27 skipping to change at page 21, line 47
uint16 length = Length; uint16 length = Length;
opaque label<7..255> = "mls10 " + Label; opaque label<7..255> = "mls10 " + Label;
opaque group_id<0..2^16-1> = ID; opaque group_id<0..2^16-1> = ID;
uint32 epoch = Epoch; uint32 epoch = Epoch;
opaque message<1..2^16-1> = Msg opaque message<1..2^16-1> = Msg
} HkdfLabel; } HkdfLabel;
The Hash function used by HKDF is the ciphersuite hash algorithm. The Hash function used by HKDF is the ciphersuite hash algorithm.
Hash.length is its output length in bytes. In the below diagram: Hash.length is its output length in bytes. In the below diagram:
o HKDF-Extract takes its Salt argument form the top and its IKM o HKDF-Extract takes its Salt argument from the top and its IKM
argument from the left argument from the left
o Derive-Secret takes its Secret argument from the incoming arrow o Derive-Secret takes its Secret argument from the incoming arrow
When processing a handshake message, a participant combines the When processing a handshake message, a participant combines the
following information to derive new epoch secrets: following information to derive new epoch secrets:
o The init secret from the previous epoch o The init secret from the previous epoch
o The update secret for the current epoch o The update secret for the current epoch
o The handshake message that caused the epoch change o The handshake message that caused the epoch change
o The current group identifier (GID) and epoch o The current group identifier (GID) and epoch
skipping to change at page 18, line 31 skipping to change at page 23, line 4
| |
V V
Init Secret [n] Init Secret [n]
7. Initialization Keys 7. Initialization Keys
In order to facilitate asynchronous addition of participants to a In order to facilitate asynchronous addition of participants to a
group, it is possible to pre-publish initialization keys that provide group, it is possible to pre-publish initialization keys that provide
some public information about a user or group. UserInitKey messages some public information about a user or group. UserInitKey messages
provide information about a potential group member, that a group provide information about a potential group member, that a group
member can use to add this user to a group without asynchronously. member can use to add this user to a group asynchronously.
GroupInitKey messages provide information about a group that a new GroupInitKey messages provide information about a group that a new
user can use to join the group without any of the existing members of user can use to join the group without any of the existing members of
the group being online. the group being online.
7.1. UserInitKey 7.1. UserInitKey
A UserInitKey object specifies what ciphersuites a client supports, A UserInitKey object specifies what ciphersuites a client supports,
as well as providing public keys that the client can use for key as well as providing public keys that the client can use for key
derivation and signing. The client's identity key is intended to be derivation and signing. The client's identity key is intended to be
stable throughout the lifetime of the group; there is no mechanism to stable throughout the lifetime of the group; there is no mechanism to
change it. Init keys are intended to be used a very limited number change it. Init keys are intended to be used a very limited number
of times, potentially once. (see Section 11.4). of times, potentially once. (see Section 11.4).
The init_keys array MUST have the same length as the cipher_suites The init_keys array MUST have the same length as the cipher_suites
array, and each entry in the init_keys array MUST be a public key for array, and each entry in the init_keys array MUST be a public key for
the DH group defined by the corresponding entry in the cipher_suites the DH group or KEM defined by the corresponding entry in the
array. cipher_suites array.
The whole structure is signed using the client's identity key. A The whole structure is signed using the client's identity key. A
UserInitKey object with an invalid signature field MUST be considered UserInitKey object with an invalid signature field MUST be considered
malformed. The input to the signature computation comprises all of malformed. The input to the signature computation comprises all of
the fields except for the signature field. the fields except for the signature field.
struct { struct {
CipherSuite cipher_suites<0..255>; CipherSuite cipher_suites<0..255>;
DHPublicKey init_keys<1..2^16-1>; DHPublicKey init_keys<1..2^16-1>;
SignaturePublicKey identity_key; SignaturePublicKey identity_key;
skipping to change at page 19, line 30 skipping to change at page 24, line 4
o The current epoch number o The current epoch number
o The number of participants currently in the group o The number of participants currently in the group
o The group ID o The group ID
o The cipher suite used by the group o The cipher suite used by the group
o The public key of the current update key pair for the group o The public key of the current update key pair for the group
o The frontier of the identity tree, as a sequence of hash values o The frontier of the identity tree, as a sequence of hash values
o The frontier of the ratchet tree, as a sequence of public keys o The frontier of the ratchet tree, as a sequence of public keys
GroupInitKey messages are not themselves signed. A GroupInitKey GroupInitKey messages are not themselves signed. A GroupInitKey
should not be published "bare"; instead, it should be published by should not be published "bare"; instead, it should be published by
constructing a handshake message with type "none", which will include constructing a handshake message with type "none", which will include
a signature by a member of the group and a proof of membership in the a signature by a member of the group and a proof of membership in the
group. group.
struct { struct {
uint32 epoch; uint32 epoch;
uint32 group_size; uint32 group_size;
opaque group_id<0..2^16-1>; opaque group_id<0..2^16-1>;
CipherSuite cipher_suite; CipherSuite cipher_suite;
DHPublicKey add_key; DHPublicKey add_key;
MerkleNode identity_frontier<0..2^16-1>; MerkleNode identity_frontier<0..2^16-1>;
DHPublicKey ratchet_frontier<0..2^16-1>; TreeNode ratchet_frontier<0..2^16-1>;
} GroupInitKey; } GroupInitKey;
8. Handshake Messages 8. Handshake Messages
Over the lifetime of a group, its state will change for: Over the lifetime of a group, its state will change for:
o Group initialization o Group initialization
o A current member adding a new participant o A current member adding a new participant
o A new participant adding themselves o A new participant adding themselves
o A current participant updating its leaf key o A current participant updating its leaf key
o A current member deleting another current member o A current member deleting another current member
In MLS, these changes are accomplished by broadcasting "handshake" In MLS, these changes are accomplished by broadcasting "handshake"
messages to the group. Note that unlike TLS and DTLS, there is not a messages to the group. Note that unlike TLS and DTLS, there is not a
consolidated handshake phase to the protocol. Rather, handshake consolidated handshake phase to the protocol. Rather, handshake
messages are exchanged throughout the lifetime of a group, whenever a messages are exchanged throughout the lifetime of a group, whenever a
change is made to the group state. change is made to the group state. This means an unbounded number of
interleaved application and handshake messages.
An MLS handshake message encapsulates a specific message that An MLS handshake message encapsulates a specific message that
accomplishes a change to the group state. It also includes two other accomplishes a change to the group state. It also includes two other
important features: important features:
o A GroupInitKey so that a new participant can observe the latest o A GroupInitKey so that a new participant can observe the latest
state of the handshake and initialize itself state of the handshake and initialize itself
o A signature by a member of the group, together with a Merkle o A signature by a member of the group, together with a Merkle
inclusion proof that demonstrates that the signer is a legitimate inclusion proof that demonstrates that the signer is a legitimate
skipping to change at page 22, line 24 skipping to change at page 26, line 39
[[ OPEN ISSUE: Direct initialization is currently undefined. A [[ OPEN ISSUE: Direct initialization is currently undefined. A
participant can create a group by initializing its own state to participant can create a group by initializing its own state to
reflect a group including only itself, then adding the initial reflect a group including only itself, then adding the initial
participants. This has computation and communication complexity O(N participants. This has computation and communication complexity O(N
log N) instead of the O(N) complexity of direct initialization. ]] log N) instead of the O(N) complexity of direct initialization. ]]
8.2. GroupAdd 8.2. GroupAdd
A GroupAdd message is sent by a group member to add a new participant A GroupAdd message is sent by a group member to add a new participant
to the group. The content of the message is only the UserInitKey for to the group.
the user being added.
struct { struct {
UserInitKey init_key; PublicKey ephemeral;
DirectPath add_path<1..2^16-1>;
} GroupAdd; } GroupAdd;
A group member generates such a message by requesting from the A group member generates this message using the following steps:
directory a UserInitKey for the user to be added. The new
participant processes the message together with the private key o Requesting from the directory a UserInitKey for the user to be
added
o Generate a fresh ephemeral DH key pair
o Generate the leaf secret for the new node as the output of a DH
operation between the ephemeral key pair and the public key in the
UserInitKey
o Use the ratchet frontier and the new leaf secret to compute the
direct path between the new leaf and the new root
The public key of the ephemeral key pair is placed in the "ephemeral"
field of the GroupAdd message. The computed direct path is placed in
the "add_path" field.
The new participant processes the message and the private key
corresponding to the UserInitKey to initialize his state as follows: corresponding to the UserInitKey to initialize his state as follows:
o Compute the participant's leaf key pair by combining the init key o Compute the participant's leaf secret by combining the init key in
in the UserInitKey with the prior epoch's add key pair the UserInitKey with the prior epoch's add key pair
o Use the frontiers in the GroupInitKey of the Handshake message to o Use the frontiers in the GroupInitKey of the Handshake message to
add its keys to the trees add its keys to the trees
An existing participant receiving a GroupAdd message first verifies An existing participant receiving a GroupAdd message first verifies
the signature on the message, then verifies its identity proof the signature on the message, then verifies its identity proof
against the identity tree held by the participant. The participant against the identity tree held by the participant. The participant
then updates its state as follows: then updates its state as follows:
o Compute the new participant's leaf key pair by combining the leaf o Compute the new participant's leaf key pair by combining the leaf
key in the UserInitKey with the prior epoch add key pair key in the UserInitKey with the prior epoch add key pair
o Update the group's identity tree and ratchet tree with the new o Update the group's identity tree and ratchet tree with the new
participant's information participant's information
The update secret resulting from this change is the output of a DH The update secret resulting from this change is the output of a DH
computation between the private key for the root of the ratchet tree computation between the private key for the root of the ratchet tree
and the add public key from the previous epoch. and the add public key from the previous epoch.
[[ ALTERNATIVE: The sender could also generate the new participant's
leaf using a fresh key pair, as opposed to a key pair derived from
the prior epoch's secret. This would reduce the "double-join"
problem, at the cost of the GroupAdd having to include a new ratchet
frontier. ]]
8.3. UserAdd 8.3. UserAdd
A UserAdd message is sent by a new group participant to add A UserAdd message is sent by a new group participant to add themself
themselves to the group, based on having already had access to a to the group, based on having already had access to a GroupInitKey
GroupInitKey for the group. for the group.
struct { struct {
DHPublicKey add_path<1..2^16-1>; DirectPath add_path;
} UserAdd; } UserAdd;
A new participant generates this message using the following steps: A new participant generates this message using the following steps:
o Fetch a GroupInitKey for the group o Fetch a GroupInitKey for the group
o Use the frontiers in the GroupInitKey to add its keys to the trees o Use the frontiers in the GroupInitKey to add its keys to the trees
o Compute the direct path from the new participant's leaf in the new o Compute the direct path from the new participant's leaf in the new
ratchet tree (the add_path). ratchet tree (the add_path).
An existing participant receiving a UserAdd first verifies the An existing participant receiving a UserAdd first verifies the
signature on the message, then verifies its identity inclusion proof signature on the message, then verifies its identity inclusion proof
against the updated identity tree expressed in the GroupInitKey of against the updated identity tree expressed in the GroupInitKey of
the Handshake message (since the signer is not included in the prior the Handshake message (since the signer is not included in the prior
group state held by the existing participant). The participant then group state held by the existing participant). The participant then
updates its state as follows: updates its state as follows:
o Update trees with the descriptions in the new GroupInitKey o Update trees with the descriptions in the new GroupInitKey
o Update the local ratchet tree with the add path in the UserAdd o Update the local ratchet tree with the information in the UserAdd
message, replacing any common nodes with the values in the add message, replacing any common nodes with the values in the add
path path
The update secret resulting from this change is the output of a DH The update secret resulting from this change is the output of a DH
computation between the private key for the root of the ratchet tree computation between the private key for the root of the ratchet tree
and the add public key from the previous epoch. and the add public key from the previous epoch.
8.4. Update 8.4. Update
An Update message is sent by a group participant to update its leaf An Update message is sent by a group participant to update its leaf
key pair. This operation provides post-compromise security with key pair. This operation provides post-compromise security with
regard to the participant's prior leaf private key. regard to the participant's prior leaf private key.
struct { struct {
DHPublicKey ratchetPath<1..2^16-1>; DirectPath update_path;
} Update; } Update;
The sender of an Update message creates it in the following way: The sender of an Update message creates it in the following way:
o Generate a fresh leaf key pair o Generate a fresh leaf key pair
o Compute its direct path in the current ratchet tree o Compute its direct path in the current ratchet tree
An existing participant receiving a Update message first verifies the An existing participant receiving a Update message first verifies the
signature on the message, then verifies its identity proof against signature on the message, then verifies its identity proof against
the identity tree held by the participant. The participant then the identity tree held by the participant. The participant then
updates its state as follows: updates its state as follows:
o Update the cached ratchet tree by replacing nodes in the direct o Update the cached ratchet tree by replacing nodes in the direct
path from the updated leaf with the corresponding nodes in the path from the updated leaf using the information contained in the
Update message Update message
The update secret resulting from this change is the secret for the The update secret resulting from this change is the secret for the
root node of the ratchet tree. root node of the ratchet tree.
8.5. Delete 8.5. Remove
A delete message is sent by a group member to remove one or more A Remove message is sent by a group member to remove one or more
participants from the group. participants from the group.
struct { struct {
uint32 deleted; uint32 deleted;
DHPublicKey path<1..2^16-1>; DirectPath path;
} Delete; } Remove;
The sender of a Delete message must know the deleted node's copath. The sender of a Remove message generates it as as follows:
Based on this knowledge, it computes a Delete message as follows:
o Generate a fresh leaf key pair o Generate a fresh leaf key pair
o Compute the direct path from the deleted node's index with the o Compute its direct path in the current ratchet tree, starting from
fresh leaf key pair in the current ratchet tree the deleted leaf (Note: In ART, this requires knowing the deleted
node's copath)
An existing participant receiving a Update message first verifies the An existing participant receiving a Delete message first verifies the
signature on the message, then verifies its identity proof against signature on the message, then verifies its identity proof against
the identity tree held by the participant. The participant then the identity tree held by the participant. The participant then
updates its state as follows: updates its state as follows:
o Update the cached ratchet tree by replacing nodes in the direct o Update the cached ratchet tree by replacing nodes in the direct
path from the deleted leaf with the corresponding nodes in the path from the deleted leaf using the information in the Delete
Update message message
o Update the cached ratchet tree and identity tree by replacing the o Update the cached ratchet tree and identity tree by replacing the
deleted node's leaves with blank nodes deleted node's leaves with blank nodes
The update secret resulting from this change is the secret for the The update secret resulting from this change is the secret for the
root node of the ratchet tree after both updates. root node of the ratchet tree after both updates.
9. Sequencing of State Changes 9. Sequencing of State Changes
[[ OPEN ISSUE: This section has an initial set of considerations [[ OPEN ISSUE: This section has an initial set of considerations
skipping to change at page 25, line 43 skipping to change at page 30, line 19
based on the same state. based on the same state.
When this happens, there is a need for the members of the group to When this happens, there is a need for the members of the group to
deconflict the simultaneous handshake messages. There are two deconflict the simultaneous handshake messages. There are two
general approaches: general approaches:
o Have the delivery service enforce a total order o Have the delivery service enforce a total order
o Have a signal in the message that clients can use to break ties o Have a signal in the message that clients can use to break ties
In either case, there is a risk of starvation. In a sufficiently In ART, in either case, there is a risk of starvation. In a
busy group, a given member may never be able to send a handshake sufficiently busy group, a given member may never be able to send a
message, because he always loses to other members. The degree to handshake message, because he always loses to other members. The
which this is a practical problem will depend on the dynamics of the degree to which this is a practical problem will depend on the
application. dynamics of the application.
In TreeKEM, because of the non-contributivity of intermediate nodes
update messages can be applied one after the other without the
Delivery Service having to reject any handshake message which makes
TreeKEM more resilient regarding the concurrency of handshake
messages. The Messaging system can decide to choose the order for
applying the state changes. Note that there are certain cases (if no
total ordering is applied by the Delivery Service) where the ordering
is important for security, ie. all updates must be executed before
deletes.
Regardless of how messages are kept in sequence, implementations MUST Regardless of how messages are kept in sequence, implementations MUST
only update their cryptographic state when valid handshake messages only update their cryptographic state when valid handshake messages
are received. Generation of handshake messages MUST be stateless, are received. Generation of handshake messages MUST be stateless,
since the endpoint cannot know at that time whether the change since the endpoint cannot know at that time whether the change
implied by the handshake message will succeed or not. implied by the handshake message will succeed or not.
9.1. Server-side enforced ordering 9.1. Server-Enforced Ordering
With this approach, the delivery service ensures that incoming With this approach, the delivery service ensures that incoming
messages are added to an ordered queue and outgoing messages are messages are added to an ordered queue and outgoing messages are
dispatched in the same order. The server is trusted to resolve dispatched in the same order. The server is trusted to resolve
conflicts during race-conditions (when two members send a message at conflicts during race-conditions (when two members send a message at
the same time), as the server doesn't have any additional knowledge the same time), as the server doesn't have any additional knowledge
thanks to the confidentiality of the messages. thanks to the confidentiality of the messages.
Messages should have a counter field sent in clear-text that can be Messages should have a counter field sent in clear-text that can be
checked by the server and used for tie-breaking. The counter starts checked by the server and used for tie-breaking. The counter starts
at 0 and is incremented for every new incoming message. If two group at 0 and is incremented for every new incoming message. In ART, if
members send a message with the same counter, the first message to two group members send a message with the same counter, the first
arrive will be accepted by the server and the second one will be message to arrive will be accepted by the server and the second one
rejected. The rejected message needs to be sent again with the will be rejected. The rejected message needs to be sent again with
correct counter number. the correct counter number. In TreeKEM, the message does not
necessarily need to be resent.
To prevent counter manipulation by the server, the counter's To prevent counter manipulation by the server, the counter's
integrity can be ensured by including the counter in a signed message integrity can be ensured by including the counter in a signed message
envelope. envelope.
This applies to all messages, not only state changing messages. This applies to all messages, not only state changing messages.
9.2. Client-side enforced ordering 9.2. Client-Enforced Ordering
Order enforcement can be implemented on the client as well, one way Order enforcement can be implemented on the client as well, one way
to achieve it is to use a two step update protocol: the first client to achieve it is to use a two step update protocol: the first client
sends a proposal to update and the proposal is accepted when it gets sends a proposal to update and the proposal is accepted when it gets
50%+ approval from the rest of the group, then it sends the approved 50%+ approval from the rest of the group, then it sends the approved
update. Clients which didn't get their proposal accepted, will wait update. Clients which didn't get their proposal accepted, will wait
for the winner to send their update before retrying new proposals. for the winner to send their update before retrying new proposals.
While this seems safer as it doesn't rely on the server, it is more While this seems safer as it doesn't rely on the server, it is more
complex and harder to implement. It also could cause starvation for complex and harder to implement. It also could cause starvation for
some clients if they keep failing to get their proposal accepted. some clients if they keep failing to get their proposal accepted.
[[OPEN ISSUE: Another possibility here is batching + deterministic 9.3. Merging Updates
selection.]]
When TreeKEM is in use, it is possible to partly address the problem
of concurrent changes by having the recipients of the changes merge
them, rather than having the senders retry. Because the value of
intermediate node is determined by its last updated child (as opposed
to both its children in ART), TreeKEM updates can be merged by
recipients as long as the recipients agree on an order - the only
question is which node was last updated.
Recall that the processing of a TreeKEM update proceeds in two steps:
1. Compute updated secret values by hashing up the tree
2. Update the tree with the new secret and public values
To merge an ordered list of updates, a recipient simply performs
these updates in the specified order.
For example, suppose we have a tree in the following configuration:
H(H(D))
/ \
H(B) H(D)
/ \ / \
A B C D
Now suppose B and C simultaneously decide to update to X and Y,
respectively. They will send out updates of the following form:
Update from B Update from C
============= =============
H(H(X)) H(H(Y))
/ \
H(X) H(Y)
\ /
X Y
Assuming that the ordering agreed by the group says that B's update
should be processed before C's, the other participants in the group
will overwrite the root value for B with the root value from C, and
all arrive at the following state:
H(H(Y))
/ \
H(X) H(Y)
/ \ / \
A X Y D
10. Message Protection 10. Message Protection
[[ OPEN ISSUE: This section has initial considerations about message [[ OPEN ISSUE: This section has initial considerations about message
protection. This issue clearly needs more specific recommendations, protection. This issue clearly needs more specific recommendations,
possibly a protocol specification in this document or a separate one. possibly a protocol specification in this document or a separate one.
]] ]]
The primary purpose of this protocol is to enable an authenticated The primary purpose of this protocol is to enable an authenticated
group key exchange among participants. In order to protect messages group key exchange among participants. In order to protect messages
sent among those participants, an application will need to specify sent among those participants, an application will need to specify
how messages are protected. how messages are protected.
For every epoch, the root key of the ratcheting tree can be used to For every epoch, the root key of the ratcheting tree can be used to
derive key material for symmetric operations such as encryption/AEAD derive key material for symmetric operations such as encryption/AEAD
and MAC; AEAD or MAC MUST be used to ensure that the message and MAC; AEAD or MAC MUST be used to ensure that the message
originated from a member of the group. originated from a member of the group.
skipping to change at page 30, line 11 skipping to change at page 35, line 49
o Thyla van der Merwe o Thyla van der Merwe
Royal Holloway, University of London Royal Holloway, University of London
thyla.van.der@merwe.tech thyla.van.der@merwe.tech
14. References 14. References
14.1. Normative References 14.1. Normative References
[I-D.ietf-tls-tls13] [I-D.ietf-tls-tls13]
Rescorla, E., "The Transport Layer Security (TLS) Protocol Rescorla, E., "The Transport Layer Security (TLS) Protocol
Version 1.3", draft-ietf-tls-tls13-23 (work in progress), Version 1.3", draft-ietf-tls-tls13-28 (work in progress),
January 2018. March 2018.
[IEEE1363] [IEEE1363]
"IEEE Standard Specifications for Password-Based Public- "IEEE Standard Specifications for Password-Based Public-
Key Cryptographic Techniques", IEEE standard, Key Cryptographic Techniques", IEEE standard,
DOI 10.1109/ieeestd.2009.4773330, n.d.. DOI 10.1109/ieeestd.2009.4773330, n.d..
[RFC2119] Bradner, S., "Key words for use in RFCs to Indicate [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate
Requirement Levels", BCP 14, RFC 2119, Requirement Levels", BCP 14, RFC 2119,
DOI 10.17487/RFC2119, March 1997, DOI 10.17487/RFC2119, March 1997,
<https://www.rfc-editor.org/info/rfc2119>. <https://www.rfc-editor.org/info/rfc2119>.
[RFC5116] McGrew, D., "An Interface and Algorithms for Authenticated
Encryption", RFC 5116, DOI 10.17487/RFC5116, January 2008,
<https://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,
<https://www.rfc-editor.org/info/rfc5869>. <https://www.rfc-editor.org/info/rfc5869>.
[RFC7748] Langley, A., Hamburg, M., and S. Turner, "Elliptic Curves [RFC7748] Langley, A., Hamburg, M., and S. Turner, "Elliptic Curves
for Security", RFC 7748, DOI 10.17487/RFC7748, January for Security", RFC 7748, DOI 10.17487/RFC7748, January
2016, <https://www.rfc-editor.org/info/rfc7748>. 2016, <https://www.rfc-editor.org/info/rfc7748>.
[X962] ANSI, "Public Key Cryptography For The Financial Services [X962] ANSI, "Public Key Cryptography For The Financial Services
skipping to change at page 31, line 15 skipping to change at page 37, line 8
[doubleratchet] [doubleratchet]
Cohn-Gordon, K., Cremers, C., Dowling, B., Garratt, L., Cohn-Gordon, K., Cremers, C., Dowling, B., Garratt, L.,
and D. Stebila, "A Formal Security Analysis of the Signal and D. Stebila, "A Formal Security Analysis of the Signal
Messaging Protocol", 2017 IEEE European Symposium on Messaging Protocol", 2017 IEEE European Symposium on
Security and Privacy (EuroS&P), Security and Privacy (EuroS&P),
DOI 10.1109/eurosp.2017.27, April 2017. DOI 10.1109/eurosp.2017.27, April 2017.
[I-D.ietf-trans-rfc6962-bis] [I-D.ietf-trans-rfc6962-bis]
Laurie, B., Langley, A., Kasper, E., Messeri, E., and R. Laurie, B., Langley, A., Kasper, E., Messeri, E., and R.
Stradling, "Certificate Transparency Version 2.0", draft- Stradling, "Certificate Transparency Version 2.0", draft-
ietf-trans-rfc6962-bis-27 (work in progress), October ietf-trans-rfc6962-bis-28 (work in progress), March 2018.
2017.
[keyagreement] [keyagreement]
Barker, E., Chen, L., Roginsky, A., and M. Smid, Barker, E., Chen, L., Roginsky, A., and M. Smid,
"Recommendation for Pair-Wise Key Establishment Schemes "Recommendation for Pair-Wise Key Establishment Schemes
Using Discrete Logarithm Cryptography", National Institute Using Discrete Logarithm Cryptography", National Institute
of Standards and Technology report, of Standards and Technology report,
DOI 10.6028/nist.sp.800-56ar2, May 2013. DOI 10.6028/nist.sp.800-56ar2, May 2013.
[signal] (ed), T. and M. Marlinspike, "The Double Ratchet [signal] Perrin(ed), T. and M. Marlinspike, "The Double Ratchet
Algorithm", n.d., Algorithm", n.d.,
<https://www.signal.org/docs/specifications/ <https://www.signal.org/docs/specifications/
doubleratchet/>. doubleratchet/>.
Authors' Addresses Authors' Addresses
Richard Barnes Richard Barnes
Cisco Cisco
Email: rlb@ipv.sx Email: rlb@ipv.sx
 End of changes. 70 change blocks. 
148 lines changed or deleted 445 lines changed or added

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