Re: [openpgp] Padding packets

Daniel Huigens <d.huigens@protonmail.com> Fri, 17 June 2022 12:53 UTC

Return-Path: <d.huigens@protonmail.com>
X-Original-To: openpgp@ietfa.amsl.com
Delivered-To: openpgp@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 89347C15AAF8 for <openpgp@ietfa.amsl.com>; Fri, 17 Jun 2022 05:53:08 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -7.109
X-Spam-Level:
X-Spam-Status: No, score=-7.109 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_HI=-5, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=protonmail.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 giiiJcu2KTsM for <openpgp@ietfa.amsl.com>; Fri, 17 Jun 2022 05:53:04 -0700 (PDT)
Received: from mail-4316.protonmail.ch (mail-4316.protonmail.ch [185.70.43.16]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 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 DF508C15791C for <openpgp@ietf.org>; Fri, 17 Jun 2022 05:53:03 -0700 (PDT)
Date: Fri, 17 Jun 2022 12:52:50 +0000
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1655470380; x=1655729580; bh=Uq969WlY9ewbJnsAjH4nnCfddZmRarSHgj946HO0fSI=; h=Date:To:From:Cc:Reply-To:Subject:Message-ID:In-Reply-To: References:Feedback-ID:From:To:Cc:Date:Subject:Reply-To: Feedback-ID:Message-ID; b=CDQcSqaMakTYcNr0YMV7sljheH4AcFZbRfmk2g0/JcwPTsudwUm7TjdTf1Jr7ztuB P59KwxwYsbOsfafG7MOzLmP++IAHL/k2litnIhNP7IlBv0nX0B2uQXfAhwubjKc42b jcwBgcG8iWZ2oJWB0Wp/FL53xawt7Hz7dnE+uTfQtEZrdyW5zPgUdt3jwyxD4B0Tec cGw+eoOk10MLe9qC8rU/jkTtRmADecz/KLJ2UoghVmsOewwINgWZlKhX2z+qkyHyiw pC7YN7LJqFzbwRrJ3JOEh6dmDg3mV0LqcyL13Ow7lD91fERlbnk9ZJuLUQUTsh2QTX ubhPKCMjHpCoQ==
To: Ángel <angel@16bits.net>
From: Daniel Huigens <d.huigens@protonmail.com>
Cc: openpgp@ietf.org, "brian m. carlson" <sandals@crustytoothpaste.net>
Reply-To: Daniel Huigens <d.huigens@protonmail.com>
Message-ID: <o17TAfJTeOZkYp5X-XwNQwnTrCaiKEGnn1ZAL1qLB5CTGKntjwv6dpCIah44pAdH8nHXa4ivte_MMtqXuKP3uhobW5kJk9E6rAEWneD11yA=@protonmail.com>
In-Reply-To: <83cce07c67f67c19b06c0c4239b6f335512a9a6f.camel@16bits.net>
References: <87wndi88ri.fsf@wheatstone.g10code.de> <83cce07c67f67c19b06c0c4239b6f335512a9a6f.camel@16bits.net>
Feedback-ID: 2934448:user:proton
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: quoted-printable
Archived-At: <https://mailarchive.ietf.org/arch/msg/openpgp/bjtS353wXzKemtvmjOEU-zoc-fY>
Subject: Re: [openpgp] Padding packets
X-BeenThere: openpgp@ietf.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: "Ongoing discussion of OpenPGP issues." <openpgp.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/openpgp>, <mailto:openpgp-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/openpgp/>
List-Post: <mailto:openpgp@ietf.org>
List-Help: <mailto:openpgp-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/openpgp>, <mailto:openpgp-request@ietf.org?subject=subscribe>
X-List-Received-Date: Fri, 17 Jun 2022 12:53:08 -0000

Hello,

I agree that deterministic incompressible data is better than random
data in this context.

I've created a merge request based on your and Brian's suggestion:
https://gitlab.com/openpgp-wg/rfc4880bis/-/merge_requests/203.

Between the two, I went with AES-128-CTR as it seems more efficient to
me than SHA-256, and should provide the properties we want.

I went with an all-zero key instead of the hash of the previous packet,
as I didn't see a need for binding the padding to the preceding packet,
and always using the same (deterministic) padding seemed fine to me,
however, let me know if you disagree or see a need for that.

Thanks both for the suggestion!

Best,
Daniel


------- Original Message -------
On Thursday, June 16th, 2022 at 01:43, Ángel <angel@16bits.net> wrote:

> On 2022-06-15 at 13:29 +0200, Werner Koch wrote:
>
> > Hi!
> >
> > The idea of a padding packet is in general a good idea and has been
> > discussed many times:
> >
> > 5.14. Padding Packet (Tag 21)
> >
> > The Padding packet contains random data, and can be used to defend
> > against traffic analysis (see Section 14.10) on version 2 SEIPD
> > [...]
> > Its contents SHOULD be random octets to make the length obfuscation
> > it provides more robust even when compressed.
> >
> > The problem with random padding packets is that this opens a high
> > capacity channel with all its problems.
>
>
> I agree. I think this was noted in the past, as well.
>
>
> However, we don't need this to be random, it can be deterministic yet
> incompressible.
> Take a symmetric-key algorithm, use it in counter mode with the hash of
> the previous packet as key (or IV). That will produce an output which
> should not be compressible. Yet, it produces a deterministic padding
> that can be verified by the receiving application.
>
> > A better mechanism to add padding is by handling
> > this at the MIME layer.
>
>
> How do you expect to handle this at the MIME layer? Or even if it's not
> use in the context of an email message?
>
>
> See for instance the scenario posed last year in
> https://lists.gnupg.org/pipermail/gnupg-users/2021-January/064771.html
> (Message-ID: <780b90f468c3e160b56121e2ed02a564cb0429f8.camel@16bits.net)
>
> That's in the context of WKD, where an external observer could
> determine the openpgp keys fetched inside an https transport.
> How would "MIME padding" fix that?
>
>
> Regards
>
>
> _______________________________________________
> openpgp mailing list
> openpgp@ietf.org
> https://www.ietf.org/mailman/listinfo/openpgp