[openpgp] Should fingerprints be "key-canonical"?

Bryan Ford <brynosaurus@gmail.com> Wed, 06 April 2016 19:20 UTC

Return-Path: <brynosaurus@gmail.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 9162912D614 for <openpgp@ietfa.amsl.com>; Wed, 6 Apr 2016 12:20:17 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.699
X-Spam-Level:
X-Spam-Status: No, score=-2.699 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-0.7, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.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 8e6UqG9Jw9bg for <openpgp@ietfa.amsl.com>; Wed, 6 Apr 2016 12:20:14 -0700 (PDT)
Received: from mail-qk0-x22f.google.com (mail-qk0-x22f.google.com [IPv6:2607:f8b0:400d:c09::22f]) (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 5665312D5C1 for <openpgp@ietf.org>; Wed, 6 Apr 2016 12:20:14 -0700 (PDT)
Received: by mail-qk0-x22f.google.com with SMTP id k135so17969904qke.0 for <openpgp@ietf.org>; Wed, 06 Apr 2016 12:20:14 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:subject:message-id:date:to:mime-version; bh=ZWEInWNcjTGsfvuw81YW0q6Abg/xZskzsC5CR08+zA0=; b=G1iyomAWUvxqG4woaNPkOeVqypoTiM+rei9U5b+Di3slSPRg8KVQTcrfbQjXhwm+Nx Uy+bsuZHsOWFTW3Q3SRC0fnwia5EetPPm9OoDkMiYMtp0Zwbi6LdIKVJDYEL8Co/GiJe hcbp6IHhbpZdgSlkK65i1Qr5yvu3REXnBZ1lOBPECoYS7L2PWCNlV3mpDgfsZ+rZUY8g Ul4StXfDshTYp/07KwpbTEvNNB05kY/+cu69Y1Us0/1kyoKU/wM7POvE6rqd7cQeuHG0 YH3K1Nxu0AmkpsB+DW8diAJ4dmZpXRBP6iQhJebp6NMRzo1ukbCZKHenXMMdhsQA6R4w FgkQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:subject:message-id:date:to:mime-version; bh=ZWEInWNcjTGsfvuw81YW0q6Abg/xZskzsC5CR08+zA0=; b=IUfB2XY7UPkG47dlubnQ01Oz1+NiVpLx45Q/d4ihPbQrj9txuygKTdWFULAwsRKtJi UGBBh7fLsTnzuGl14H3Ztl3x/8d1tBaDbHmtoAk8jipFaA7I+/eVQPx8zXKV+vyYckEE mpPpmOx+o60H44Fl/F0TCTp41VBDvdNw8DLletSGbTzlSj3DR1cCWbCKN0yXqHD42MZa jVHMLN3E77lgTQKQAmwfObdrsht2yPG/f4hMrrA8cNG/E4MFwV7zzcqxz4W94sEiHJ0v hrR/30mpdBvxEWYFczEwCtecrIKZgvrQEGn1xO63uTSp0GfBC4FTd2H9+Lz7W3dZ+vw1 +CHA==
X-Gm-Message-State: AD7BkJIXNQJdVr8z9K77RG8X022fha4/jafxAXA/PTBgh9Nv7fsuk9Gd/lx2JKfZTij+ZA==
X-Received: by 10.55.214.1 with SMTP id t1mr51020222qki.4.1459970413356; Wed, 06 Apr 2016 12:20:13 -0700 (PDT)
Received: from [192.168.1.9] ([186.60.153.174]) by smtp.gmail.com with ESMTPSA id 78sm1902581qgt.1.2016.04.06.12.20.10 for <openpgp@ietf.org> (version=TLSv1/SSLv3 cipher=OTHER); Wed, 06 Apr 2016 12:20:11 -0700 (PDT)
From: Bryan Ford <brynosaurus@gmail.com>
Content-Type: multipart/signed; boundary="Apple-Mail=_05F800FC-41EB-43FD-9CCB-41E8DF4BE927"; protocol="application/pkcs7-signature"; micalg="sha1"
Message-Id: <FF8FBD12-70BC-4417-ACFF-085F1044E536@gmail.com>
Date: Wed, 06 Apr 2016 16:20:08 -0300
To: openpgp@ietf.org
Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\))
X-Mailer: Apple Mail (2.3124)
Archived-At: <http://mailarchive.ietf.org/arch/msg/openpgp/xrfnDsyVUqf78C_ijnwBaTxP1us>
Subject: [openpgp] Should fingerprints be "key-canonical"?
X-BeenThere: openpgp@ietf.org
X-Mailman-Version: 2.1.17
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, 06 Apr 2016 19:20:17 -0000

Getting back to DKG’s question of whether the Unix creation-timestamp should be included in the octet-stream passed to a (future) OpenPGP fingerprint scheme…  I want to generalize the question into a choice between three options:

1. The fingerprint covers *only* the public-key material itself, in a verifiably and enforceably canonical form.

2. The fingerprint covers the public-key material and some other fixed-format stuff like version info and Unix timestamp, as in rfc4880.

3. The fingerprint covers the public-key material and some extensible variable-length information, e.g., parameters the key-holder specifies in its self-signed cert at key creation time.

