Re: [Cfrg] Internal collisions

"D. J. Bernstein" <djb@cr.yp.to> Tue, 04 August 2015 12:07 UTC

Return-Path: <djb-dsn2-1406711340.7506@cr.yp.to>
X-Original-To: cfrg@ietfa.amsl.com
Delivered-To: cfrg@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 5230B1A1B5B for <cfrg@ietfa.amsl.com>; Tue, 4 Aug 2015 05:07:07 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: 4.018
X-Spam-Level: ****
X-Spam-Status: No, score=4.018 tagged_above=-999 required=5 tests=[BAYES_50=0.8, HELO_EQ_NL=0.55, HOST_EQ_NL=1.545, RCVD_IN_DNSWL_NONE=-0.0001, UNPARSEABLE_RELAY=0.001, URI_HEX=1.122] 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 WoMlT2yLzwwc for <cfrg@ietfa.amsl.com>; Tue, 4 Aug 2015 05:07:05 -0700 (PDT)
Received: from calvin.win.tue.nl (calvin.win.tue.nl [131.155.70.11]) by ietfa.amsl.com (Postfix) with SMTP id 536891A1B4B for <cfrg@irtf.org>; Tue, 4 Aug 2015 05:07:04 -0700 (PDT)
Received: (qmail 24965 invoked by uid 1017); 4 Aug 2015 12:07:22 -0000
Received: from unknown (unknown) by unknown with QMTP; 4 Aug 2015 12:07:22 -0000
Received: (qmail 14620 invoked by uid 1000); 4 Aug 2015 12:06:49 -0000
Date: Tue, 04 Aug 2015 12:06:49 -0000
Message-ID: <20150804120649.14618.qmail@cr.yp.to>
From: "D. J. Bernstein" <djb@cr.yp.to>
To: cfrg@irtf.org
Mail-Followup-To: cfrg@irtf.org
In-Reply-To: <835167F7-82CB-439F-98BC-CE5502DC830E@gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
Archived-At: <http://mailarchive.ietf.org/arch/msg/cfrg/9wfoNxhMv4ABbGioI_9lHkIevWg>
Subject: Re: [Cfrg] Internal collisions
X-BeenThere: cfrg@mail.ietf.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: Crypto Forum Research Group <cfrg.mail.ietf.org>
List-Unsubscribe: <https://mail.ietf.org/mailman/options/cfrg>, <mailto:cfrg-request@mail.ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/cfrg/>
List-Post: <mailto:cfrg@mail.ietf.org>
List-Help: <mailto:cfrg-request@mail.ietf.org?subject=help>
List-Subscribe: <https://mail.ietf.org/mailman/listinfo/cfrg>, <mailto:cfrg-request@mail.ietf.org?subject=subscribe>
X-List-Received-Date: Tue, 04 Aug 2015 12:07:07 -0000

http://ed25519.cr.yp.to/cfrg/signatures.py now includes 'ford'.

Bryan Ford writes:
> I would like to hear your thoughts on how these security considerations change
> when H is not a traditional hash but a sponge-based hash, where the internal
> “pipe” state consists of both the ‘rate’ bits and the always-internal
> ‘capacity’ bits (say, chosen to be twice the security parameter).

The big picture is that H(M,R) is never collision-resilient. In more
detail:

   * Sponge hashes and other wide-pipe hashes: H(M,R) is resilient only
     to _external_ collisions, not to _internal_ collisions.

   * Traditional hashes: There's no meaningful difference between
     internal collisions and external collisions. (There's a formal
     difference: when the hash-function state includes the length, a
     full internal collision requires messages of the same length. This
     isn't a meaningful difference: cryptanalysis naturally finds
     collisions of the same length, and attackers can usually do a ton
     of damage without changing the message length.)

I'm not saying that there's a large risk of collisions in either SHA-2
or SHA-3. I'm saying that people who are worried about this risk and
want to mitigate it should not accept H(M,R) as a substitute for H(R,M);
H(R,M) is a serious defense, while H(M,R) is only marginally safer than
the fast H(M) options.

I commented at the Prague meeting that security issues will take more
time to understand than implementation issues. H(M,R) is one of several
examples; Dan Brown's suggestion (basically, using H(M,R)/f(R) as a
hash) is another example. I understand that the chairs would like to
select something quickly but I'm concerned about the possibility that
rushing will compromise security.

---Dan