[CFRG] Re: Do we have unsafe uses of Ed448 and Ed25519? Fix, Ed448?
Mike Hamburg <mike@shiftleft.org> Wed, 11 September 2024 22:08 UTC
Return-Path: <mike@SHIFTLEFT.ORG>
X-Original-To: cfrg@ietfa.amsl.com
Delivered-To: cfrg@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id C462EC180B43 for <cfrg@ietfa.amsl.com>; Wed, 11 Sep 2024 15:08:04 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -7.107
X-Spam-Level:
X-Spam-Status: No, score=-7.107 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_HI=-5, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01, URIBL_DBL_BLOCKED_OPENDNS=0.001, URIBL_ZEN_BLOCKED_OPENDNS=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=shiftleft.org
Received: from mail.ietf.org ([50.223.129.194]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id cg4HnNwPLYBM for <cfrg@ietfa.amsl.com>; Wed, 11 Sep 2024 15:08:00 -0700 (PDT)
Received: from wanderer.shiftleft.org (wanderer.shiftleft.org [IPv6:2600:3c01::f03c:92ff:fec5:c23c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-256) server-digest SHA256) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id AEB7AC14F689 for <cfrg@irtf.org>; Wed, 11 Sep 2024 15:08:00 -0700 (PDT)
Received: from localhost (localhost [127.0.0.1]) (Authenticated sender: mike) by wanderer.shiftleft.org (Postfix) with ESMTPSA id 06781431E3; Wed, 11 Sep 2024 22:07:58 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=shiftleft.org; s=sldo; t=1726092479; bh=DHeO6P8CtN6AhHcr6jnAt/zCV8jNaC6hUoxpO63p7r4=; h=Subject:From:In-Reply-To:Date:Cc:References:To:From; b=ISBsTSsOWZonxM0EPVFBVRM1bVl4Q6fPMXsdrfE68d3XclX4IElCofSnFzE7pqePE oz6JcsbH1cDQuD3Zboo8FmgqZt2i4WUQYGdNyfK6R29Fgo2HUiWwJWuATeNCf9Zjop G9mg/e/BTNNrcQfWkMaSYQs6hNosTu9fhrCslZ+M=
Content-Type: text/plain; charset="utf-8"
Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3776.700.51\))
From: Mike Hamburg <mike@shiftleft.org>
In-Reply-To: <OV7i63Kz9_IMuFlqp6KSQMuK7kd69XgYV5PQ54cb1CLZWvQZJcdG8lejYhsdOGQbuupqW62NkAyoNyE5kYw78ScsOcmFRDskI_AavmQJ-2c=@proton.ch>
Date: Wed, 11 Sep 2024 15:07:48 -0700
Content-Transfer-Encoding: quoted-printable
Message-Id: <7FB015F4-92E8-4FBA-AD89-45CFDB449D15@shiftleft.org>
References: <f49bcf97-1612-4252-b682-60b7a868f500@gmail.com> <CA345BC5-C207-4212-A556-EC2DF6E304EF@shiftleft.org> <OV7i63Kz9_IMuFlqp6KSQMuK7kd69XgYV5PQ54cb1CLZWvQZJcdG8lejYhsdOGQbuupqW62NkAyoNyE5kYw78ScsOcmFRDskI_AavmQJ-2c=@proton.ch>
To: Daniel Huigens <daniel.huigens@proton.ch>
Message-ID-Hash: MQ6V54YCA7VFNDWJM6HLPWYEDDSZF2NK
X-Message-ID-Hash: MQ6V54YCA7VFNDWJM6HLPWYEDDSZF2NK
X-MailFrom: mike@SHIFTLEFT.ORG
X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-cfrg.irtf.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header
CC: Dan Brown <dan.brown.cryptographer@gmail.com>, cfrg@irtf.org
X-Mailman-Version: 3.3.9rc4
Precedence: list
Subject: [CFRG] Re: Do we have unsafe uses of Ed448 and Ed25519? Fix, Ed448?
List-Id: Crypto Forum Research Group <cfrg.irtf.org>
Archived-At: <https://mailarchive.ietf.org/arch/msg/cfrg/LOhGJRphrvH8GiwGyzOJl0MFRck>
List-Archive: <https://mailarchive.ietf.org/arch/browse/cfrg>
List-Help: <mailto:cfrg-request@irtf.org?subject=help>
List-Owner: <mailto:cfrg-owner@irtf.org>
List-Post: <mailto:cfrg@irtf.org>
List-Subscribe: <mailto:cfrg-join@irtf.org>
List-Unsubscribe: <mailto:cfrg-leave@irtf.org>
Hi Daniel, Sorry you’re right, I misread the RFC. More precisely, the prehash function is a parameter in the overall construction, but ed25519ph and ed448ph fix that parameter. Regards, — Mike > On Sep 11, 2024, at 2:26 PM, Daniel Huigens <daniel.huigens@proton.ch> wrote: > > Hi Mike, > > On Wednesday, September 11th, 2024 at 22:35, Mike Hamburg wrote: >> Phillip points out that this vulnerability applies to EdDSA with prehash mode, because it doesn’t have a firewall at all, except between “yes prehash” and “no prehash". EdDSA uses a fixed hash function internally: SHA-512 for Ed25519, or SHAKE256 for Ed448. But the prehash mode signs the hash of a message, without indicating what hash function was used. > > Ed25519ph and Ed448ph do indicate which pre-hash functions are used, > by simply hardcoding them - to the same functions that are used inside > PureEdDSA: SHA-512 for Ed25519 and SHAKE256 for Ed448. > > And as specified, the message is pre-hashed inside the function, > so there should be no risk of using the wrong one - although some > implementations do allow passing a hash that was computed externally > by the application, but obviously to remain compliant it needs to use > the specified hash function (and this is usually properly documented > as far as I've seen). > >> So if an attacker can convince a victim to use a weak hash for verification > > .. then they wouldn't be using Ed25519ph or Ed448ph, but some broken > variant of it. I don't think there's much we can do to protect > against that. > > Phillip's message, as I understood it, was more about the case where the > signer decides to use e.g. Ed448(SHA512(M)) rather than Ed448ph(M) > because they don't like SHAKE, or so. That's when the hash function > firewall is missing, and the context parameter could be used to add it > back. > > Best, > Daniel
- [CFRG] Do we have unsafe uses of Ed448 and Ed2551… Dan Brown
- [CFRG] Re: Do we have unsafe uses of Ed448 and Ed… Mike Hamburg
- [CFRG] Re: Do we have unsafe uses of Ed448 and Ed… Daniel Huigens
- [CFRG] Re: Do we have unsafe uses of Ed448 and Ed… Mike Hamburg