Re: [openpgp] [internet-drafts@ietf.org] New Version Notification for draft-ietf-openpgp-rfc4880bis-10.txt

"Neal H. Walfield" <neal@walfield.org> Tue, 15 September 2020 09:36 UTC

Return-Path: <neal@walfield.org>
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 59EA83A0C3C for <openpgp@ietfa.amsl.com>; Tue, 15 Sep 2020 02:36:35 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.898
X-Spam-Level:
X-Spam-Status: No, score=-1.898 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, SPF_NONE=0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
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 LHQaj9rE6haD for <openpgp@ietfa.amsl.com>; Tue, 15 Sep 2020 02:36:33 -0700 (PDT)
Received: from mail.dasr.de (mail.dasr.de [217.69.77.164]) (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 E3FF63A0C5D for <openpgp@ietf.org>; Tue, 15 Sep 2020 02:36:32 -0700 (PDT)
Received: from p5de92429.dip0.t-ipconnect.de ([93.233.36.41] helo=forster.huenfield.org) by mail.dasr.de with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.86_2) (envelope-from <neal@walfield.org>) id 1kI7O2-0004qG-0t; Tue, 15 Sep 2020 09:36:30 +0000
Received: from grit.huenfield.org ([192.168.20.9] helo=grit.walfield.org) by forster.huenfield.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from <neal@walfield.org>) id 1kI7O1-000356-FA; Tue, 15 Sep 2020 11:36:29 +0200
Date: Tue, 15 Sep 2020 11:36:29 +0200
Message-ID: <87tuvz5qle.wl-neal@walfield.org>
From: "Neal H. Walfield" <neal@walfield.org>
To: Justus Winter <justuswinter@gmail.com>
Cc: openpgp@ietf.org
In-Reply-To: <87k0wvfnhs.fsf@europa.jade-hamburg.de>
References: <87h7sfyr88.fsf@wheatstone.g10code.de> <D354CDA5-ED50-41B4-9B95-3D02A4FC9A4F@nohats.ca> <87363yaojh.wl-neal@walfield.org> <87k0wvfnhs.fsf@europa.jade-hamburg.de>
User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM/1.14.9 (Gojō) APEL/10.8 EasyPG/1.0.0 Emacs/26 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO)
MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue")
Content-Type: multipart/signed; boundary="pgp-sign-Multipart_Tue_Sep_15_11:36:11_2020-1"; micalg="pgp-sha512"; protocol="application/pgp-signature"
Content-Transfer-Encoding: 7bit
X-SA-Exim-Connect-IP: 192.168.20.9
X-SA-Exim-Mail-From: neal@walfield.org
X-SA-Exim-Scanned: No (on forster.huenfield.org); SAEximRunCond expanded to false
Archived-At: <https://mailarchive.ietf.org/arch/msg/openpgp/8IMDuNDLcON01JcbWema2P9_jro>
Subject: Re: [openpgp] [internet-drafts@ietf.org] New Version Notification for draft-ietf-openpgp-rfc4880bis-10.txt
X-BeenThere: openpgp@ietf.org
X-Mailman-Version: 2.1.29
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: Tue, 15 Sep 2020 09:36:35 -0000

On Tue, 15 Sep 2020 10:33:19 +0200,
Justus Winter wrote:
> "Neal H. Walfield" <neal@walfield.org> writes:
> >   30d8397 Introduce the Key Block subpacket to align OpenPGP with CMS.
> >
> > I think the idea is okay, but the execution (what should and should
> > not be included) could use some work.
>
> Even though I initially proposed it, I now have my doubts about the
> design and would have appreciated a discussion on this list first.

I agree with you Justus, but I don't see the situation quite as dire
as you.

> The problem I see is that the size of a subpacket area is limited to
> 1<<16 bytes.  This severely limits the number of certificates that can
> be communicated with this mechanism.

PQ keys are still a ways off.  One approach to workaround this
limitation would be to raise the maximum size of the subpacket areas
for v5 signatures *now*.  This is relatively straightforward.

> For example, the Bob sample key (D1A6 6E1A 23B1 82C9 980F 788C FBFC C82A
> 015E 7330) measures 1741 bytes, meaning we could fit 37 of those into a
> subpacket area.  On the other hand, my cert weighs in at 9148 bytes,
> bringing this number down to 7.
>
> Now, these are both certificates with RSA keys and signatures, and the
> numbers are way better with ECC.  But, we don't know how large PQ keys
> and signatures will be.  Notably, if the cryptographic community settles
> on McEliece, we will not be able to fit a single key, let alone a
> certificate, into a subpacket area.

These certificates can be minimized.  Using gpg's export minimal
option, I get 6521 bytes for your key:

  $ sq keyserver get 0x9B7DD433F254904A | gpg --import; gpg --export-options export-minimal --export 0x9B7DD433F254904A | wc -c

