Re: [openpgp] AEAD Chunk Size

Derek Atkins <derek@ihtfp.com> Wed, 20 March 2019 13:24 UTC

Return-Path: <derek@ihtfp.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 791D7127B50 for <openpgp@ietfa.amsl.com>; Wed, 20 Mar 2019 06:24:35 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.99
X-Spam-Level:
X-Spam-Status: No, score=-1.99 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, T_SPF_PERMERROR=0.01] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=ihtfp.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 D1xy5jIUz0TB for <openpgp@ietfa.amsl.com>; Wed, 20 Mar 2019 06:24:33 -0700 (PDT)
Received: from mail2.ihtfp.org (MAIL2.IHTFP.ORG [204.107.200.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 7FEC0127963 for <openpgp@ietf.org>; Wed, 20 Mar 2019 06:24:33 -0700 (PDT)
Received: from localhost (localhost [127.0.0.1]) by mail2.ihtfp.org (Postfix) with ESMTP id 28F41E2044; Wed, 20 Mar 2019 09:24:31 -0400 (EDT)
Received: from mail2.ihtfp.org ([127.0.0.1]) by localhost (mail2.ihtfp.org [127.0.0.1]) (amavisd-maia, port 10024) with ESMTP id 20162-10; Wed, 20 Mar 2019 09:24:30 -0400 (EDT)
Received: from securerf.ihtfp.org (99-46-190-172.lightspeed.tukrga.sbcglobal.net [99.46.190.172]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mocana.ihtfp.org", Issuer "IHTFP Consulting Certification Authority" (not verified)) by mail2.ihtfp.org (Postfix) with ESMTPS id 22F4CE2040; Wed, 20 Mar 2019 09:24:30 -0400 (EDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ihtfp.com; s=default; t=1553088270; bh=h4lAfCNHwyJLm+nabDjB560d+RvQG7CBDRO6YRoQi7c=; h=From:To:Cc:Subject:References:Date:In-Reply-To; b=PtmUykKvm52w/w+YK4s7w3i4yrkNLEYn8EkdlX9fR9JjFkmBpZZ4MDH7E8UkUghcB QKu7dWoKMevJrwuPvL+V4HvHbLW8wudqnY7AT7H5lOi0JgyX6rq8+zA9MWLrab6XER GBBzkzjeXBRTanUqZ2XiA0/Csa+ZZIjC1BZcDnoo=
Received: (from warlord@localhost) by securerf.ihtfp.org (8.15.2/8.15.2/Submit) id x2KDONBY008937; Wed, 20 Mar 2019 09:24:23 -0400
From: Derek Atkins <derek@ihtfp.com>
To: "Neal H. Walfield" <neal@walfield.org>
Cc: openpgp@ietf.org, Vincent Breitmoser <look@my.amazin.horse>
References: <87d0n174w6.fsf@wheatstone.g10code.de> <87mumh33nc.wl-neal@walfield.org> <3GFS71V7BTJNZ.29C5TO8OY0O44@my.amazin.horse> <sjmy35isypu.fsf@securerf.ihtfp.org> <87r2bax5u2.wl-neal@walfield.org> <sjmlg1hskdq.fsf@securerf.ihtfp.org> <87pnqtwot9.wl-neal@walfield.org> <87y35hy2i0.fsf@wheatstone.g10code.de> <87k1h0we7w.wl-neal@walfield.org> <87va0g65ht.fsf@wheatstone.g10code.de> <87va0gioae.wl-neal@walfield.org> <431ea8fdaca6b3d20e19cfe2a14f6c96.squirrel@mail2.ihtfp.org> <87mulsi7ms.wl-neal@walfield.org> <sjmpnqmrg1b.fsf@securerf.ihtfp.org> <87lg1a3fcl.wl-neal@walfield.org>
Date: Wed, 20 Mar 2019 09:24:22 -0400
In-Reply-To: <87lg1a3fcl.wl-neal@walfield.org> (Neal H. Walfield's message of "Tue, 19 Mar 2019 19:10:18 +0100")
Message-ID: <sjm4l7xr855.fsf@securerf.ihtfp.org>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Virus-Scanned: Maia Mailguard 1.0.2a
Archived-At: <https://mailarchive.ietf.org/arch/msg/openpgp/n1-e2shFQMqLphGY2VUvxdr9T40>
Subject: Re: [openpgp] AEAD Chunk Size
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: Wed, 20 Mar 2019 13:24:36 -0000

Hi,

"Neal H. Walfield" <neal@walfield.org> writes:

> Hi Derek,
>
> Thanks for your analysis.  I think the AEAD chunking algorithm is
> sound, if it is used correctly.
>
> My issue is that I don't think it is possible to use the chunking
> algorithm correctly for large chunk sizes.  For instance, what should
> an implementation do if it encounters a chunk size of 16 TB (and there
> really can be >16 TB of data using a small decompression bomb)?
> Should it be allowed to emit unauthenticated plaintext?

Aha, and we have come around full circle again.

The chunk size needs to be small enough that the receiver can process
it.  If it's too big, then it cannot be processed and the receiver
either must buffer it or will decide to release the plaintext prior to
the chunk being completed.

[snip]
> So, my conclusion is, we must prohibit implementations from emitting
> unauthenticated plaintext *and* remove any incentives to do so.  For
> me, this means a small, fixed chunk size.

There is no way to prohibit the implementation from emitting
unauthenticated plaintext.  Implementations will do what they want/need
to do.

I still don't think we need a fixed chunk size.  Different use cases may
dictate different ideas.  It's a tradeoff, of course.  The hope would be
the receiver can signal to the sender what it should do.

I DO believe that recommended chunk sizes should be smaller than, say
4TB (let alone exabytes).  I am happy to have the range be anywhere from
1KB to 128MB (give or take), but I still don't think we should outright
prohibit smaller or larger.  Considering the chunk size should be part
of the protected data, I don't see how an attacker could modify it, only
a sender that doesn't pay attention.

Specifically, if the sender and receiver have some out-of-band knowledge
about each other I still think it's perfectly reasonable for them to
make their own choices.

> Does this clarify my concerns?

I think so, and we ARE on the same page, I think.

> Thanks!
>
> :) Neal

-derek
-- 
       Derek Atkins                 617-623-3745
       derek@ihtfp.com             www.ihtfp.com
       Computer and Internet Security Consultant