Re: [MLS] Message Protection
Martin Thomson <martin.thomson@gmail.com> Fri, 29 June 2018 06:36 UTC
Return-Path: <martin.thomson@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 C73B3130DC4 for <mls@ietfa.amsl.com>; Thu, 28 Jun 2018 23:36:46 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2
X-Spam-Level:
X-Spam-Status: No, score=-2 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, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-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 QZk4QozzE9UF for <mls@ietfa.amsl.com>; Thu, 28 Jun 2018 23:36:44 -0700 (PDT)
Received: from mail-ot0-x244.google.com (mail-ot0-x244.google.com [IPv6:2607:f8b0:4003:c0f::244]) (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 58B09130E06 for <mls@ietf.org>; Thu, 28 Jun 2018 23:36:44 -0700 (PDT)
Received: by mail-ot0-x244.google.com with SMTP id n24-v6so8818220otl.9 for <mls@ietf.org>; Thu, 28 Jun 2018 23:36:44 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=MCoN/mc97/HRnPnIQVshKZ+/l/gKdXk8wscqJFTpyb4=; b=KbU1X/tRvMvYu8EVbny7tx3hduPEQnp+x+Rar1xmY7hzVrEyKI4x3/6TzjkYqHynKl uz23y8g4YuIldmtAq5O792e3TjQsnJD79SO2RIP2HRQgHgHPUyL1WC9PeIuUnY2+f9M1 qqj8MXvAzUNNr5Pda8kjEBTSQ2+0Anwi5ajqJJHu0i0kwXfqdsR79XljJAz/joq2eMWU /5jiDsk8eyfk2bXtS+s/rZ3g080rnjtWQIJqz/WA8wYAeWRkTBi0aNwwGHCILBcpf0T/ wHleDSj1p4IVyD/mJttDQ8k5k6G1KgSWkSlqHS+wlREEMPnK3f/+UUNQe0xHc8o9dVV5 IV4A==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=MCoN/mc97/HRnPnIQVshKZ+/l/gKdXk8wscqJFTpyb4=; b=tpykHICiIxhOI/px8s+B7kKXleudX1XZs1xuPT/2PjSJ4vykKm5DLYF+2/sDgxqbW4 iSvfv6x5A5J8o86V0FjkvRp3NFJ4GRorycXH8cf1E2/333g3QedcxK6Oi3C+60GyVdqe RHjfl4pyOBfOxqUWOuB8LNm6dMyaTPtJYQpEsgArpxR8VgDG9xfSlrE77GWwuW+VHrNi GZIc7Z+TaJ18KWt7ITbBT5h4YxZG7XUh1vJCNtEhqbpEUIRKsZaetu5YuCDWXxgzwMry qTxKZOfPs+hejfOaWj/yM+yDld12pOoYP8/N0kYCGv6iAnFmlc6xXtb8hkVM5rDVG2zf Xs+A==
X-Gm-Message-State: APt69E0oANU4eeSWgA5JvY3ZjB3HMX3A+5OlMtRPs6g9JJcEgBXewV9Y ULyhkrEL2JTT3RPGs2DxfTIcQrJ2rkBxBm3FFPg=
X-Google-Smtp-Source: AAOMgpe8r5iChAvVyT25/d0T+OUBCEVKJigSl+oIaLdl7kE+PfJFBzC15znvHBcZAR/BvR+xs9FFaNph3xu0+34SR20=
X-Received: by 2002:a9d:3666:: with SMTP id w93-v6mr7502121otb.394.1530254203511; Thu, 28 Jun 2018 23:36:43 -0700 (PDT)
MIME-Version: 1.0
References: <CAL02cgREuhjySYZXmhaE3RuF3fZ5iwCgyW2ChtgwPYhDgdaYUQ@mail.gmail.com> <11392542-5C22-4033-99F6-009F066F48DD@vigilsec.com> <CABkgnnVZMNhrSE0mL7-yehuoR-uE-Kj3zZC9nqRY4zHE2gmVPg@mail.gmail.com> <640CFF9E-5231-4188-888A-CAB4376393F6@vigilsec.com> <1530198719.3129780.1423592624.575CB8EA@webmail.messagingengine.com>
In-Reply-To: <1530198719.3129780.1423592624.575CB8EA@webmail.messagingengine.com>
From: Martin Thomson <martin.thomson@gmail.com>
Date: Fri, 29 Jun 2018 16:36:33 +1000
Message-ID: <CABkgnnV81G0umQ91MFXfd3WhMA6WUJZmjUaL6=KGC4kpC3k8CQ@mail.gmail.com>
To: Katriel Cohn-Gordon <me@katriel.co.uk>
Cc: mls@ietf.org, scratch@virgilsecurity.com
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Archived-At: <https://mailarchive.ietf.org/arch/msg/mls/pSr3fDzgqDHDh1ue1fIvxtGfnzc>
Subject: Re: [MLS] Message Protection
X-BeenThere: mls@ietf.org
X-Mailman-Version: 2.1.26
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: Fri, 29 Jun 2018 06:36:47 -0000
A few comments here (I'd comment on a PR if one existed :) Is "Contant" supposed to be the content of the message, a constant, or something else? Is "Msg" a label in the sense of the label passed to HKDF in TLS 1.3, or the the content of the message? Assuming the former, a 255 octet limit is probably plenty. You probably don't want to use the plaintext of the message for key derivation; then you won't be able to read messages out of order. Your PR-in-progress seems to imply that one use of HKDF is used. It might be best to have three derivations: one for the next key, one for the key, and another for the nonce. You don't seem to include the number of messages from the previous epoch in the counter. Is this just under the AAD? What happens if an endpoint doesn't send any messages in a given epoch? How is the count of messages from the previous epoch protected? (Sorry, too many questions. I'm sure that you'll sort most of these out.) On Fri, Jun 29, 2018 at 1:12 AM Katriel Cohn-Gordon <me@katriel.co.uk> wrote: > > I've been chatting with Alexey at Virgil Security, who has started work on a PR [1] to add this form of key separation. > > I think we all liked this design; shall we figure out exactly how it works? I like the idea of symmetric key chains so that each message has a separate encryption key, as in Signal; that requires N and PN counters in the header to figure out which key to use, which I guess should go into the authenticated data. > > Note that this means that each message key is used once, which helps guard against nonce reuse. > > best, > Katriel > > [1] https://github.com/ekr/mls-protocol/compare/master...Scratch-net:master > > On Thu, 28 Jun 2018, at 3:38 PM, Russ Housley wrote: > > Martin: > > > > Each sender using a separate key seems pretty easy. The key can be > > derived using the sender's position in the key or any other unique > > identifier that comes natural in the messaging protocol. > > > > Russ > > > > > > > On Jun 27, 2018, at 6:12 PM, Martin Thomson <martin.thomson@gmail.com> wrote: > > > > > > I was thinking that the nonce generation aspect would be worth looking > > > into as well. If you crib from the TLS design, maybe you could have > > > per-participant keys so that each can be independently responsible for > > > ensuring nonce-uniqueness. Then they can use counters to avoid nonce > > > reuse if they so choose. Otherwise, I was tempted to suggest AES-SIV > > > or another nonce-reuse-resistant scheme, but there are fewer of those > > > available than straight up AEADs. > > > On Thu, Jun 28, 2018 at 7:36 AM Russ Housley <housley@vigilsec.com> wrote: > > >> > > >> > > >> > > >>> On Jun 26, 2018, at 8:38 PM, Richard Barnes <rlb@ipv.sx> wrote: > > >>> > > >>> Hey all, > > >>> > > >>> One of the things we kind of waved our hands about in the charter and current protocol draft is message protection. That is, the idea of specifying a concrete syntax for using the keys we negotiate using MLS to actually protect content. > > >>> > > >>> This is a simpler problem than key exchange (since you've already established a group key), but it still has some nuances that matter to the overall security story, so it seems worth writing some things down: > > >>> > > >>> - Content encapsulation (e.g., what nonces / AAD you use with AEAD) > > >>> - Key schedule, i.e., how message keys are derived from the group key > > >>> - ACK / NACK / replay > > >>> - Transcript integrity (?) > > >>> - Expiration times (?) > > >>> > > >>> What's missing here? > > >> > > >> If the tree produces a key and an identifier for that key, then the protocol is straightforward. > > >> > > >> The key identifier could be derived from the key itself so that anyone that knows the key also knows the identifier. > > >> > > >> prk = HKDF-Extract('mls-key-id' | tree-identifier, key) > > >> > > >> keyid = HKDF-Expand(prk, '', sizeof(keyid)) > > >> > > >> Russ > > >> > > >> _______________________________________________ > > >> MLS mailing list > > >> MLS@ietf.org > > >> https://www.ietf.org/mailman/listinfo/mls > > > > _______________________________________________ > > MLS mailing list > > MLS@ietf.org > > https://www.ietf.org/mailman/listinfo/mls > > _______________________________________________ > MLS mailing list > MLS@ietf.org > https://www.ietf.org/mailman/listinfo/mls
- [MLS] Message Protection Richard Barnes
- Re: [MLS] Message Protection Benjamin Beurdouche
- Re: [MLS] Message Protection Russ Housley
- Re: [MLS] Message Protection Martin Thomson
- Re: [MLS] Message Protection Richard Barnes
- Re: [MLS] Message Protection Russ Housley
- Re: [MLS] Message Protection Katriel Cohn-Gordon
- Re: [MLS] Message Protection Martin Thomson
- Re: [MLS] Message Protection Alexey Ermishkin
- Re: [MLS] Message Protection Martin Thomson
- Re: [MLS] Message Protection Alexey Ermishkin