Inspecting the minimal key, I see that there is still a fair amount
that can be stripped:

  $ gpg --export-options export-minimal --export 0x9B7DD433F254904A | sq inspect
  -: OpenPGP Certificate.

      Fingerprint: CBCD 8F03 0588 653E EDD7  E265 9B7D D433 F254 904A
  Public-key algo: RSA (Encrypt or Sign)
  Public-key size: 4064 bits
    Creation time: 2017-07-19 16:28:55 UTC
  Expiration time: 2022-07-18 16:28:55 UTC (creation time + P1825D)
        Key flags: certification

           Subkey: A7E0 0611 1566 B481 A1FE  04CF C471 3E5A A93F 9D68
  Public-key algo: RSA (Encrypt or Sign)
  Public-key size: 2048 bits
    Creation time: 2017-07-19 16:36:26 UTC
  Expiration time: 2022-07-25 15:31:26 UTC (creation time + P1831DT82500S)
        Key flags: authentication

           Subkey: 256A 4E55 E4A7 2D97 AD24  68E7 88DC 7E33 385F 791D
  Public-key algo: RSA (Encrypt or Sign)
  Public-key size: 2048 bits
    Creation time: 2017-07-19 16:32:31 UTC
  Expiration time: 2022-07-25 15:31:26 UTC (creation time + P1831DT82735S)
        Key flags: signing

           Subkey: 0628 A563 C5F2 D310 7D6C  9574 08CC 70F8 D8CC 765A
  Public-key algo: RSA (Encrypt or Sign)
  Public-key size: 2048 bits
    Creation time: 2017-07-19 16:34:06 UTC
  Expiration time: 2022-07-25 15:31:26 UTC (creation time + P1831DT82640S)
        Key flags: transport encryption, data-at-rest encryption

           UserID: Justus Winter <justus@gnupg.org>

           UserID: Justus Winter <justus@pep.foundation>

           UserID: Justus Winter <justus@sequoia-pgp.org>

           UserID: Justus Winter <justuswinter@gmx.de>

           UserID: Justus Winter <teythoon@avior.uberspace.de>

Clearly, the authentication subkey can go, as can all but one of the
user ids and their self-signatures.

But, let's think about what we *really* need.  Let's say I send you
and Alice a message and Alice wants to reply to all.  In that case,
Alice only needs our encryption subkeys.  Really.  In the context of
the thread, it is reasonable for Alice to use the same keys as I use;
my signature (this subpacket is in the hashed area!) is a de facto
certification that the keys should be used for this group
conversation.  (My signature binds the thread and the set of keys.)

So all Alice really needs is a list of the encryption subkeys.  Alice
doesn't need your signing subkey, because she is not verifying a
signature from you; she only needs my signing subkey.  In fact, she
doesn't need your signing key until you send a message, which you, as
the sender, can include!

(Admittedly, it is useful to include the primary key so that when
Alice replies, you can verify that it was signed with a key that I
authenticated for the purpose of this thread.)

What about the certificate's preferences?  Well, Alice can infer a
reasonable set of preferences by simply copying the preferences that I
used.  (Neal encrypted the message using AES-128 and the signature
used SHA-256, ok, I'll do the same.)

What she might need is the expiration time, but my implementation
compute the minimum over all keys and store that in the Key Expiration
Time subpacket of my signature.

What happens if Alice wants to remove someone from cc?  Well, we could
include a User ID.  If we don't add the self-signature this normally
only adds a few dozen bytes.  (Note: if not including the primary key
is too extreme, because you really want something that looks like a
TPK, 4880 doesn't require that a User ID in a TPK have a self
signature [1].)

  [1] https://tools.ietf.org/html/rfc4880#section-11.1


Let's do a bit of math.  A 4k RSA key, which is the worst case right
now, requires:

  Key: ~272 bytes
  Signature: ~571 bytes

So, for a minimal valid TPK, we have:

  [ Primary ] [ Direct Sig ] [ User ID ] [ Subkey ] [ Self sig ]

  272 + 571 + 24 + 272 + 571 = 1710 bytes

or:

  [ Primary ] [ User ID ] [ Self sig ] [ Subkey ] [ Self sig ]

  272 + 24 + 571 + 272 + 571 = 1710 bytes

This allows for 38 recipients in cc.  For most group chats, 38
participants is probably enough.  If you have more, then it is
probably a broadcast.  That is, replies are not expected, and then you
can just elide most of this.

But, using the more extreme variant that I proposed above, we only
need:

  [ User ID ] [ Subkey ]

  20 + 272 = 292 bytes

which allows for about 292 recipients.


Neal