Re: [lamps] [EXTERNAL] Re: [CFRG] [pqc-forum] RE: Whether to hash-then-sign with Dilithium and Falcon?
Phillip Hallam-Baker <phill@hallambaker.com> Fri, 19 August 2022 19:44 UTC
Return-Path: <hallam@gmail.com>
X-Original-To: spasm@ietfa.amsl.com
Delivered-To: spasm@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id DC5FBC159820 for <spasm@ietfa.amsl.com>; Fri, 19 Aug 2022 12:44:56 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -6.411
X-Spam-Level:
X-Spam-Status: No, score=-6.411 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, FREEMAIL_FORGED_FROMDOMAIN=0.248, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H2=-0.001, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01] autolearn=ham autolearn_force=no
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 awiTlgoYZrm5 for <spasm@ietfa.amsl.com>; Fri, 19 Aug 2022 12:44:55 -0700 (PDT)
Received: from mail-oi1-f178.google.com (mail-oi1-f178.google.com [209.85.167.178]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id B54E5C14CE42 for <spasm@ietf.org>; Fri, 19 Aug 2022 12:44:34 -0700 (PDT)
Received: by mail-oi1-f178.google.com with SMTP id w197so5851758oie.5 for <spasm@ietf.org>; Fri, 19 Aug 2022 12:44:34 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc; bh=UFivYmv99ZTsmO4yDDqux53ms8IXc+XR41wjSK7wklI=; b=t7GRMJ/q/eNJZzxxbh52FbOerst9881KIsjg85R67CXJUgGsfdNLUyf2mzy8iEv4rO vb2d+NnjjjUkWMmyhowqn2l75SyHrS+7U8EUZ+B/eC2DY5waIWfSexQqYwy2JeWXMb5j eTFfZtXJCQO6bofmNPyuqqy0eqdgBXR1TW7q1fI6zsDGfaHh9YJCje2GlDQgSMFC7WSP v3SeIYKJB4aQSWc67HwJrQ6VRBWQbTv6KU72OhvkxqMnhlWf8nHCBbrHb5yLnCUnWs/7 tYuFKkMYkIiQ4Azn4RsDKPxGjk8gJvGwFFJsqIj7t9h1Yy2wnlcc8BNWU4PilgQNtOpL Y0/Q==
X-Gm-Message-State: ACgBeo0DYUXw5qd1xubq//VLGeWiXVypnQmbrrquladh212oIypTjMyw THtofEeaAhkW5uZ6TN1lvM1ZAAgvzps8ATN6ySw=
X-Google-Smtp-Source: AA6agR6B0jksGwCsoUfH5/Qt54ZLZlbRmkUXU4qhQp7NUcsAZ0GiQhYFB6h/4rdYD2OGiG+QwMi2xpCrN3PcFY0z8x4=
X-Received: by 2002:a05:6808:124d:b0:322:3600:d84a with SMTP id o13-20020a056808124d00b003223600d84amr6502331oiv.108.1660938273868; Fri, 19 Aug 2022 12:44:33 -0700 (PDT)
MIME-Version: 1.0
References: <CH0PR11MB5739393F19DD5282E3D7EF549F6A9@CH0PR11MB5739.namprd11.prod.outlook.com> <CH0PR11MB5444B9D3A0CB6E447A2FA3E5C16A9@CH0PR11MB5444.namprd11.prod.outlook.com> <88358933-A540-4000-9C7D-D248F670122F@amazon.com> <CAFTXyYC=Zt0hhk5G2A6b6AOM6Aww7jL3CwUmcZfNpmsWW0cpGQ@mail.gmail.com> <DM6PR11MB2585E47B6D7D92EBC1E71A29EA6D9@DM6PR11MB2585.namprd11.prod.outlook.com> <CAMm+LwiCxwv6smMSL4u+3dnBYWDkStE4pBXh25GKAuaVj+nehg@mail.gmail.com> <CH0PR11MB5739054876AF545FCA6DEA749F6C9@CH0PR11MB5739.namprd11.prod.outlook.com>
In-Reply-To: <CH0PR11MB5739054876AF545FCA6DEA749F6C9@CH0PR11MB5739.namprd11.prod.outlook.com>
From: Phillip Hallam-Baker <phill@hallambaker.com>
Date: Fri, 19 Aug 2022 15:44:22 -0400
Message-ID: <CAMm+LwihTg8fC17SYLO-iPVj3ahxcaFBX-0mhtYZFMHkU_RtCA@mail.gmail.com>
To: Mike Ounsworth <Mike.Ounsworth@entrust.com>
Cc: LAMPS <spasm@ietf.org>, "cfrg@irtf.org" <cfrg@irtf.org>, pqc-forum <pqc-forum@list.nist.gov>
Content-Type: multipart/alternative; boundary="000000000000ced03205e69d53fe"
Archived-At: <https://mailarchive.ietf.org/arch/msg/spasm/sMnFr6EJAScEnLDuV9qRCVwdPpg>
Subject: Re: [lamps] [EXTERNAL] Re: [CFRG] [pqc-forum] RE: Whether to hash-then-sign with Dilithium and Falcon?
X-BeenThere: spasm@ietf.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: "This is a venue for discussion of doing Some Pkix And SMime \(spasm\) work." <spasm.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/spasm>, <mailto:spasm-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/spasm/>
List-Post: <mailto:spasm@ietf.org>
List-Help: <mailto:spasm-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/spasm>, <mailto:spasm-request@ietf.org?subject=subscribe>
X-List-Received-Date: Fri, 19 Aug 2022 19:44:57 -0000
On Fri, Aug 19, 2022 at 1:55 PM Mike Ounsworth <Mike.Ounsworth@entrust.com> wrote: > Phillip, > > > > > That is not a new issue and it is one that we discussed at great length > for RSA. The hash of the digest is part of the signature payload to prevent > substitution attacks. > > > > > > I think you are in fact mistaking the problem that we’re trying to solve / > trying not to un-solve. Nobody is suggesting hash downgrade or substitution > attacks. As you point out, that is already solved by existing protocols. > > > > Taking Falcon as an example, the problem as I understand it is that the > first internal step of Falcon is: > > > > Sign(m): > > r = rand(320); > > c = SHAKE(r || m); > > … > > output (r, s) > > > > Verify(r, s, m): > > c = SHAKE(r || m); > > > Oh right. So far I am up the Kyber pass and have not done Dilithium yet. this has the nice property that `r` is generated at signing time by the > signer. So should SHAKE develop a collision attack similar to the one we > saw for SHA1, then the collision pre-computation as still intractable for > the attacker because the attacker cannot not know `r` in advance. > (Disclaimer: I am just an engineer trying to wrap my head around this, > corrections welcome!). > Meh, seems like an unnecessary concern. And I am not sure how this actually helps against collision attacks in general. If SHAKE is broken, then we are going to have so many problems that the security of the signature algorithm is irrelevant. As a matter of protocol composition, the signature algorithm should not be trying to fix a potential issue in the digest algorithm because things are going to be breaking all over. > So the concern with hash-then-sign is that if `m` above is itself a > message digest, ie `m = SHA256(M)`, then you have un-done the collision > resistance that is built in to the Falcon primitive, essentially reducing > the security properties of Falcon. Adding the message digest to the signed > content does not help if the attacker is holding two messages with the same > SHA256 hash. > If this is a useful approach, then move it out of the signature primitive and push it into the envelope format. > My simplified-to-the-point-of-being-wrong understanding is that this would > be no worse than what we do with RSA and therefore might be acceptable in > some use cases, but it is also ignoring cryptographic improvements beyond > RSA. > > > > Disclaimer: this whole email should be viewed as a question that we are > seeking confirmation of. > > > > --- > > *Mike* Ounsworth > > > > *From:* Phillip Hallam-Baker <phill@hallambaker.com> > *Sent:* August 18, 2022 10:29 PM > *To:* John Gray <John.Gray=40entrust.com@dmarc.ietf.org> > *Cc:* Tadahiko Ito <tadahiko.ito.public@gmail.com>; Massimo, Jake > <jakemas=40amazon.com@dmarc.ietf.org>; Scott Fluhrer (sfluhrer) < > sfluhrer@cisco.com>; Mike Ounsworth <Mike.Ounsworth@entrust.com>; LAMPS < > spasm@ietf.org>; cfrg@irtf.org; pqc-forum <pqc-forum@list.nist.gov>; > Kampanakis, Panos <kpanos@amazon.com>; sean@ssn3rd.com; > bas@westerbaan.name > *Subject:* Re: [lamps] [EXTERNAL] Re: [CFRG] [pqc-forum] RE: Whether to > hash-then-sign with Dilithium and Falcon? > > > > > > > > On Thu, Aug 18, 2022 at 11:29 AM John Gray <John.Gray= > 40entrust.com@dmarc.ietf.org> wrote: > > Thanks Tadahiko, > > > > I read through your paper, and it covers exactly the usability issues we > have come across! We were wondering if it is possible to perform the > specific hashing external to the server (which could be an HSM as in your > paper, or timestamp server, etc). For example, for Dilithium the mu := > CRH( tr || M) and for Falcon it would be c <- HashToPoint(r || m, q, n). > Your paper answers that question, it can be done for Falcon, but not > Dilithium (without changing the signature output). So part of our > question is whether using a regular external Hash as we do today for RSA > and ECDSA (and what you call a boundary type B) somehow reduces the > security and we shouldn’t recommend it. We are interested in this because > we are looking at defining composite pairs or triples which combine > existing signature algorithms like RSAWithSHA256 and ECDSAWithSHA256 with > Falcon or Dilithium. Having to change the operational paradigm for an > HSM or something like a timestamping server would result in large amounts > of data having to be piped across the internet for signatures (as you point > out in your paper). > > > > For our composite signature use case it brings up similar questions. We > can support a mode where external hashing is done once, and then > individually signed by the components (this makes it much more efficient) > both internally and externally for the HSM, timestamping, code signing > use-cases. However, in the case of Dilithium there would need to be two > signature modes Sig = Dilithium (Message) and the other would be Sig = > Dilithium ( HASH (Message)). I don’t think that is necessarily a bad > thing as long as it is standardized and secure. Alternatively, we could > support independent hashing for each component, but that gets strange if > you are doing an external hash for ECDSA, but then need to send the whole > data for Dilithium. We would likely have to end up supporting sending the > whole data if external hashing compromises security of the PQC composites, > but then it is even more inefficient as each component would need to hash > independently. You also covers this in section 4.3 your paper: > > > > “We can construct type B cryptographic boundaries by adding one more hash > function before the execution of PQC’s signature generation algorithm… This > approach would improve the efficiency of lattice based digital signature > schemes deployed in HSM. It would have a greater impact on Dilithium, but > also be applicable to Falcon and other digital signature schemes. Two modes > of PQC algorithms utilizing this approach will be able to exist, namely, a > PQC algorithm without an additional hash (i.e. original PQC algorithm) and > a PQC algorithm with an additional hash. If there are two modes of a > digital signature scheme, then the asymmetric operation for those two modes > must not be identical. The reason is that, obtaining a signature from the > mode with an additional hash function would help attackers who can attack > another mode which is without the additional hash function.” > > > > That is not a new issue and it is one that we discussed at great length > for RSA. The hash of the digest is part of the signature payload to prevent > substitution attacks. > > > > I am finding the description of the problem here to be making assumptions > about what 'formal proofs' are demonstrating that are probably > demonstrating something else. If you assume there is only one true digest > function, you 'solve' the digest substitution problem by pretending it does > not exist... > > > > > > In my view, the signature function should be over the payload and the > additional authenticated data. Whether this is the OID of the digest > algorithm alone or something more depends on the signature scheme. That is > what JOSE etc. have to sort out. > > > > Preventing a digest downgrade attack may be considered the concern of the > cryptographic envelope format because there may be more than one form of > downgrade attack to be considered. But it is also something we have > traditionally included in the signature... > > > > > *Any email and files/attachments transmitted with it are confidential and > are intended solely for the use of the individual or entity to whom they > are addressed. If this message has been sent to you in error, you must not > copy, distribute or disclose of the information it contains. Please notify > Entrust immediately and delete the message from your system.* >
- [lamps] Whether to hash-then-sign with Dilithium … Mike Ounsworth
- Re: [lamps] Whether to hash-then-sign with Dilith… Scott Fluhrer (sfluhrer)
- Re: [lamps] Whether to hash-then-sign with Dilith… Mike Ounsworth
- Re: [lamps] [pqc-forum] RE: Whether to hash-then-… Massimo, Jake
- Re: [lamps] [CFRG] [pqc-forum] RE: Whether to has… Tadahiko Ito
- Re: [lamps] [EXTERNAL] Re: [CFRG] [pqc-forum] RE:… John Gray
- Re: [lamps] [EXTERNAL] Re: [CFRG] [pqc-forum] RE:… Phillip Hallam-Baker
- Re: [lamps] [EXTERNAL] Re: [CFRG] [pqc-forum] RE:… Mike Ounsworth
- Re: [lamps] [EXTERNAL] Re: [CFRG] [pqc-forum] RE:… Phillip Hallam-Baker
- Re: [lamps] [EXTERNAL] Re: [CFRG] [pqc-forum] RE:… Blumenthal, Uri - 0553 - MITLL
- Re: [lamps] [EXTERNAL] Re: [CFRG] [pqc-forum] RE:… Mike Ounsworth
- Re: [lamps] Whether to hash-then-sign with Dilith… D. J. Bernstein
- Re: [lamps] [EXTERNAL] Re: [CFRG] [pqc-forum] RE:… Tadahiko Ito