Re: [MLS] Masking sender data

Brendan McMillion <brendan@cloudflare.com> Tue, 28 July 2020 18:24 UTC

Return-Path: <brendan@cloudflare.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 1B13F3A0AE5 for <mls@ietfa.amsl.com>; Tue, 28 Jul 2020 11:24:15 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.099
X-Spam-Level:
X-Spam-Status: No, score=-2.099 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, HTML_MESSAGE=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=cloudflare.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 5oXsz2wH_GTx for <mls@ietfa.amsl.com>; Tue, 28 Jul 2020 11:24:13 -0700 (PDT)
Received: from mail-qk1-x72f.google.com (mail-qk1-x72f.google.com [IPv6:2607:f8b0:4864:20::72f]) (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 096B93A0B0A for <mls@ietf.org>; Tue, 28 Jul 2020 11:24:12 -0700 (PDT)
Received: by mail-qk1-x72f.google.com with SMTP id g26so19657655qka.3 for <mls@ietf.org>; Tue, 28 Jul 2020 11:24:12 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cloudflare.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=ZI7OclXDrq/9a71xihMCKDhSnMSQSY+FlTMkTruwUBA=; b=vd5f66uBfcqOLPr3fBWXEVDXXKk7hSUrfQZgxueXBDMP93BXQiqsQGTEu7ZdZbTW2f ngOuO449xAq0xqo60DOA2CTfeNa30NAjdYTjAt4CB7kXDEoJOax72g6gnsQA8U3mCLUC clXIywDvpes3YdGQGEUJatxS14Fw7S25+4bck=
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; bh=ZI7OclXDrq/9a71xihMCKDhSnMSQSY+FlTMkTruwUBA=; b=GxqpDwp+BcXt638hDR/iBgXok3JnsYc4Te1V0napb9gnGJkgKKo1/HbW3zYJUvyPMy 9ODlxqgDZK6b1Z150r0igt1LKGhyEpqjxaDU8QISyzOnlhuYNrklTfQwT453uzguRpvl bYqFWoSLzDtQMC/8ZMtfVCm4+yME/eaPm63EQaPI4yLi44vCBrvbguZ+Vpkzd4opJdRm QraYu0R0dmF5ZlfYQRkoXgDdiY9LogmG3FDZLTcYH8NV9WsscTH5YsCV+HDlyNkh5Q3D 8pxVn1L7ducuUzkRWJnFLrd9gBKsiTNSFWzgNk1PMYsh/sDXWr4JiDx8j0zet2NfJEvB 23UQ==
X-Gm-Message-State: AOAM531XB0cqP9CArHrV9/EP+cuFL5fh+sEzvqMgktw+mpeLtT1yO+tv /97W44vz5ZqYBBmX8nE03046WSErPqvgB9YESdWP8/l4DfY=
X-Google-Smtp-Source: ABdhPJwdw3l8ScawE0d7FpuwHSqtO2memEnosNe1cSGHeD26uCyerHRFWSGBKaALDqH64dfWsj/4oihtSJKcpMhZ/RY=
X-Received: by 2002:a05:620a:cd6:: with SMTP id b22mr28189684qkj.443.1595960651863; Tue, 28 Jul 2020 11:24:11 -0700 (PDT)
MIME-Version: 1.0
References: <CABP-pSRhWrhTYEp0CXpoGVYyJ-wH0vddykZkA4a5fBKTUmw18Q@mail.gmail.com> <CAL02cgSUuphYZSY74KbNWJ_nT+Z+Gt80Zm_+6gYYhYC76vA4YA@mail.gmail.com>
In-Reply-To: <CAL02cgSUuphYZSY74KbNWJ_nT+Z+Gt80Zm_+6gYYhYC76vA4YA@mail.gmail.com>
From: Brendan McMillion <brendan@cloudflare.com>
Date: Tue, 28 Jul 2020 11:24:00 -0700
Message-ID: <CABP-pSQMHq1fLHwngph-8ch9b0biDC+ydVK7_OU=w_jXRGVkMQ@mail.gmail.com>
To: Richard Barnes <rlb@ipv.sx>
Cc: Messaging Layer Security WG <mls@ietf.org>
Content-Type: multipart/alternative; boundary="000000000000bb085505ab848bae"
Archived-At: <https://mailarchive.ietf.org/arch/msg/mls/Lh0Y-wcdPDoBg2j9OKO41VdiWo0>
Subject: Re: [MLS] Masking sender data
X-BeenThere: mls@ietf.org
X-Mailman-Version: 2.1.29
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, 28 Jul 2020 18:24:15 -0000

This PR was discussed at IETF 108 this morning, and the one issue that came
up is whether or not we should really truncate the auth tag from the
ciphertext.

Personally I see no problem with it, as everything in MLSCiphertext is
still authenticated. And with the auth tag truncated, performance-sensitive
applications can optimize away the "second pass" on the ciphertext by using
AES-CTR (or the corresponding unauthenticated cipher mode for their AEAD).
Implementations that don't mind the second pass also have good options, for
example: the same operation used to encrypt (AEAD encrypt and truncate auth
tag), when applied to the ciphertext, returns the plaintext. So the same
code does encryption and decryption.

I'm curious to hear how others feel

On Mon, Jul 20, 2020 at 1:02 PM Richard Barnes <rlb@ipv.sx> wrote:

> Hi Brendan,
>
> Thanks a lot for writing this up!  I agree that this addresses the
> authenticity concerns that had been raised on earlier iterations of this
> problem.  I've suggested a few corrections and simplifications in the PR.
>
> https://github.com/mlswg/mls-protocol/pull/360#discussion_r457656760
>
> Either way (what you suggested or with my edits), it's clear that there's
> some non-trivial complexity involved here.  Both in terms of getting the
> operations in the right order (content encryption, then sender data
> encryption, and reverse for decryption), and in terms of constructing all
> the different AAD values.  So I wonder how people feel about that taking
> that compexity cost in the interest of removing an explicit nonce.
> Personally, I'm probably still inclined to do it, since explicit nonces
> make me nervous, but I would like to hear what other folks think.
>
> --Richard
>
> On Thu, Jul 16, 2020 at 12:31 PM Brendan McMillion <brendan=
> 40cloudflare.com@dmarc.ietf.org> wrote:
>
>> Hello mls@
>>
>> There's been an open ticket [1] on MLS for a while now to explore masking
>> sender data instead of encrypting it with an AEAD. I opened a PR [2] with
>> an initial attempt to achieve this, which I wanted to now introduce to the
>> list.
>>
>> The first major change is to encrypt the first block of `ciphertext`
>> under a derived key with AES-ECB, and XOR the encoded SenderData with that
>> value. The masked sender data replaces the `encrypted_sender_data` and
>> obsoletes `sender_data_nonce`. The PR also specifies that the auth tag
>> should be truncated from the `ciphertext` because the full MLSCiphertext is
>> now authenticated with a MAC under a shared key, and this MAC is stored on
>> its own in an `auth_tag` field on MLSCiphertext.
>>
>> The process of masking the sender data is designed to match the
>> construction HN1 in [3]. The reason for messing around with the MAC
>> structure, is that it allows us to validate the integrity of the sender
>> data before we use it to generate sender-specific keys, while still only
>> have one MAC total.
>>
>> One of the downsides to this proposal is that it requires two passes over
>> the ciphertext, since we'd now encrypt and authenticate in separate passes.
>> While I'd like to get rid of this, I don't think it will be a big
>> performance issue for implementations.
>>
>> Feedback welcomed!
>>
>> 1. https://github.com/mlswg/mls-protocol/issues/302
>> 2. https://github.com/mlswg/mls-protocol/pull/360
>> 3. https://eprint.iacr.org/2019/624.pdf
>> _______________________________________________
>> MLS mailing list
>> MLS@ietf.org
>> https://www.ietf.org/mailman/listinfo/mls
>>
>