[TLS] Re: Disallowing reuse of ephemeral keys
"D. J. Bernstein" <djb@cr.yp.to> Thu, 12 December 2024 23:56 UTC
Return-Path: <djb-dsn2-1406711340.7506@cr.yp.to>
X-Original-To: tls@ietfa.amsl.com
Delivered-To: tls@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 6D970C14F71F for <tls@ietfa.amsl.com>; Thu, 12 Dec 2024 15:56:41 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.902
X-Spam-Level:
X-Spam-Status: No, score=-1.902 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=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, UNPARSEABLE_RELAY=0.001, URIBL_BLOCKED=0.001, URIBL_DBL_BLOCKED_OPENDNS=0.001, URIBL_ZEN_BLOCKED_OPENDNS=0.001] 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 UE5KM_cZ2U2a for <tls@ietfa.amsl.com>; Thu, 12 Dec 2024 15:56:37 -0800 (PST)
Received: from salsa.cs.uic.edu (salsa.cs.uic.edu [131.193.32.108]) by ietfa.amsl.com (Postfix) with SMTP id 14F88C14F5FB for <tls@ietf.org>; Thu, 12 Dec 2024 15:56:36 -0800 (PST)
Received: (qmail 16029 invoked by uid 1010); 12 Dec 2024 23:56:35 -0000
Received: from unknown (unknown) by unknown with QMTP; 12 Dec 2024 23:56:35 -0000
Received: (qmail 572434 invoked by uid 1000); 12 Dec 2024 23:56:26 -0000
Date: Thu, 12 Dec 2024 23:56:26 -0000
Message-ID: <20241212235626.572432.qmail@cr.yp.to>
From: "D. J. Bernstein" <djb@cr.yp.to>
To: tls@ietf.org
Mail-Followup-To: tls@ietf.org
In-Reply-To: <bf28dd19-0534-4403-8e20-50bcbbc0fcdd@app.fastmail.com>
Message-ID-Hash: LYYGVZIOGYJ6HXZCTSIRWFOKYUNCC3PG
X-Message-ID-Hash: LYYGVZIOGYJ6HXZCTSIRWFOKYUNCC3PG
X-MailFrom: djb-dsn2-1406711340.7506@cr.yp.to
X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-tls.ietf.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header
X-Mailman-Version: 3.3.9rc6
Precedence: list
Subject: [TLS] Re: Disallowing reuse of ephemeral keys
List-Id: "This is the mailing list for the Transport Layer Security working group of the IETF." <tls.ietf.org>
Archived-At: <https://mailarchive.ietf.org/arch/msg/tls/MQJYiSX5y0FIUu380nh9DI0kwe4>
List-Archive: <https://mailarchive.ietf.org/arch/browse/tls>
List-Help: <mailto:tls-request@ietf.org?subject=help>
List-Owner: <mailto:tls-owner@ietf.org>
List-Post: <mailto:tls@ietf.org>
List-Subscribe: <mailto:tls-join@ietf.org>
List-Unsubscribe: <mailto:tls-leave@ietf.org>
Filippo Valsorda writes: > Both ECDH and KEMs support key share (or public key) reuse *in theory* > but in practice it makes implementation issues much more likely to be > practically exploitable Is there quantification and justification for the "much" claim? Perhaps the allusion here is to examples of implementation-attack demos that reuse keys---e.g., https://kyberslash.cr.yp.to recovering Kyber keys from timings of the Kyber reference software with some compilers. But it's an error to leap from ~"this demo reuses keys" to ~"avoiding key reuse will make the Kyber reference software hard to exploit". I'm not aware of any papers studying the latter claim. I'm not saying that it's clear that switching keys doesn't help security overall. I'm saying we shouldn't overstate the evidence that it helps. Meanwhile the normal ways to set up TLS servers are reusing identity keys for _at least_ months. If key reuse is a security problem, should we be recommending faster rotation of identity keys? Or is signature software being claimed to be somehow immune to implementation attacks? As a side note, one of the attractions of replacing signatures with KEMs for identity keys is removing the signing software as an attack target (even if verification software is still used for signatures from CAs). But this needs the KEM software to be safe for keys used many times. > the hypothetical performance gain of reuse is marginal This is not hypothetical. For example, kyber768 is reported in https://bench.cr.yp.to/results-kem/amd64-alder2,1f626960,5600000.html to take slightly over 30000 cycles for key generation on Golden Cove (Intel Alder Lake performance cores). Sure, there's also a cost to retrieving an existing key from cache, but the measurements in https://chipsandcheese.com/p/alder-lakes-caching-and-power-efficiency show 4 P-cores on a Core i9-12900K together sustaining 800GB/second from L2 cache, so (given that the CPU runs between 3.2GHz and 5.2GHz) reading a few KB on one core is on the scale of 100 cycles, never mind the time saved for cache misses for usually skipping the key-generation code. People who use, e.g., ntruhrss701 to stay away from Kyber's patent issues are incurring nearly 200000 cycles for key generation on the same cores, although https://cr.yp.to/papers.html#opensslntru explains how to reduce this cost. For X25519, https://lib25519.cr.yp.to/speed.html shows 24000 cycles for key generation on Golden Cove. As for "marginal": On an absolute scale? By comparison to something else? Looking at the big picture of costs is good, but this "marginal" claim is ambiguous, missing quantification, and missing justification. In ongoing discussions over on CFRG, some of us have proposed requiring extra hashing in hybrids, but there has been an objection claiming that "saving a single hash in TLS saves compute time worth millions of dollars/CO2 emissions/energy" (at Internet scale or at Google scale; hasn't been clarified). Key reuse in the cryptosystems under discussion saves more computation than that. It's inconsistent for IETF/IRTF to have a larger cost dismissed as "marginal" while a smaller cost is treated as a decision-making factor. (And, yes, this is _exactly_ the sort of thing that exposes IETF to antitrust liability.) I should emphasize that using cost arguments to hold back security mechanisms is very often a mistake, and I wouldn't be surprised if further consideration ends up settling on thread option 2 or 3. But cost arguments in any direction should be clear, quantified, and justified. ---D. J. Bernstein
- [TLS] Re: Disallowing reuse of ephemeral keys Richard Barnes
- [TLS] Re: Disallowing reuse of ephemeral keys Russ Housley
- [TLS] Re: Disallowing reuse of ephemeral keys Filippo Valsorda
- [TLS] Re: Disallowing reuse of ephemeral keys Richard Barnes
- [TLS] Re: [EXTERNAL] Re: Disallowing reuse of eph… Andrei Popov
- [TLS] Re: [EXTERNAL] Re: Disallowing reuse of eph… Christian Huitema
- [TLS] Re: Disallowing reuse of ephemeral keys Eric Rescorla
- [TLS] Re: [EXTERNAL] Re: Disallowing reuse of eph… Andrei Popov
- [TLS] Re: Disallowing reuse of ephemeral keys Peter Gutmann
- [TLS] Re: Disallowing reuse of ephemeral keys Thom Wiggers
- [TLS] Re: Disallowing reuse of ephemeral keys Bas Westerbaan
- [TLS] Re: Disallowing reuse of ephemeral keys Loganaden Velvindron
- [TLS] Re: [EXTERNAL] Disallowing reuse of ephemer… Alicja Kario
- [TLS] Re: Disallowing reuse of ephemeral keys Martin Thomson
- [TLS] Re: [EXTERNAL] Disallowing reuse of ephemer… Scott Fluhrer (sfluhrer)
- [TLS] Re: [EXTERNAL] Disallowing reuse of ephemer… Richard Barnes
- [TLS] Re: [EXTERNAL] Disallowing reuse of ephemer… Scott Fluhrer (sfluhrer)
- [TLS] Re: Disallowing reuse of ephemeral keys Scott Fluhrer (sfluhrer)
- [TLS] Re: [EXTERNAL] Disallowing reuse of ephemer… Dang, Quynh H. (Fed)
- [TLS] Re: [EXTERNAL] Re: Disallowing reuse of eph… Andrei Popov
- [TLS] Re: Disallowing reuse of ephemeral keys Stephen Farrell
- [TLS] Re: [EXTERNAL] Re: Disallowing reuse of eph… Viktor Dukhovni
- [TLS] Re: [EXTERNAL] Re: Disallowing reuse of eph… Sophie Schmieg
- [TLS] Re: Disallowing reuse of ephemeral keys Joseph Salowey
- [TLS] Re: [EXTERNAL] Re: Disallowing reuse of eph… John Mattsson
- [TLS] Disallowing reuse of ephemeral keys Joseph Salowey
- [TLS] Re: [EXTERNAL] Disallowing reuse of ephemer… Richard Barnes
- [TLS] Re: [EXTERNAL] Re: Disallowing reuse of eph… Joseph Birr-Pixton
- [TLS] Re: [EXTERNAL] Re: Disallowing reuse of eph… Eric Rescorla
- [TLS] Re: Disallowing reuse of ephemeral keys D. J. Bernstein