Re: [Masque] Encrypting between client and proxy

Ben Schwartz <bemasc@google.com> Wed, 16 November 2022 01:57 UTC

Return-Path: <bemasc@google.com>
X-Original-To: masque@ietfa.amsl.com
Delivered-To: masque@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 7DE9FC14CE2A for <masque@ietfa.amsl.com>; Tue, 15 Nov 2022 17:57:38 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -22.596
X-Spam-Level:
X-Spam-Status: No, score=-22.596 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIMWL_WL_MED=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, ENV_AND_HDR_SPF_MATCH=-0.5, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_HI=-5, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001, URIBL_DBL_BLOCKED_OPENDNS=0.001, URIBL_ZEN_BLOCKED_OPENDNS=0.001, USER_IN_DEF_DKIM_WL=-7.5, USER_IN_DEF_SPF_WL=-7.5] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=google.com
Received: from mail.ietf.org ([50.223.129.194]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id gHzviYeK7CiW for <masque@ietfa.amsl.com>; Tue, 15 Nov 2022 17:57:34 -0800 (PST)
Received: from mail-io1-xd2f.google.com (mail-io1-xd2f.google.com [IPv6:2607:f8b0:4864:20::d2f]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id D5BAAC14F5E1 for <masque@ietf.org>; Tue, 15 Nov 2022 17:57:34 -0800 (PST)
Received: by mail-io1-xd2f.google.com with SMTP id e189so12201297iof.1 for <masque@ietf.org>; Tue, 15 Nov 2022 17:57:34 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=GzHrke9ic/+ZMpkUxkL8VZj8kTvvv2JBpXWBMANhUD4=; b=R9l8ZFSWr57lP6hoadDi1DGBOfOeacBHjVx7HtL3BT0ve6lCXqcTbi/0xqYXl6MWyr mk4H2IlTPsVq+nZH5WkXwt4jOD7WbKaDSuiPRKP3u/8hSC/aPH3JdUnAdakCpNUecHtZ 8XNs6S5QhU5vecBri446j1R2S1j7z/kKfQNFxFpZg6hj7X33podgebYiP9P9cIYcMvad 1g1ICF6idysizyVgto+AWYnATNawufL3FRqUg52/4F+Gf23pnk+cEaPDK89fjO6t6QFM p6NV2myBZ52hnFieO2GWJvKtwRmcuBT3Xww9yYoFspVjGjet3HsPgL6xagolg9SRZbEW LXKQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=GzHrke9ic/+ZMpkUxkL8VZj8kTvvv2JBpXWBMANhUD4=; b=mcyE0G9JhJXpB16eU+GYFI3E2rypetzm16dNDH+w7QNjWKzcIYKuP2P5Rp9ZPGCYCs H7FhSU06URwr7W065JyDsF9Cyubvpd+l7xU0dfkyFK/f7H96dEYcW2+QM+gy6kx/H69g YN7ER4W11k+f37NHLFGKqjMeYIBUlLkJsQ/C6RA3n8iaKyFf4dpD49oloyJZtjUzkmoP H9Vm8dc2AeZuQ1UMLGmZxn7TIvwU2P9ADtXmh9m30a3wZlroth9zantISju0DbzzhJQ4 wLBUIEfSblkyGJo5ZG2dRzvQYd4disclufX/Kc4CAfnuuPYyXzbnBAKX+cCQuuoRD9K5 jghA==
X-Gm-Message-State: ANoB5pm583lZUhYTjC+cJRcY4zIBhIDfYPt1pdpnk2MyARPcRQPl0/Yr izBOy1S5OFLjNByoggpFRJMMA0usliUBMdj3PUMnbCQye/z4Lg==
X-Google-Smtp-Source: AA0mqf48AfIeMfv2wZDjKlVRA6E6aJOrobG34RuIpYK0jJM3NzXBsbP+iLQKjxkd3hCxand0I0f4e1sCtAq+mLvH0hE=
X-Received: by 2002:a05:6638:1405:b0:376:2218:eea2 with SMTP id k5-20020a056638140500b003762218eea2mr3035886jad.267.1668563853491; Tue, 15 Nov 2022 17:57:33 -0800 (PST)
MIME-Version: 1.0
References: <8e6fb1e1-6454-4706-a61a-53be58acaa61@betaapp.fastmail.com>
In-Reply-To: <8e6fb1e1-6454-4706-a61a-53be58acaa61@betaapp.fastmail.com>
From: Ben Schwartz <bemasc@google.com>
Date: Tue, 15 Nov 2022 20:57:20 -0500
Message-ID: <CAHbrMsCj2KHcQJFZdKr2DGUQDFSLLE6rK7CSqOUZ2ALNCrLAEQ@mail.gmail.com>
To: Martin Thomson <mt@lowentropy.net>
Cc: masque@ietf.org
Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg="sha-256"; boundary="000000000000ce38f005ed8ccb7f"
Archived-At: <https://mailarchive.ietf.org/arch/msg/masque/6K9k7x8KYDgCVetFS5fCsuOf6o8>
Subject: Re: [Masque] Encrypting between client and proxy
X-BeenThere: masque@ietf.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: Multiplexed Application Substrate over QUIC Encryption <masque.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/masque>, <mailto:masque-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/masque/>
List-Post: <mailto:masque@ietf.org>
List-Help: <mailto:masque-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/masque>, <mailto:masque-request@ietf.org?subject=subscribe>
X-List-Received-Date: Wed, 16 Nov 2022 01:57:38 -0000

On Tue, Nov 15, 2022 at 6:44 PM Martin Thomson <mt@lowentropy.net> wrote:
...

> The protected payload is high entropy, being comprised of ciphertext and
> is anywhere from 20 to 65506 bytes.  This payload can be split into two,
> with a 12 byte sample being used as a nonce for AES-CTR.  The remainder of
> the payload, plus part of the first byte, could then be protecting using
> AES-CTR.  The remaining 8+ bytes could again be sampled again as a nonce to
> protect the first sample.
>

The thing you are looking for is called a Pseudo-Random Permutation [1].  I
would encourage you to use HCTR2 [2].  (I learned a bit about these while
working on [3].)

[1] https://en.wikipedia.org/wiki/Pseudorandom_permutation
[2] https://github.com/google/hctr2
[3] https://datatracker.ietf.org/doc/draft-cpbs-pseudorandom-ctls/

...

> [1] A few people have noted that timing tends to be a dead giveaway here,
> as does packet size.  I have some ideas about how that might be managed,
> but let's start with the basics.
>

Personally, I think this is probably fatal, so the encryption is not really
buying you anything.   However, I would still support adding encryption
here, at least optionally, for the sake of making the attacker's job a bit
harder.  It's not the easiest thing to specify in a threat model, but there
is a real difference between "instant undeniable confirmation" and "strong
statistical inference" for an attacker.

...