Re: [openpgp] Reducing the meta-data leak

ianG <iang@iang.org> Sun, 08 November 2015 12:03 UTC

Return-Path: <iang@iang.org>
X-Original-To: openpgp@ietfa.amsl.com
Delivered-To: openpgp@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id E3D661B2ABB for <openpgp@ietfa.amsl.com>; Sun, 8 Nov 2015 04:03:01 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.9
X-Spam-Level:
X-Spam-Status: No, score=-1.9 tagged_above=-999 required=5 tests=[BAYES_00=-1.9] autolearn=ham
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 3aDkD6ogiICm for <openpgp@ietfa.amsl.com>; Sun, 8 Nov 2015 04:03:00 -0800 (PST)
Received: from virulha.pair.com (virulha.pair.com [209.68.5.166]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 523451B2ABA for <openpgp@ietf.org>; Sun, 8 Nov 2015 04:03:00 -0800 (PST)
Received: from tormenta.local (iang.org [209.197.106.187]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by virulha.pair.com (Postfix) with ESMTPSA id 4E34A6D732; Sun, 8 Nov 2015 07:02:58 -0500 (EST)
To: openpgp@ietf.org
References: <mailman.92.1446580813.31211.openpgp@ietf.org> <86CB1513-F594-4A9B-A3B6-17ECB9CA9EB6@isoc.org> <160A8D98-3DF8-4F51-A38C-EF3E0DAE71EE@gmail.com>
From: ianG <iang@iang.org>
Message-ID: <563F39F1.5040608@iang.org>
Date: Sun, 08 Nov 2015 12:02:57 +0000
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:38.0) Gecko/20100101 Thunderbird/38.3.0
MIME-Version: 1.0
In-Reply-To: <160A8D98-3DF8-4F51-A38C-EF3E0DAE71EE@gmail.com>
Content-Type: text/plain; charset="windows-1252"; format="flowed"
Content-Transfer-Encoding: 8bit
Archived-At: <http://mailarchive.ietf.org/arch/msg/openpgp/GtVnuIQXK8AtOonLujLRhrZ7qNw>
Subject: Re: [openpgp] Reducing the meta-data leak
X-BeenThere: openpgp@ietf.org
X-Mailman-Version: 2.1.15
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: Sun, 08 Nov 2015 12:03:02 -0000

On 7/11/2015 11:33 am, Bryan Ford wrote:
> I’m glad to see the metadata-leakage protection topic drawing some
> interest, including some healthy skepticism on whether it’s practical. :)
>
> I’ll try to summarize my scheme at least somewhat concisely, and include
> this in a draft-of-a-draft that I have in progress.  [snip]
> Let’s work from a simple case to progressively more “interesting” and
> general cases:
>
> 1. Encryption using a single scheme (e.g., a single well-known
> “ciphersuite”) via a single passphrase.


Why is there a number for this....  Oh, because

> 2. Single symmetric-key scheme, but multiple alternative passphrases
> using that scheme.
> 3. Single public-key encryption scheme, with message encrypted for one
> or multiple public keys compatible with that scheme.
> 4. Multiple symmetric and/or public-key schemes, allowing multiple
> different passphrases and recipient public-keys each, respectively.


Ug :(

> —
> 1. Suppose simplistically we only want single-passphrase encryption
> using a single well-known encryption scheme.  More-or-less as usual for
> PGP, we (a) choose a random session key, (b) use a password-hashing
> scheme such as Argon2 to produce a symmetric encryption key that is used
> to AEAD-encrypt the file’s session key, and (c) use the session key to
> AEAD-encrypt the file’s content.  Assume for now that we encrypt the
> file in one big chunk, though chunking (with metadata encryption) can be
> added as well using existing techniques (e.g., those mentioned earlier
> analyzed in the context of SSH).


so far so good.


> So we basically have three important blobs of data to place in the file:
> (a) the salt for the password-hashing scheme, (b) the AEAD-encrypted
> session key encrypted using the password-hasher’s output, and (c) the
> AEAD-encrypted file content encrypted using the session key.  Item (a)
> needs to be encoded in the file in “cleartext” since it needs to be
> available to the decryptor before it can decrypt anything, but
> fortunately the salt can just be a uniformly random blob anyway (of a
> length fixed by this well-known scheme).  So for the moment let’s just
> put it at the very beginning of the encoded file.  Then place the
> AEAD-encrypted session key blob (b) immediately afterwards, whose size
> can also easily be fixed for this scheme.  This fixed-length session-key
> blob may contain encrypted metadata in addition to the session key, such
> as the file offset of the AEAD-encrypted file content, the (possibly
> padded) total size of the AEAD-encrypted blob, and perhaps the size of
> the “useful payload” within that blob after removing any padding.


I'd suggest also:

  * the version number of the OpenPGP format, like v4 or whatever it is 
supposed to be - thus causing a stab at how we handle rollover of this 
format, at least of the following file content.

  * a self-MAC on the blob.  This is the proof that you've found the 
right password, and can proceed.  This would be calculated over the blob 
with the self-MAC field set to all zeroes.  Extra points if the 
calculation also includes the salt (a).

  * any primary MACs over the file data including the padding, pending 
those other discussions on integrity checking.




> This
> metadata will of course appear as uniform random bits to a non-recipient
> as long as the AEAD encryption scheme is doing its job.  Finally, place
> the AEAD-encrypted file content (c), including any padding, after the
> encrypted session-key blob as the rest of the file.


Yup.

On the remaining SM stuff, I'd like to hear that there is widespread 
support for this before subjecting myself to the pain.

iang