Re: [openpgp] AEAD Chunk Size

Tobias Mueller <> Mon, 18 March 2019 19:51 UTC

Return-Path: <>
Received: from localhost (localhost []) by (Postfix) with ESMTP id 251971312AD for <>; Mon, 18 Mar 2019 12:51:41 -0700 (PDT)
X-Virus-Scanned: amavisd-new at
X-Spam-Flag: NO
X-Spam-Score: -1.9
X-Spam-Status: No, score=-1.9 tagged_above=-999 required=5 tests=[BAYES_00=-1.9] autolearn=ham autolearn_force=no
Received: from ([]) by localhost ( []) (amavisd-new, port 10024) with ESMTP id kQK_cM7S2vFS for <>; Mon, 18 Mar 2019 12:51:38 -0700 (PDT)
Received: from ( []) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by (Postfix) with ESMTPS id 4935B1312D2 for <>; Mon, 18 Mar 2019 12:51:38 -0700 (PDT)
Received: from ( []) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by (Postfix) with ESMTPSA id 44NRdf2mjlz13CLF; Mon, 18 Mar 2019 20:51:34 +0100 (CET)
Message-ID: <>
From: Tobias Mueller <>
To: "Neal H. Walfield" <>
Cc: Derek Atkins <>, Werner Koch <>,, Vincent Breitmoser <>
Date: Mon, 18 Mar 2019 20:51:32 +0100
In-Reply-To: <>
References: <> <> <> <> <> <> <> <> <> <> <>
Content-Type: text/plain; charset="UTF-8"
X-Mailer: Evolution 3.28.5-0ubuntu0.18.04.1
Mime-Version: 1.0
Content-Transfer-Encoding: 7bit
Archived-At: <>
Subject: Re: [openpgp] AEAD Chunk Size
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: "Ongoing discussion of OpenPGP issues." <>
List-Unsubscribe: <>, <>
List-Archive: <>
List-Post: <>
List-Help: <>
List-Subscribe: <>, <>
X-List-Received-Date: Mon, 18 Mar 2019 19:51:45 -0000


On Mon, 2019-03-18 at 11:53 +0100, Neal H. Walfield wrote:
> > For me, a plaintext is authenticated if the whole ciphertext could
> be
> > successfully authenticated. Which seems to be very well in line with
> the
> > definition you've linked to.
> 4880bis defines a chunking mechanism based on AEAD: the message is
> split into multiple chunks.  In 4880bis, AEAD operates on a per-chunk
> basis.  The chunking algorithm provides mechanisms for ensuring chunks
> can't be reordered, detecting the end of the message, etc.  Using AEAD
> to decrypt a chunk authenticates that chunk's ciphertext; for a given
> chunk, the decryption operation will either return the correct
> plaintext, or it will return an error.  This is exactly what RFC 5116
> requires. 
I beg to differ. Because, as you mention:

>  RFC 5116 doesn't discuss chunking; chunking is not AEAD.
Chunking is not AEAD. It's a protocol on top of AEAD messages that you
have to come up with. And then you have to implement it correctly. The
security guarantees that AEAD gives you, do not automatically apply to
your chunking scheme.
As you've said: Chunking is not AEAD. Hence, it cannot automatically be
in line with what RFC5116 demands.

> You seem to think that AEAD's guarantees must apply to the whole
> message.  I disagree.  
I'm glad you're saying this.
And yes, I think that proper AE means that the full message enjoys the
security guarantees of AE. Also because I am not aware of definitions
covering partially authenticated plaintext. And I think that RFC5116
leans more towards full messages rather than trying to define security
guarantees for partial plaintext.  I further think getting as close to
proper AE as possible is a goal worth pursuing.

> I agree it is useful, but it is not possible
> when streaming.
If you absolutely must stream, then there is no way that you can buffer
the whole message, otherwise you wouldn't stream.  I claim, however,
that in the vast majority of use-cases you don't have the requirement of
having to stream.  As in, purely from a functional perspective, not from
an implementation perspective.  Hence, imposing the concept of streaming
onto everybody somehow does not feel right.
I'd like to note, though, that it is possible to not reveal the
plaintext no matter how large the message is, though.  You can mask the
output you release, e.g. XOR it or apply CTR mode, and provide the key
to remove the mask only when the ciphertext has checked out correctly.

>From the proposal you made it seem you think we should not even try to
provide a format for a non-streaming message.  Would you describe that
as correct?

> I think that even if we add a bit that says: "don't stream",
> implementations will ignore it.
Hm. I'd classify this as a wilful violation of the spec rather than an
accident while implementing it.
Once you assume that implementations are doing things wilfully wrongly,
it gets messy.
I mean... where do we stop making compromises in the security of the
spec because we believe someone will wilfully ignore the spec? We rely
on the client not actively misinterpreting the spec. Like.. not making
secret key material available.