As you can guess I think choice 2 really makes no sense, as it’s kind of an uncomfortable midpoint between two design approaches that has important downsides of both but doesn’t really achieve the benefits of either.  So I’ll just focus now on #1 versus #3.

The advantages I see to approach #1 (fingerprint covers public-key ONLY) are: (a) simplicity in specification and implementation; and (b) there may be security benefits in any public-key having one and only one fingerprint - IF canonical encoding is 100% enforced in current OpenPGP implementations, which may or may not be the case.

The advantages I see to approach #3 (fingerprint covers public-key and some extensible information) are that the key’s creator can bind to the key, at creation time, additional information that other parties might subsequently use in checking the validity or revocation status of a key, when importing or checking its fingerprint.  The current fixed-format bundling of Unix creation-time into the fingerprinted octet-string is just a ridiculously restrictive special-case of this otherwise potentially not-bad idea.  The question, as DKG brought up in the session, is what the range of benefits are that we might get from this flexibility, and whether they justify the added complexity, and any security risks that may arise from non-canonical fingerprints.

The general (potential) risk here - although I’m not sure how “real” it is - is that either the key-holder, or someone who manages to steal the key, can tweak the creation-timestamp and/or any other non-canonical bits that the fingerprint depends on, to create a new “public key” with a different fingerprint but the same key material as the old one.  One obvious “bad thing” that might happen is if a key-thief could use this to trick other people into not realizing a revoked key was revoked, because the key-thief is reusing the key under a different fingerprint.  But so far I haven’t been able to put together realistic-sounding attack scenarios.  I think this is in part because for anyone to trust that key in the first place, they presumably need to have verified it somehow, typically by doing something with the fingerprint, and hence an attacker who reuses a stolen/broken key with a new fingerprint doesn’t get any benefit because the new fingerprint isn’t verified/trusted by anyone.  The question is where these assumptions might fail, e.g., some application attaches trust to keys directly without verifying their fingerprints, and becomes vulnerable to this class of attack.

On the upside of allowing the fingerprint to depend on non-canonical (e.g., creator-provided) information, I understand Phil is going to post a document listing some of the uses for this type of functionality, and I look forward to seeing that.  But just to list a few potential uses I can think of:

- This information could include a creation-timestamp as a Unix time, as it is now.

- This information could include a more verifiable analog to a creation-timestamp, e.g., a signed timestamp record from a digital timestamp or notary service that actually vouches for the timestamp and publishes the timestamp in a public log.  OpenPGP implementations that receive a public key and validate it against this fingerprint could (but wouldn’t necessarily always have to) verify the signed timestamp record, and could even (again optionally) check its presence in the public log.  This might be the way to get closer to the actual security benefit that presumably motivated the inclusion of the creation timestamp in the original OpenPGP spec: e.g., it would provide some actual publicly-verifiable evidence of when the key was first created, and make it difficult for an attacker to “re-create” a broken key later without that attack being detectable.

- The information covered by the fingerprint could include “hardness parameters” that feed into the fingerprint scheme itself, enabling the key creator to obtain a configurable level of protection for the key from fingerprint-mining attacks where an attacker tries to search for other keys with fingerprints that match in the first several digits.  This was discussed at the last IETF meeting, and subsequently on this mailing list thread, so I won’t repeat it at length here: https://www.ietf.org/mail-archive/web/openpgp/current/msg08478.html <https://www.ietf.org/mail-archive/web/openpgp/current/msg08478.html>

- The information covered by the fingerprint could include hash-pointers to blockchain transactions in order to incorporate blockchain-randomness into the fingerprint (see https://eprint.iacr.org/2015/1015.pdf <https://eprint.iacr.org/2015/1015.pdf>), thereby making it extremely expensive, if not effectively impossible, for  an attacker to produce another key with the same or even a similar-looking fingerprint without the attack likely being detected.  Not every OpenPGP implementation would necessarily be expected to know how to actually verify this blockchain-randomness; implementations that don’t support it would just see it as an opaque blob of information that the fingerprint covers but that they otherwise don’t interpret.

- The information covered by the fingerprint could specify additional “canary” or revocation conditions by which parties using the key might more quickly/securely detect if and when the key might have been compromised.  For example, this information could contain a “financially incentivized auto-revocation”: e.g., a hash-pointer to an unspent Bitcoin transaction output which, if and when it is ever spent, is to be interpreted by everyone as an implicit revocation of the associated PGP key.  The key-holder funds a “key compromise bounty” by depositing some amount of Bitcoin in an account whose private key can be derived from the PGP private key.  Then if a hacker ever steals the private PG key, they get access to the bounty - but in transferring/spending it they effectively cause the PGP key to be publicly revoked, making that immediately detectable to any OpenPGP implementations that happen to support this auto-revocation mechanism.  Of course the hacker might choose to leave the bounty unspent in order to avoid compromise detection, but the higher the bounty, the fewer attackers will want to make that choice.

I’m not going to make the case that any of these potential benefits of non-canonical fingerprints are absolutely essential, but rather just explore the possibly interesting space of potential benefits from being able to use fingerprints to verify more than just a raw public key alone.  Further thoughts welcome.

Cheers
Bryan