Re: [openpgp] Followup on fingerprints

Derek Atkins <derek@ihtfp.com> Tue, 04 August 2015 15:49 UTC

Return-Path: <derek@ihtfp.com>
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 C59291A1B34 for <openpgp@ietfa.amsl.com>; Tue, 4 Aug 2015 08:49:17 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.389
X-Spam-Level:
X-Spam-Status: No, score=-1.389 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HELO_MISMATCH_ORG=0.611] autolearn=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 KGUHjMqWLRkV for <openpgp@ietfa.amsl.com>; Tue, 4 Aug 2015 08:49:16 -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 F33571A1B22 for <openpgp@ietf.org>; Tue, 4 Aug 2015 08:48:12 -0700 (PDT)
Received: from localhost (localhost [127.0.0.1]) by mail2.ihtfp.org (Postfix) with ESMTP id 8C818E2035; Tue, 4 Aug 2015 11:48:11 -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 17487-01; Tue, 4 Aug 2015 11:48:09 -0400 (EDT)
Received: from securerf.ihtfp.org (unknown [IPv6:fe80::ea2a:eaff:fe7d:235]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mocana.ihtfp.org", Issuer "IHTFP Consulting Certification Authority" (verified OK)) by mail2.ihtfp.org (Postfix) with ESMTPS id 630B7E2034; Tue, 4 Aug 2015 11:48:09 -0400 (EDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ihtfp.com; s=default; t=1438703289; bh=Ys7hYlzZRTbS5WAZTKDFycbwhEIvISBfzea1F9i28Uw=; h=From:To:Cc:Subject:References:Date:In-Reply-To; b=nOiMVG1a9RZ/OVohVY9DdHTl0ftNUkmEZpKwuH7b/kAZYOZWXecszjMrygqtDvmAD UGI96+2/PrM3fYpm5qDNcKw274tbZ5Q/0TlxAImQhMruhhqHOgWyXsqzjxzCbjVyHF ULakPS2tg6n07GkZhy0cqohYG+D+Ivv6SC9TpkFw=
Received: (from warlord@localhost) by securerf.ihtfp.org (8.14.8/8.14.8/Submit) id t74Fm86X020019; Tue, 4 Aug 2015 11:48:08 -0400
From: Derek Atkins <derek@ihtfp.com>
To: Phillip Hallam-Baker <phill@hallambaker.com>
References: <CAMm+LwgTcn8CY+Zk-f9gzXQtMJezG97T+kx2=C7PR5g7zFer_A@mail.gmail.com> <87twsn2wcz.fsf@vigenere.g10code.de> <CAMm+LwgRJX-SvydmpUAJMmN3yysi4zzGSpO2yY4JAMhD-9xLgQ@mail.gmail.com> <87zj2ecmv8.fsf@alice.fifthhorseman.net> <CAMm+LwgKmcTes=V7uS3MjCQixWCo-i7PY=VE7eCHSqt3Ho3OSg@mail.gmail.com> <87a8udd4u6.fsf@alice.fifthhorseman.net> <sjm61503182.fsf@securerf.ihtfp.org> <CAMm+LwgEVySpfL-iN2uzX-4tu7R+isDkHE9D8uAeLTxxd4VxqQ@mail.gmail.com> <sjmwpxc1kbv.fsf@securerf.ihtfp.org> <CAAS2fgR6LYck+km5Ze6S9z65ZgsR61d8md2CqojDaceZ0OrZrw@mail.gmail.com> <9c2c8c5df67c83925d7e3c21fe943483.squirrel@mail2.ihtfp.org> <CAMm+LwjJ3mdawz92obKRz3NRhbc4veJFgW-u9gvO6sudem=ABg@mail.gmail.com> <sjmoainyzev.fsf@securerf.ihtfp.org> <CAMm+Lwgvt6sApNqNsfUZnmhGGEv4bfj+jFfg=-5cNYauSDzPtQ@mail.gmail.com>
Date: Tue, 04 Aug 2015 11:48:08 -0400
In-Reply-To: <CAMm+Lwgvt6sApNqNsfUZnmhGGEv4bfj+jFfg=-5cNYauSDzPtQ@mail.gmail.com> (Phillip Hallam-Baker's message of "Tue, 4 Aug 2015 10:49:13 -0400")
Message-ID: <sjmsi7zxdfr.fsf@securerf.ihtfp.org>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: quoted-printable
X-Virus-Scanned: Maia Mailguard 1.0.2a
Archived-At: <http://mailarchive.ietf.org/arch/msg/openpgp/dgHEnezsFMpEGrfv-lgoC_nBrJQ>
Cc: Gregory Maxwell <gmaxwell@gmail.com>, IETF OpenPGP <openpgp@ietf.org>, Derek Atkins <derek@ihtfp.com>, Daniel Kahn Gillmor <dkg@fifthhorseman.net>
Subject: Re: [openpgp] Followup on fingerprints
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: Tue, 04 Aug 2015 15:49:17 -0000

Phillip Hallam-Baker <phill@hallambaker.com> writes:

> On Tue, Aug 4, 2015 at 9:08 AM, Derek Atkins <derek@ihtfp.com> wrote:
>
>     Phillip Hallam-Baker <phill@hallambaker.com> writes:
>    
>     >     Luckily my computations (which you unfortunately cut out) were based
>     on 30
>     >     million attempts per second, so my results (the attack taking over a
>     year)
>     >     is still correct!  Indeed, your numbers are still 3x slower than my
>     >     computation estimates.
>     >
>     > Your original assertion was broken. I don't think it very likely that
>     someone
>     > is going to spend more than a machine year to generate a vanity key
>     unless they
>     > can get someone else to pay for the time.
>    
>     Phill, it was *your* proposal that I was talking to, Mallet creating
>     keys M1 and M2 to attack some open source project using PGP Signatures.
>
> That is not a vanity fingerprint, it is an attack. A vanity fingerprint would
> be doing a brute force search for a key whose fingerprint begins
> MINIO-Nxxxx-xxxxx-xxxxx-xxxxx

The "MINIO-Nxxxx-..." vanity fingerprint issue is yet another issue you
brought up, which is still different than this one.  Yes, a vanity key
fingerprint is definitely less work because there are many fewer bits
that you care about.  There's really no way to disallow it that I can
see, but we should definitely remind people to always check the full
fingerprint.

> Spending a hundred computer years to insert malware into an open source project
> is a much more probable attack.

I think you're mis-remembering your attack setup.  The hundred
computer-years effort is for someone to generate two keys that have the
same matching truncated-to-100-bits fingerprint to use in a broken
source code control system that only checks the truncated hash.  But
it's more than that; Mallet has to be trusted to actually push data into
the source repository in the first place.

For your attack scenario to succeed Mallet needs to generate both keys
prior to being added to the project and only then will he be able to
surrepticiously add code.  Of course Mallet needs to have been trusted
enough to get M1 added to the authorized commiters list first!  My point
is that finding an adversary that is trusted enough to get M1 added, and
also a bad player such that they generated an M1 and M2, is probably
going to be hard, because they have to control BOTH keys and generate
them together.  It also depends on this broken truncated-hash system.

That's why I find that attack scenario unlikely.

More likely Mallet would want to find a key that matches an already
trusted key.  This is NOT a collision attack but is a preimage attack;
you know the hash result and need to find a second item that matches.
Luckily that's still a 2^N and not a 2^(N/2) attack, so unachievable
even with your 100-bit truncated hash system.

>
>     So thank you for acknowledging that your original assertion was broken!
>     My point was that particular notion isn't viable; nobody is going to
>     expend that much effort just to be able to spoof a broken source control
>     system.  And moreover, a non-broken system (that uses the full
>     fingerprint) is still out of reach even for stronger adversaries.
>
> The moral here is to use a sufficiently long fingerprint. But the point is that
> the fingerprint is indeed subject to birthday attack under rare circumstances.

I do agree with this.

>     > A hundred machine years for creating a key collision attack is completely
>     > viable.
>    
>     It's only a hundred machine years for a 100-bit collision.  A 160-bit
>     collision is much much further out!
>
> Yes, but if you didn't have to worry about a birthday attack at all, 80 bits
> would be acceptable by that metric.
>
> The point is that 80 bits is sufficient for a KeyID type use but a fingerprint
> should be at least 160 bits. 100/125 and 256 offer some safety margin.

Agreed, which is why we should tell people not to truncate!  :)

>     > Also when we are talking about PGP Key fingerprint, the fingerprint is
>     over the
>     > key binding and not just the key and so it is malleable. 
>    
>     I don't see how that helps (today) with SHA1 or SHA2.
>
> If you are doing RSA, it greatly reduces the cost of a collision attack as you
> can avoid the need to generate new keypairs on each trial. But I don't think
> that is important as we are going to ECC in the near future anyway.

-derek

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