[CFRG] Re: [EXTERNAL] Re: ML-KEM side channels and NoIC / OQUAKE
Sophie Schmieg <sschmieg@google.com> Fri, 31 October 2025 23:03 UTC
Return-Path: <sschmieg@google.com>
X-Original-To: cfrg@mail2.ietf.org
Delivered-To: cfrg@mail2.ietf.org
Received: from localhost (localhost [127.0.0.1]) by mail2.ietf.org (Postfix) with ESMTP id 8440D7FC5C7D for <cfrg@mail2.ietf.org>; Fri, 31 Oct 2025 16:03:47 -0700 (PDT)
X-Virus-Scanned: amavisd-new at ietf.org
X-Spam-Flag: NO
X-Spam-Score: -17.6
X-Spam-Level:
X-Spam-Status: No, score=-17.6 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIMWL_WL_MED=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, ENV_AND_HDR_SPF_MATCH=-0.5, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, USER_IN_DEF_DKIM_WL=-7.5, USER_IN_DEF_SPF_WL=-7.5] autolearn=unavailable autolearn_force=no
Authentication-Results: mail2.ietf.org (amavisd-new); dkim=pass (2048-bit key) header.d=google.com
Received: from mail2.ietf.org ([166.84.6.31]) by localhost (mail2.ietf.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 4hbpSyXMZaY7 for <cfrg@mail2.ietf.org>; Fri, 31 Oct 2025 16:03:46 -0700 (PDT)
Received: from mail-lf1-x130.google.com (mail-lf1-x130.google.com [IPv6:2a00:1450:4864:20::130]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (P-256) server-digest SHA256) (No client certificate requested) by mail2.ietf.org (Postfix) with ESMTPS id 9F0C97FC5C74 for <cfrg@irtf.org>; Fri, 31 Oct 2025 16:03:46 -0700 (PDT)
Received: by mail-lf1-x130.google.com with SMTP id 2adb3069b0e04-587bdad8919so4201e87.0 for <cfrg@irtf.org>; Fri, 31 Oct 2025 16:03:46 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1761951818; x=1762556618; darn=irtf.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=TqO+WzOFffsyOY8phx1E0v8At71Z4mzHv/3BEG2qN+A=; b=wTUPUFVhadPEkbZPThau8ecM95bNJb8t+A21KTpPPrkJVaYFKM14OWY4k/0EaCE8ph HFLcuY7wRexmozBeTUIaC7aZsMdyAZwjvNQTfPHx8auCFt9uSHkpm85X9dE4kJ4u6QGr jnGGdfxBY3mbvyOXa5opZrn7XRFufFt0Hvjw7jNmpgreSRGg4Ls0sFYDv8IavrHQ4ZDP /OmagNUWqtww5Ntv6OdTfCEEts+OOH1O7hHYBRWPTAE69S9t2uot7vUidL8JiFpLieH1 rE0IxIlDYXNDLv/kj8bp84qyDNxQEzXuutbV8cAF0mRdqSZuSlSuuh3jmGQ7FAAg4E9i Yvtw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1761951818; x=1762556618; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=TqO+WzOFffsyOY8phx1E0v8At71Z4mzHv/3BEG2qN+A=; b=C6wDUlp7ssk+RNR7fLvSaDoO+uNnbDJZWwQc1SwXsu37bhbYpSvWEp/h0pMtWPbe2r 2SoaepjOvmCZJxT1Avo9Vo8Fdt/NgJohrAoG5PpI79S+llAUqtqPyhmTD6OuQPMFZQWL +FgXQzzWDu9REYsbovOL+hkBk69rMFwcXHS4BaIXtZ3BeTSBmb306Xw3QoFQDqn3e9N+ acst0+u+tdWc4exwukBdQk7+zHAbjCcHT9IaDRQW7n2ZvTfNV2gb8w3LcQVRqNtxQL1y /ckObCW089mTjPrFtlKT5/U1sZi8Ts5gmWDZYwjep5xC2f8OzIHGx347tFMMFv+sxdgn Ueqg==
X-Forwarded-Encrypted: i=1; AJvYcCV2259f4JysRYO41P1UcmnOrbpXz9KkXmaf+cO8K7dUdlgDBfHend85rYdl1mhQxqU7HRcV@irtf.org
X-Gm-Message-State: AOJu0Yz3MR0G3YCG+G3UyboJSopWAfJrGN8DJYJCL9y/IZofCJ3TQWqG 8RkqsBcp+z0MP/nOODhqVkhQyrnADI5d+aNbLZ07VbTNV1/Wh2kZSSoQrb2JFtU23gna0AlQXiF XOh11Tl9Qy3kkBXWA4TfY4Iwk4gwSS021jVoUTq0W
X-Gm-Gg: ASbGncuHwVhO2RFTjyko8DZuknWh+kJr9sEbf9mX4S64oN7OSKsAk/5xCistBUKXQku yLK7iCQI/k99KuMPNfeDlpEMwWdZyq6mhiPJtJvoegu5tdYTwFJsun49HircF28nK0QjqGnCq8A 67yAgL2JoGb0ifcnwmJpZmHcqTpw3Ga5osmNP9TXwvrcyg6pPmUW/SZx+bD28JUQZMolSEqXw3s 08msw5vGMcZNAW65pQuU00hAjMVk2GIcZ5DKyFE5WJCnfOp1H2TbrfJivKCSImpi3yGfb5TXxQ/ RIrcQFOhhYpg/sHzqTpTRUjKv+lo
X-Google-Smtp-Source: AGHT+IF19F/WEZx+DNjeollH53EL0UVKDaPT15s3JyFMwPcelZSzfpzrdztx0QOtlzPffM5Qs67lTN+ahzUv7Cj6GF0=
X-Received: by 2002:a05:6512:3f12:b0:55f:6aa7:c20 with SMTP id 2adb3069b0e04-5942382f7eamr143702e87.2.1761951817930; Fri, 31 Oct 2025 16:03:37 -0700 (PDT)
MIME-Version: 1.0
References: <B481AD89-DEC2-4EEF-9D00-4B15B9439699@heapingbits.net> <CACsn0cm0sSticLymys-TAqYK3dXiP_PQ-MbfWHgamDckWO5jyA@mail.gmail.com> <0DC0D518-8F4A-4FC8-A3CE-F137403AD337@heapingbits.net> <LV9PR21MB49267391E92F4EFACC47CBB580F8A@LV9PR21MB4926.namprd21.prod.outlook.com>
In-Reply-To: <LV9PR21MB49267391E92F4EFACC47CBB580F8A@LV9PR21MB4926.namprd21.prod.outlook.com>
From: Sophie Schmieg <sschmieg@google.com>
Date: Fri, 31 Oct 2025 16:03:25 -0700
X-Gm-Features: AWmQ_bmMxZpZpqcqi80j66cIja10utjlahVMnLbrVgrBzd0M-OGXWfRx3PiBfLk
Message-ID: <CAEEbLAb-6PvKsS8iU_L+_SK7GnCPU2uA0i4ZddFqEgyixTM5BA@mail.gmail.com>
To: "Samuel Lee (ENS/Crypto)" <Samuel.Lee=40microsoft.com@dmarc.ietf.org>
Content-Type: multipart/alternative; boundary="00000000000038924006427c6097"
Message-ID-Hash: P6DQA34X6W2QY3ABEABLI62ZUQQUDHTN
X-Message-ID-Hash: P6DQA34X6W2QY3ABEABLI62ZUQQUDHTN
X-MailFrom: sschmieg@google.com
X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-cfrg.irtf.org-0; header-match-cfrg.irtf.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header
CC: CFRG <cfrg@irtf.org>
X-Mailman-Version: 3.3.9rc6
Precedence: list
Subject: [CFRG] Re: [EXTERNAL] Re: ML-KEM side channels and NoIC / OQUAKE
List-Id: Crypto Forum Research Group <cfrg.irtf.org>
Archived-At: <https://mailarchive.ietf.org/arch/msg/cfrg/TiPKhPJEbASm5xVkCge-gBlsh3Y>
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>
I think this points to a flaw within OQUAKE more than anything: the draft RFC currently only requires that the public key is uniformly random, but not that it is impossible to reconstruct a public key from a known valid ciphertext. None of the definitions of a KEM implies that the public key is secret, and not, well, public (in fact, for signature schemes, it is often possible to compute the public key from valid signatures, see [1]). It seems to me that this construction fundamentally requires properties beyond the ones listed in the draft, and this problem is just one manifestation of this problem. Note that ML-KEM is already not a BUKEM, so you already cannot use standard ML-KEM implementations with OQUAKE as is, so I don't think this has a lot of consequences for timing side channels in ML-KEM implementations not specifically written for OQUAKE. But importantly, the spec needs to give a proper security model that BUKEMs require, or for the very least state that the public key is indistinguishable for uniform random *in the presence of ciphertext*. [1] https://keymaterial.net/2024/06/15/reconstructing-public-keys-from-signatures/ On Fri, Oct 31, 2025 at 2:18 PM Samuel Lee (ENS/Crypto) <Samuel.Lee= 40microsoft.com@dmarc.ietf.org> wrote: > I have no context on PAKE or NoIC / OQUAKE before reading this message, > but encrypting a public key material with a low entropy secret (password) > seems to be a bad idea independently of the specifics of ML-KEM. > There should not be specific handling of parts of public key material in a > protocol to make provisions for what may be variable time or not - public > keys should be considered public. > > It is entirely natural to treat public keys as public data when > implementing a cryptographic library, and to introduce variable timing > w.r.t. the public key as a result. > Public key import / Encaps should not be considered to be constant time > w.r.t. the value of the public key in KEMs. > > Similarly, keypair generation should be expected to be variable time > w.r.t. the public key. > This kind of trivially falls out of variable time encapsulation if the > context where a library might be forced to check that a generated keypair > is consistent (see pairwise consistency tests). > > > Specifically for ML-KEM, I don't see why Tempo is a full fix for the > issue, as I don't see why you should expect Encaps to be constant time > w.r.t. t. > FIPS 203 requires that there is a Modulus check on t before operational > encapsulation, which would naturally be constant time for valid t (all > coefficients are mod Q) and variable time for invalid inputs (at least one > coefficient is not in the correct range). > > > What is the value of encrypting the public key with a key derived from the > password in the protocol? > Is there a reason why OQUAKE/etc. cannot be defined s.t. the KEM's public > key transmitted in the clear, and the shared secret produced by > encapsulation is mixed with the password with an appropriate KDF for both > password and public key confirmation? > > Best, > Sam > > > ------------------------------ > *From:* Christopher Wood <caw@heapingbits.net> > *Sent:* 31 October 2025 10:41 > *To:* Watson Ladd <watsonbladd@gmail.com> > *Cc:* CFRG <cfrg@irtf.org> > *Subject:* [EXTERNAL] [CFRG] Re: ML-KEM side channels and NoIC / OQUAKE > > > > On Oct 31, 2025, at 11:56 AM, Watson Ladd <watsonbladd@gmail.com> wrote: > > > > > On Fri, Oct 31, 2025, 8:10 AM Christopher Wood <caw@heapingbits.net> > wrote: > > Hi folks, > > TL;DR: NoIC / OQUAKE [1,2] admit timing-based dictionary attacks on the > password due to how ML-KEM is specified and implemented in practice. There > exists a proposal which slightly alters NoIC / OQUAKE to hedge against > known-bad timing side channels [3], but it slightly modifies the KEM > abstraction. Nevertheless, it seems like the best option to address the > problem. > > To elaborate, NoIC / OQUAKE are subject to a timing attack due to how the > ML-KEM expands the key-generation seed (rho) to a matrix (A). An internal > function — SampleNTT — uses rejection sampling based on the seed and > therefore is variable time. In NoIC / OQUAKE, after a sender > password-encrypts a public key, an attacker can perform an offline > dictionary attack based on this key in the following way: > > 1. Password-decrypt the authenticated public key using a candidate > password. > 2. Time the seed-to-matrix expansion step using this candidate public key > and compare it against the known timing target. > > This is shown in [4]. One way to fix this side channel is to make > SampleNTT constant-time, but it’s not clear if that’s necessary or > sufficient for security against variable-time implementations of ML-KEM. > > Taking a step back, the core problem is that variable-time functions > inside ML-KEM can be exploited to leak information about the password. For > example, consider the key generation function (Algorithm 13, FIPS203) > inside ML-KEM. The step to compute tHat (18) depends on the matrix A (5), > which depends on the seed rho (1). With a candidate rho, an attacker can > compute the seed-to-matrix expansion function and perform a dictionary > attack. Even if SampleNTT was constant-time, it might be possible that the > Matrix-vector multiplication in computing tHat leaked information. > > There are also possible functions that exist in the encapsulation phase > (Algorithm 14, FIPS203). Specifically, the inverse NTT function involves > modular reduction which could be variable-length time if implemented > incorrectly. Thus, even with a constant-time SampleNTT implementation, if > an attacker can time encapsulation — including step 21 in encapsulation — > it may be possible to learn information about whether the public key is > correct. > > There are several mitigations to this problem, each with different > tradeoffs. These are discussed below. > > 1. Acknowledge and live with the timing side channels. In this approach, > NoIC / OQUAKE would simply acknowledges that these timing side channels and > the dictionary attack exist, rendering NoIC / OQUAKE insecure in situations > where key generation or encapsulation timing information is available to > the attacker. This is minimally invasize to the protocol and specification, > but seems quite fragile. Deployments would need to determine if timing side > channels exist in their use case (almost certainly they do) and take steps > to address them. > > 2. Require all functions to be constant-time, including SampleNTT in > ML-KEM. In this approach, we simply demand that all functions are > implemented in constant-time, regardless of what FIPS203 says. This would > "address" all timing side channels, but would require a change to ML-KEM > implementations. This could be problematic for some implementations, > especially those which are already formally verified. Moreover, it’s > infeasible to determine (at the API level) if an implementation is > constant-time, so someone implementing NoIC / OQUAKE might not know if > their implementation meets this criteria. > > 3. Induce protocol changes to address the known-bad SampleNTT side > channel, and require all other functions to be constant-time. In this > approach, we introduce a protocol-level change (that amounts to a different > type of public key encoding for ML-KEM) that works around the variable-time > SampleNTT function, while also requiring all other functions to be constant > time for completeness. This change is described in [3], and has the benefit > of addressing all timing side channels without requiring FIPS203 changes. > However, it does introduce a non-standard ML-KEM public key encoding that > is different from what is specified in FIPS203. This might not be available > in all cryptographic libraries, but where it is present we know that the > implementation is suitable to address the timing side channel in SampleNTT. > > > The paper also describes an option 4 of transmitting the seed in the clear > and only encrypting the other parts of the public key. I think that's worth > consideration also, since it's a simpler code change than modifying ML-KEM. > > > To be clear, this is option (3), i.e., Tempo with a splittable KEM. > > Best, > Chris > > > > > Option (3) seems like the best here, all things considered. We'll talk > about this next week, but are keen to know if folks have strong opinions on > the desired outcome before then as well. > > Best, > Chris > > [1] https://eprint.iacr.org/2025/231 > [2] https://datatracker.ietf.org/doc/html/draft-vos-cfrg-pqpake-00 > [3] https://eprint.iacr.org/2025/1399 > [4] https://gist.github.com/chris-wood/95474276035cfbb4b4c43895d114223f > _______________________________________________ > CFRG mailing list -- cfrg@irtf.org > To unsubscribe send an email to cfrg-leave@irtf.org > > > _______________________________________________ > CFRG mailing list -- cfrg@irtf.org > To unsubscribe send an email to cfrg-leave@irtf.org > -- Sophie Schmieg | Information Security Engineer | ISE Crypto | sschmieg@google.com
- [CFRG] ML-KEM side channels and NoIC / OQUAKE Christopher Wood
- [CFRG] Re: ML-KEM side channels and NoIC / OQUAKE Watson Ladd
- [CFRG] Re: ML-KEM side channels and NoIC / OQUAKE Christopher Wood
- [CFRG] Re: ML-KEM side channels and NoIC / OQUAKE D. J. Bernstein
- [CFRG] Re: [EXTERNAL] Re: ML-KEM side channels an… Samuel Lee (ENS/Crypto)
- [CFRG] Re: [EXTERNAL] Re: ML-KEM side channels an… Sophie Schmieg
- [CFRG] Re: [EXTERNAL] Re: ML-KEM side channels an… Christopher Wood
- [CFRG] Re: [EXTERNAL] Re: ML-KEM side channels an… D. J. Bernstein
- [CFRG] Re: ML-KEM side channels and NoIC / OQUAKE Quynh Dang
- [CFRG] Re: ML-KEM side channels and NoIC / OQUAKE Dan Harkins
- [CFRG] Re: ML-KEM side channels and NoIC / OQUAKE Christopher Wood
- [CFRG] Re: ML-KEM side channels and NoIC / OQUAKE Bas Westerbaan
- [CFRG] Re: ML-KEM side channels and NoIC / OQUAKE Kris Kwiatkowski
- [CFRG] Re: ML-KEM side channels and NoIC / OQUAKE Dan Harkins
- [CFRG] Re: ML-KEM side channels and NoIC / OQUAKE Scott Fluhrer (sfluhrer)