[lamps] CMS Kyber: include PK and CT in the KDF?

Deirdre Connolly <durumcrustulum@gmail.com> Thu, 11 April 2024 14:30 UTC

Return-Path: <neried7@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 983CAC14F708 for <spasm@ietfa.amsl.com>; Thu, 11 Apr 2024 07:30:50 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -6.845
X-Spam-Level:
X-Spam-Status: No, score=-6.845 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, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_HI=-5, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, 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 (2048-bit key) header.d=gmail.com
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 L3LL4ROfNjGi for <spasm@ietfa.amsl.com>; Thu, 11 Apr 2024 07:30:46 -0700 (PDT)
Received: from mail-ed1-x533.google.com (mail-ed1-x533.google.com [IPv6:2a00:1450:4864:20::533]) (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 5BF61C14F68E for <spasm@ietf.org>; Thu, 11 Apr 2024 07:30:46 -0700 (PDT)
Received: by mail-ed1-x533.google.com with SMTP id 4fb4d7f45d1cf-56e477db7fbso8262517a12.3 for <spasm@ietf.org>; Thu, 11 Apr 2024 07:30:46 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1712845843; x=1713450643; darn=ietf.org; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=FUvSH+Hdgv7oZhnkpGaitG9/3LJiowovX9ncXOw9peU=; b=YQTvOVWsEzg/G81moIrW59kAYRxWogHBUHMDWJUJpczn8MkbuUhJUJpBH+Swr3KPlN wW1T/dJ1mbq6xgJNRf7hwRHhb7XicJUrknqi2xJCxJ9Hc7RwDTbB6tL5Uh1DliAAc6hi 2rr4ZaMeeJnFbwxBAu6TsfgE6X5HWJMthV1i4ZALIiKBIjdEMeplogK9SKyqqhqRSSAS xK4xasH7NC3nykVr+qqqbNjB/80Nav1jkuYSkz8ZVvHDbohBRNfGvWb2r3jP/fFXUWJR FE6GYRC8M3uaa1g8DYVljOejSvRb2sugcWaELL7BMDCpLnLCJBdtoldHGHug2eitTiOk HyMg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712845843; x=1713450643; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=FUvSH+Hdgv7oZhnkpGaitG9/3LJiowovX9ncXOw9peU=; b=rWn2xIOpYzQOs3DtyjjZ449W+MJNZMifR2Y36pxPRPjrBFkQU/pYwKL8rTzoH8ehnR 0HNBLKACwjONSWI6uoOScAlXMOh3Kq3khFFUQaz9/WocpvheReVuR5dZ0Ujox0dPjIL+ +AHyyQ6lrnadzYPx7+QCJmL7sJAFQU2HmMiyWNjT80U5bBF0xHGnPcyPV7pIULiuiZq4 Q7RNAL2GmWQc46S/4W27Wv8+tQOI9X0MZzLrrsDC/OebocQsIyZUNmF3LffnGcy3aWbA J9mWa67QAJ6n/uGUpbEQr5NEbTSKvbvI9jhpS84YPwl4c+1epdqBIAygYxfyTCPe0cjY GQ6g==
X-Gm-Message-State: AOJu0Yw07LO6rgX75kixV4rnuxzCLdGWyaLSOeCP8/Sd8wPjRl8DqQU4 7n6fn8CJivOqBSETjWBrR5X4wm3zUCXFC3l8tVRdk5hedQ8XYGuTbF+gntsoPLb/fpjGRmzhh5i TvNUjK8sUAto0QM3jn5CtxQN99spFTHlf
X-Google-Smtp-Source: AGHT+IHCeKpdFEBRHUgqJrQvHbBOVDiayyQYq+SXptHjW6rUznc3Ati6Yb5LDDT71ELRab1vCX3fI7mzSa7JWIZ3BbA=
X-Received: by 2002:a50:d4d7:0:b0:56e:2a64:8290 with SMTP id e23-20020a50d4d7000000b0056e2a648290mr3404476edj.5.1712845842494; Thu, 11 Apr 2024 07:30:42 -0700 (PDT)
MIME-Version: 1.0
From: Deirdre Connolly <durumcrustulum@gmail.com>
Date: Thu, 11 Apr 2024 10:30:05 -0400
Message-ID: <CAFR824w0rBfxGzCJrSZ3f45Lyn7SEVLZK6cM9ZaZVHVPujs-5g@mail.gmail.com>
To: LAMPS <spasm@ietf.org>
Content-Type: multipart/alternative; boundary="000000000000ff3fc30615d2ff1d"
Archived-At: <https://mailarchive.ietf.org/arch/msg/spasm/Lkq8-VjHX5xGGVrSQlAh2fImgqc>
Subject: [lamps] CMS Kyber: include PK and CT in the KDF?
X-BeenThere: spasm@ietf.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: This is the mail list for the LAMPS Working Group <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: Thu, 11 Apr 2024 14:30:50 -0000

Looking again at CMS Kyber
<https://www.ietf.org/id/draft-ietf-lamps-cms-kyber-03.html>, it seems to
not bind the encapsulation key or the KEM ciphertext anywhere in the CMS
scheme or the KDF. To mitigate the less-than-ideal binding properties
<https://eprint.iacr.org/2023/1933.pdf> of ML-KEM, I would consider
including the encapsulation key and ciphertext along with the shared secret
`ss` as input to the KDF.


ML-KEM, as currently drafted as FIPS 203 IPD
<https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.203.ipd.pdf>, is
LEAK-BIND-K-PK
and LEAK-BIND-K-CT at best <https://eprint.iacr.org/2024/523>. To safely
use the shared secret output from ML-KEM without opening it up to
re-encapsulation
attacks <https://cryspen.com/post/pqxdh/>, including the PK and CT
concatted with the `ss` as the preimage to the KDF is a secure and easy way
to maximally bind the resulting KEK to the KEM public values. This
construction is also a secure solution for any KEM with even the weakest of
binding properties, so it would be a safe pattern for other KEMs:


- KEK = KDF(ss)

+ KEK = KDF(ss || ct || pk)


The ML-KEM standard may change between the current draft and the final one
later this summer/year, but even if so, this change would be basically
bulletproof either way in terms of security.


Cheers,

Deirdre