Re: [openpgp] Fingerprints and their collisions resistance

Andrey Jivsov <openpgp@brainhub.org> Fri, 04 January 2013 05:35 UTC

Return-Path: <openpgp@brainhub.org>
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 00FB621F8E42 for <openpgp@ietfa.amsl.com>; Thu, 3 Jan 2013 21:35:51 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -0.437
X-Spam-Level:
X-Spam-Status: No, score=-0.437 tagged_above=-999 required=5 tests=[BAYES_00=-2.599, FH_RELAY_NODNS=1.451, HELO_MISMATCH_NET=0.611, RDNS_NONE=0.1]
Received: from mail.ietf.org ([64.170.98.30]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 9GdCV8o9-M9v for <openpgp@ietfa.amsl.com>; Thu, 3 Jan 2013 21:35:50 -0800 (PST)
Received: from qmta13.emeryville.ca.mail.comcast.net (qmta13.emeryville.ca.mail.comcast.net [IPv6:2001:558:fe2d:44:76:96:27:243]) by ietfa.amsl.com (Postfix) with ESMTP id 4BDBE21F8DF2 for <openpgp@ietf.org>; Thu, 3 Jan 2013 21:35:50 -0800 (PST)
Received: from omta15.emeryville.ca.mail.comcast.net ([76.96.30.71]) by qmta13.emeryville.ca.mail.comcast.net with comcast id jhQk1k0061Y3wxoADhbqtB; Fri, 04 Jan 2013 05:35:50 +0000
Received: from [192.168.1.8] ([69.181.162.123]) by omta15.emeryville.ca.mail.comcast.net with comcast id jhbo1k0072g33ZR8bhbpt8; Fri, 04 Jan 2013 05:35:49 +0000
Message-ID: <50E66A34.8080702@brainhub.org>
Date: Thu, 03 Jan 2013 21:35:48 -0800
From: Andrey Jivsov <openpgp@brainhub.org>
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:13.0) Gecko/20120605 Thunderbird/13.0
MIME-Version: 1.0
To: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
References: <50E530D6.6020609@brainhub.org> <50E5494E.6090905@iang.org> <50E60748.3040103@brainhub.org> <50E60F7A.8000001@fifthhorseman.net> <50E61BF7.4020905@brainhub.org> <50E65A28.1070501@fifthhorseman.net>
In-Reply-To: <50E65A28.1070501@fifthhorseman.net>
Content-Type: text/plain; charset="UTF-8"; format="flowed"
Content-Transfer-Encoding: 7bit
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net; s=q20121106; t=1357277750; bh=SBWXdM9m7T3nwl+f+81RbzJABaCGHjJFX5OsYeMabsk=; h=Received:Received:Message-ID:Date:From:MIME-Version:To:Subject: Content-Type; b=GU9fCMq+gMODbHKkSiP6almaIVqTu8UAMsyU+jym6YPpJuMLu2ukMpb2OJMUD4Fa7 N3d5/xKziJprh2jdcDH/eJmMBfiyb999lGzzkrG4aan8vfd6fNXNbnKq/2+gl7DBbN nzk56obGWcuS2ubcJEB1rVwJOx79FgDPAYNu94c+wIC11E7Nl1xUPBsifa/+q2QmUw PSyUrEXClPgUwJvfpn5jnqIzBWG8EAv8UOmGHhCMPJ42gNLIf9a+SVC3Rsi5DBFbuW agK3mixp8pA1PMN/Msg1qS9I7XkHXyh9ZhlOQ3j9mBE/sJ3V6P2lt4v4J2D0A76uxF /w8gsMKCTFq3g==
Cc: openpgp@ietf.org
Subject: Re: [openpgp] Fingerprints and their collisions resistance
X-BeenThere: openpgp@ietf.org
X-Mailman-Version: 2.1.12
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: <http://www.ietf.org/mail-archive/web/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: Fri, 04 Jan 2013 05:35:51 -0000

On 01/03/2013 08:27 PM, Daniel Kahn Gillmor wrote:
> On 01/03/2013 07:01 PM, Andrey Jivsov wrote:
>
>> Let's say I have a server that manages a domain of user, each have their
>> own key, one at a time. Users can update their keys. They cannot remove
>> keys (other than updating them). The server logs protocol actions and it
>> uses key fingerprints to log changed to keys. The server decide to log
>> the whole key on the key material change event, which it identifies by
>> the change in the key fingerprint. Seems like a reasonable and secure
>> system at first sight.
>
> This sounds like a system that explicitly ignores the warning in RFC 4880:
>
>>>     Note that there is a much
>>>     smaller, but still non-zero, probability that two different keys have
>>>     the same fingerprint.
>
> https://tools.ietf.org/html/rfc4880#page-72

Sure, shorter fingerprints are good for humans...

On the other hand, my reading of the above quote is that this is a 
general warning about the 1/2^80 probability of a collision.

SHA-1 collision at 1/2^51 probability is a different story.

I wouldn't assume that real-world OpenPGP systems today are written to 
handle collisions in 20 byte OpenPGP fingerprints. That would "never" 
happen in practice.

Furthermore, I think there are probably no systems that deal with
KeyID collisions either. KeyID collisions have a chance to happen at a 
rate of 1/2^32 -- readily observable. I am guessing that the problem is 
currently avoided by application design, which eliminates scenarios of 
large number of messages signed/encrypted by different users, all in one 
pile. Usually a metadata like UserIDs, SMTP headers, etc, is used first 
to filter messages/locate keys.

It seems to me that instead of fixing the software to handle fingerprint 
collisions, I would consider diverting this effort to introduce the new 
fingerprint instead.

>
> The purpose of a fingerprint is for one human to be able to securely
> verify the key of another peer.  This means that they must be short
> enough for humans to understand them, and they must resist preimage
> attacks (no one should be able to come up with a new key that matches an
> arbitrary fingerprint).

RFC4880 also specifies how fingerprints are stored to identify revokers, 
and they are a truncated to produce keyIDs. The point is that it's nice 
to have a single general-purpose method without flaws.

>
> If your argument is "existing tools misuse fingerprints (and even
> keyids) and treat them as unique identifiers when they should not" then
> i'd have to agree with you.  We need to fix those tools.  If the
> argument is "fingerprints need to be resistant to collision attacks, not
> just preimage attacks because we want to be able to use them as unique
> identifiers in cases like this that would allow for repudiation of
> previously-signed messages where the earlier key was not properly
> stored", then you're effectively doubling the length of the required
> fingerprint for the sake of some problem better solved another way.  i
> think that would defeat (or at least severely damage) the ability for
> human beings to actually cognitively process the fingerprint.

I am saying that let's pack as much security bits into fingerprints as 
the current state of the art allows. 256 bit fingerprint should mean at 
least 128 bit security under any scenario, regardless of higher-level 
protocols. This adds clarity to security properties of the system and 
gets rid of (almost) non-compliant use of SHA-1.

> It's arguably too difficult already for humans to accurately compare or
> transcribe 160 bits of high-entropy data.  Asking them to compare or
> transcribe larger fingerprints seems likely to result in operator error.

I will guess that humans are unlikely to compares full fingerprints 
anyway. They start from (hopefully :-)) the same end of hex digits and 
stop somewhere along the way. If fingerprints to become 256 bit long, 
this may turn out to be unnoticeable.

>
> 	--dkg
>