Re: [MLS] TreeKEM: An alternative to ART

Karthikeyan Bhargavan <karthik.bhargavan@gmail.com> Tue, 08 May 2018 11:35 UTC

Return-Path: <karthik.bhargavan@gmail.com>
X-Original-To: mls@ietfa.amsl.com
Delivered-To: mls@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 507EA12DA14 for <mls@ietfa.amsl.com>; Tue, 8 May 2018 04:35:35 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.998
X-Spam-Level:
X-Spam-Status: No, score=-1.998 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 2Spvh1kZ1Jee for <mls@ietfa.amsl.com>; Tue, 8 May 2018 04:35:31 -0700 (PDT)
Received: from mail-wm0-x230.google.com (mail-wm0-x230.google.com [IPv6:2a00:1450:400c:c09::230]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id A033212DA02 for <mls@ietf.org>; Tue, 8 May 2018 04:35:30 -0700 (PDT)
Received: by mail-wm0-x230.google.com with SMTP id o78-v6so20966302wmg.0 for <mls@ietf.org>; Tue, 08 May 2018 04:35:30 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:message-id:mime-version:subject:date:in-reply-to:cc:to :references; bh=tSXxJxA0jTUhjUE/W/d2wqhrV1BPTuA+6/uHF38JX7Y=; b=YDT/lYhSuaPJU+dTJP4Lq80NB2kE8MKgSWtbg2V5ssm6MEw3dUX4NGrSdovZ6gofMW UV9RmsxornPvEsFpAR6++2gdr/IVuBhnHlC8RpnWQOeKv6Xri1GFUI5WEzwTgmKeiRih pkna+r98l5byGgRWJ3GPljkCpdtkmuArC6wfjQJY5cfah6v2yAlVCVzcp0nf6lBmB0Er VKzs0YcexnfpVdsnS7uNns3rjZnGzjn0Rbl782PhSZHHCJEK9O7PsvxTL7kCLK4c6Mns 564fh5eywOiiFjINxIZQN1nAhBeOl/mCE5V9ZWjixflTNNQgXVUlLh/P2CjkMx8zjC/k o6Hw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:message-id:mime-version:subject:date :in-reply-to:cc:to:references; bh=tSXxJxA0jTUhjUE/W/d2wqhrV1BPTuA+6/uHF38JX7Y=; b=EZBlktcmMqS2RyzHSkavkXADv6YuTnwWdGdQ/6JPvlTmLWdJOC3Nb7rlo8NRoL9w9Q iMf3lDVPyTHx/BuGg5QfaFjPW5grMI9sSXpo7238RQAQtOiq98JjQLyBieNjZUOWYy5E +YWmjPi3BjLo9asymu1V2kNeYfFT5plxUovwdVyYGNp40gJBWRe01pTi0EPhoC33eGQA wrv/9rheyKK/PgnOShhvFyzqp7nE0iGbkCRvw7WAZYTHvhI642AKlpyBgzmELK79dQNU rw+a3gSg8nBexYj6toCrWag70RwO54h3m0W308uNHD0Tdiinf2X0uy4b2uXmFzj42I1K fAJw==
X-Gm-Message-State: ALQs6tDOfm6QmLi0N2WqFgSDBSEY2xVc8ssyHVx2Gw0Hp4XAbLBNOxeR 2N1HzyLHeMnfSg2HWgeZHh0=
X-Google-Smtp-Source: AB8JxZp++K0VJdOm/z08X9tHTlWGxwdaWUdOTRQr1QRggEQqr/p5NL19w5a8Fu3knFBdA1mEcmwCYA==
X-Received: by 2002:a1c:a750:: with SMTP id q77-v6mr3013412wme.111.1525779328875; Tue, 08 May 2018 04:35:28 -0700 (PDT)
Received: from [192.168.0.51] (ip-16.net-89-3-97.rev.numericable.fr. [89.3.97.16]) by smtp.gmail.com with ESMTPSA id h12sm8582450wmc.7.2018.05.08.04.35.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 08 May 2018 04:35:28 -0700 (PDT)
From: Karthikeyan Bhargavan <karthik.bhargavan@gmail.com>
Message-Id: <5C6CD0C4-8982-450E-BBA1-E276CD673345@gmail.com>
Content-Type: multipart/alternative; boundary="Apple-Mail=_F10C218B-D10D-45BD-8962-57405BFDEDA2"
Mime-Version: 1.0 (Mac OS X Mail 11.2 \(3445.5.20\))
Date: Tue, 08 May 2018 13:35:26 +0200
In-Reply-To: <CABdrxL6RnM29wnK+_CaHtuwBH3dB0R+8b9vMHLKfqLZT-90HQA@mail.gmail.com>
Cc: Katriel Cohn-Gordon <me@katriel.co.uk>, mls@ietf.org
To: Cas Cremers <cas.cremers@cs.ox.ac.uk>
References: <CABcZeBOGJTYTGqYLhqafM=yE9hCZP06KbjKfBqMVTr=yoUYUrw@mail.gmail.com> <CABcZeBOTTe=8mw3q7FXNLWD7pe=XTuKj3P3C1=-GXHZSFQybzw@mail.gmail.com> <CAL02cgRn6wHMDoCL+UCaHtD8GV30=+aSrvCY+Jf64tKtqkfV2Q@mail.gmail.com> <1525379746.825004.1360053824.4E4ADFCA@webmail.messagingengine.com> <88F8850B-8321-49A2-844F-5685FBBCB817@gmail.com> <CABdrxL6RnM29wnK+_CaHtuwBH3dB0R+8b9vMHLKfqLZT-90HQA@mail.gmail.com>
X-Mailer: Apple Mail (2.3445.5.20)
Archived-At: <https://mailarchive.ietf.org/arch/msg/mls/Ecnj_HIpNQOOroRjbI0NJT1Nw-4>
Subject: Re: [MLS] TreeKEM: An alternative to ART
X-BeenThere: mls@ietf.org
X-Mailman-Version: 2.1.22
Precedence: list
List-Id: Messaging Layer Security <mls.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/mls>, <mailto:mls-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/mls/>
List-Post: <mailto:mls@ietf.org>
List-Help: <mailto:mls-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/mls>, <mailto:mls-request@ietf.org?subject=subscribe>
X-List-Received-Date: Tue, 08 May 2018 11:35:35 -0000

Hello Cas,

It would be great to tease out the differences, especially with regards to implicit threats and goals that we’ve not yet made explicit in MLS.

Broken randomness is a good example. Do we wish to resist bad randomness at the group creator, for example?
If we can trust the creator to have access to a fresh key K, which it then uses to derive the initial leaf keys for the tree, 
we would then be resistant to bad randomness at all other devices, yes?

Best,
Karthik


> On 8 May 2018, at 12:27, Cas Cremers <cas.cremers@cs.ox.ac.uk> wrote:
> 
> Hi all,
> 
> I like the clean design of TreeKEM a lot, but I think there are plenty of subtle differences in terms of the security guarantees.
> 
> One thing that came to mind: If ART is instantiated with a stronger AKE (HMQV style or NAXOS-like) then you get some protection against bad randomness from the setup, by integrating the long-term keys into the derived key. Currently, TreeKEM keys don't seem to depend at  all on the long-term keys. I think one can also achieve some form of protection against this for TreeKEM by something like we proposed in https://tools.ietf.org/html/draft-cremers-cfrg-randomness-improvements-00 <https://tools.ietf.org/html/draft-cremers-cfrg-randomness-improvements-00>, but my gut feeling is that even that is not quite the same as ART with HMQV in terms of guarantees. Introducing something equivalent in TreeKEM seems cumbersome. We'll need to think this one through in a bit more detail.
> 
> Best,
> 
> Cas
> 
> 
> On Mon, May 7, 2018 at 6:40 AM Karthikeyan Bhargavan <karthik.bhargavan@gmail.com <mailto:karthik.bhargavan@gmail.com>> wrote:
> Hi Katriel,
> 
>> If that's correct, it might be a good separation to make in the design/analysis, and perhaps even a good idea to separate out the fresh value that gets hashed into the master secret chain from the keys used in the tree. (I am a little worried about attacks whereby an adversary manages to receive and decrypt say h^2(k), and then derive h^5(k) and hash it into the master secret to break PCS. Having agents generate one set of keys for the tree and another key for the master chain might help a compositional proof.)
> 
> This is an interesting idea, and I don’t see why this cannot be done, especially if it helps with analysis.
> Yes, it does mean we need to send one extra key encrypted to each recipient: this doubles the computation and message size.
> But there may be other benefits to separately sending master secret key, which is to provide a proof of consistency for the updates.
> (This is hinted at in the end of the document; we’ll try to flesh this out better.)
> 
> Best,
> Karthik
> 
>> 
>> 
>> 
>> One other minor nit: I think TreeKEM, like ART, might need a function mapping bitstrings to KEM keypairs. This could be the same i as in ART if the encryption is something like ECIES.
>> 
>> best,
>> Katriel
>> 
>> On Thu, 3 May 2018, at 3:36 PM, Richard Barnes wrote:
>>> Just for context: Note that TreeKEM, like ART, is an "inner loop" / "subroutine" for MLS.  It handles the establishment of a key that's confidential to the group members.  There's still a need for more mechanism to provide authentication.
>>> 
>>> Speaking of protocol, in protocol terms, TreeKEM, while we haven't elaborated a precise protocol, if you look at the very basic sketch that's in the repo EKR linked, the protocol looks very similar to what we have for ART now.  Basically, where ART sends public keys, TreeKEM needs to send (public key, PKE ciphertext) pairs.  So there's a bit of additional communications overhead, but not a dramatic reworking of the messages.
>>> 
>>> Having spent some time with this approach, I appreciate that it can be kind of hard to digest; it has a few more moving parts than ART.  I would be happy to set up a call sometime if people wanted to talk this through.
>>> 
>>> --Richard
>>> 
>>> On Thu, May 3, 2018 at 10:33 AM Eric Rescorla <ekr@rtfm.com <mailto:ekr@rtfm.com>> wrote:
>>> Oops. I forgot to attach the paper.
>>> 
>>> 
>>> On Thu, May 3, 2018 at 7:26 AM, Eric Rescorla <ekr@rtfm.com <mailto:ekr@rtfm.com>> wrote:
>>> Hi folks,
>>> 
>>> Several of us (Karthik, Richard, and I) have been working on an
>>> alternative to ART which we call TreeKEM. TreeKEM parallels ART in
>>> many ways, but is more cryptographically efficient and is much better
>>> at handling concurrent changes. The most common behaviors (updating
>>> ones own key) can be executed completely concurrently, merging all the
>>> requested changes.
>>> 
>>> We've attached a draft technical paper describing the details, and
>>> some slides, but here's a brief overview of TreeKEM.
>>> 
>>> Code: https://github.com/bifurcation/treekem <https://github.com/bifurcation/treekem>, https://github.com/bifurcation/treekem <https://github.com/bifurcation/treekem>
>>> Explainer slides: https://docs.google.com/presentation/d/1myiQ22ddxHAcF8uCJBXk9cdJMvAQfAw9nmKiqE5seJc/edit?usp=sharing <https://docs.google.com/presentation/d/1myiQ22ddxHAcF8uCJBXk9cdJMvAQfAw9nmKiqE5seJc/edit?usp=sharing>
>>> 
>>> As with ART, TreeKEM addresses the scaling problem by arranging nodes
>>> in a binary tree. In the steady state, each node i has a key pair but
>>> instead of having two siblings do DH to determine their shared key, we
>>> derive the shared key by hashing the key of the last node to update.
>>> As before, each node knows all the keys to its parents.
>>> 
>>> Imagine we have the four node tree a, b, c, d which was constructed
>>> in that order. The private keys at each vertex are shown below.
>>> 
>>>        H^2(d)
>>>       /     \
>>>     H(b)    H(d)
>>>     / \     / \
>>>    a   b   c   d
>>> 
>>> 
>>> UPDATES
>>> Now say that b wants to update its key to b', giving us the tree:
>>> 
>>>        H^2(b')
>>>       /     \
>>>     H(b')   H(d)
>>>     / \     / \
>>>    a   b'  c   d
>>> 
>>> This requires providing 
>>> 
>>>   - a with H(b') -- note that a can compute H^2(b') for itself.
>>>   - c and d with H^2(b')
>>> 
>>> Recall that you can encrypt to any subset of the tree by just
>>> encrypting to the appropriate set of parent nodes. So, we can
>>> do this by sending:
>>> 
>>>   - E(pubkey(a), H(b'))
>>>   - E(pubkey(H^2(d)), H^2(b'))
>>> 
>>> Where pubkey(k) gives the public key derived from private key k.
>>> 
>>> As with ART, you then mix the new tree root (H^2(b')) into the current
>>> operational keys and use the result to derive the actual working keys.
>>> 
>>> 
>>> CONCURRENT UPDATES
>>> The big win in TreeKEM is that you can handle an arbitrary number
>>> of concurrent updates, just by applying them in order. Again,
>>> consider our starting tree, but assume that b and c both try to
>>> update at once. a thus receives two updates
>>> 
>>>   - E(pubkey(a), H(b'))       [b's update]
>>>   - E(pubkey(H(b)), H^2(c'))  [c's update]
>>> 
>>> If we apply these in order b, c we get the tree:
>>> 
>>>        H^2(c')
>>>       /     \
>>>     H(b')   H(c')
>>>     / \     / \
>>>    a   b'  c   d
>>> 
>>> a can easily compute this.
>>> 
>>> In order to make this work, we need two things:
>>> 
>>> 1. a needs to keep a copy of its current tree around until it has
>>>    received all updates based on that tree
>>> 2. there needs to be an unambiguous ordering of updates
>>> 
>>> The way to handle (1) is probably to have some defined "window"
>>> of time during which an update can be received. The node needs
>>> to hold onto its old key until that window has passed. (2) can
>>> be handled by having the messaging system provide a consistent
>>> order and then agreeing to apply updates consecutively. If we
>>> want to concurrently apply other changes, we may need to sort
>>> based on change type within the window.
>>> 
>>> 
>>> ADDS
>>> In order to add itself to the group (USERADD), a node merely puts
>>> itself at the right position in the tree and, generates a random key,
>>> and then sends the appropriate keying material to everyone in its path
>>> to the root.
>>> 
>>> In order to add another node to the group (GROUPADD), the adding
>>> node does exactly the same thing as with a USERADD, but also sends
>>> a copy of the new key to the node being added.. Note that this creates
>>> a double-join, which we will cover later.
>>> 
>>> 
>>> REMOVAL
>>> In order to remove another node from the tree, the removing node
>>> sends the same message that the evicted node would have sent if
>>> it had sent an update, but with a new key not known to the evicted
>>> node (note that this naturally omits the evicted node, because you
>>> encrypt to the co-path). This also creates a double-join, where the
>>> removing node knows the dummy key.
>>> 
>>> 
>>> 
>>> STATE
>>> In order to receive messages, a node need only keep its secret keys,
>>> which range between 1 key (if it was the last to update) and log(N)
>>> keys (in the worst case).
>>> 
>>> In the best case, in order to update, a node needs to also know
>>> the public keys for everyone on its co-path. However.
>>> 
>>> In order to be able to do deletes, a node also needs to be able
>>> to get the public key for any node in the tree (leaf or internal).
>>> It's easy to see this by realizing that to delete a node you need
>>> to encrypt a new key to its sibling, and so to delete any node,
>>> you need to be able to access every node's public key. However,
>>> a node need not store this information, but can retrieve it
>>> on demand when it needs to delete another node.
>>> 
>>> 
>>> EFFICIENCY
>>> The paper contains more details. but generally TreeKEM is somewhat
>>> more efficient in terms of asymmetric crypto operations than ART.
>>> 
>>> 
>>> DOUBLE JOINS
>>> Like ART, TreeKEM has double-join problems whenever one group member
>>> provides a service (or a disservice, in the case of remove) for another
>>> group member. In the case of GROUPADD, the double join will resolve itself
>>> as soon as the added node updates its key. However in the case of
>>> REMOVE, this cannot happen, and so double join needs to be
>>> dealt with in some other way.
>>> 
>>> One option is to have selective updates: each node keeps track of
>>> extra tree state and uses it to control its updates. For instance,
>>> if we never send updates to deleted nodes, than as soon as a deleted
>>> node's sibling sends an update, the double-join will be resolved.
>>> In a more sophisticated -- but also more expensive to implement --
>>> version, we track which nodes control the keys of other nodes and
>>> REMOVE all affected nodes when we do a delete.
>>> -Ekr
>>> 
>>> _______________________________________________
>>> MLS mailing list
>>> MLS@ietf.org <mailto:MLS@ietf.org>
>>> https://www.ietf.org/mailman/listinfo/mls <https://www.ietf.org/mailman/listinfo/mls>
>> 
>> _______________________________________________
>> MLS mailing list
>> MLS@ietf.org <mailto:MLS@ietf.org>
>> https://www.ietf.org/mailman/listinfo/mls <https://www.ietf.org/mailman/listinfo/mls>
> _______________________________________________
> MLS mailing list
> MLS@ietf.org <mailto:MLS@ietf.org>
> https://www.ietf.org/mailman/listinfo/mls <https://www.ietf.org/mailman/listinfo/mls>