Re: [lamps] [EXTERNAL] Re: Security Consideration for draft-turner-lamps-nist-pqc-kem-certificates

Douglas Stebila <dstebila@gmail.com> Mon, 28 March 2022 13:15 UTC

Return-Path: <dstebila@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 5F6753A0D3C for <spasm@ietfa.amsl.com>; Mon, 28 Mar 2022 06:15:57 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.107
X-Spam-Level:
X-Spam-Status: No, score=-2.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, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01, URIBL_BLOCKED=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 ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 9Tc_Nb06rv2B for <spasm@ietfa.amsl.com>; Mon, 28 Mar 2022 06:15:51 -0700 (PDT)
Received: from mail-il1-x12c.google.com (mail-il1-x12c.google.com [IPv6:2607:f8b0:4864:20::12c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 9D4483A0D1D for <spasm@ietf.org>; Mon, 28 Mar 2022 06:15:51 -0700 (PDT)
Received: by mail-il1-x12c.google.com with SMTP id x9so9961558ilc.3 for <spasm@ietf.org>; Mon, 28 Mar 2022 06:15:51 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:message-id:mime-version:subject:date:in-reply-to:cc:to :references; bh=NQ948YiVWWj5yOhCWiX4V5Pq237D6Glg8hjkdlOZ7rs=; b=HUv5rpRJUnPhEOtSQ8RHRM7T2SOoAOD/wqPWX3zJrBaYjQmPS7yEx6EeVdzt0JBEix 907OM3GyouNw108GWnK8UxwyejzB+v+9ob6c7x6AX2lltbltMUD1caGembM/Mycncj3j hbZdY5rHI/GxykEXQ1B0/ipa+GuVAZ3gHQfcjc4THDhlV8JUSgxBkI1aKOL1xBBLKFH5 rJtpUJVl1swqPS+l/6pi3zd87gxeqml6Q2M/5NiLhCPhjADn7mWkVyV8G5BVRcVyOl9J vNmkfCu3N1GtcbYUMgIZO3GLySXr1vV2JRupT0yVkLsKvFiKCiEmXTjMTtyvLvtYc3BS vOFQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:message-id:mime-version:subject:date :in-reply-to:cc:to:references; bh=NQ948YiVWWj5yOhCWiX4V5Pq237D6Glg8hjkdlOZ7rs=; b=zESbMYXqiDcQPZ+BDLuOQUPFWUgN2D0Vp4VIyGfy9Ps69erZtKFTq+o/ddsBP3yOOY oaQZ0vfjMdO5eGeoGjrEqQNCtT01xfj9a1BheTfl3qRX55QFgwKlDlEbJQ7mTNM3wJAC 9pRAGZLhaJqRLglY7AzQv6Hg1iR+EnVqW+ZWJnIFQWB/jOo1aCJSMBq5kVjzRMLLRCBU cGOolal7N+w5xr62vRwAgQbg8Tv79skUF1HMzqubymOgHyujlNrZOzhrOcmBXNh0Q5f/ K33mEgtcEGxHeBsciNcso0aHKE7Kae5tx+qdzigNbYdK1uw+mtFLDAvpVSTUXi7z1tWk K4+Q==
X-Gm-Message-State: AOAM533u/Ut5elJqu9+RhmYRREPQeNgvZuO2okHTZMiMd3FWEFJ1RSOB C2XMi2vP/gSXcv2cIbi2ZBU=
X-Google-Smtp-Source: ABdhPJx/aJM/AdGEtLloTjstHV3vWvnX/nTVFm9IKOhCxwI9x4OBjrS88RlZBeUveEDh+qiwWkAhGA==
X-Received: by 2002:a05:6e02:198c:b0:2c8:4e15:7cb9 with SMTP id g12-20020a056e02198c00b002c84e157cb9mr5581128ilf.24.1648473350320; Mon, 28 Mar 2022 06:15:50 -0700 (PDT)
Received: from smtpclient.apple (cpe881fa12cf37b-cma84e3fc93e50.cpe.net.cable.rogers.com. [99.250.203.26]) by smtp.gmail.com with ESMTPSA id l15-20020a056e021aaf00b002c8028ec95esm7434485ilv.87.2022.03.28.06.15.47 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 28 Mar 2022 06:15:48 -0700 (PDT)
From: Douglas Stebila <dstebila@gmail.com>
Message-Id: <A8E459F0-F654-4167-A7CE-2CF5157D5D6F@gmail.com>
Content-Type: multipart/alternative; boundary="Apple-Mail=_9D115EB4-6B2C-4564-99A1-F50E44AD3207"
Mime-Version: 1.0 (Mac OS X Mail 15.0 \(3693.60.0.1.1\))
Date: Mon, 28 Mar 2022 09:15:46 -0400
In-Reply-To: <5338244B-B1AC-4735-9F4A-B643663499E8@ll.mit.edu>
Cc: LAMPS <spasm@ietf.org>, Ilari Liusvaara <ilariliusvaara@welho.com>, Mike Ounsworth <Mike.Ounsworth@entrust.com>
To: "Blumenthal, Uri - 0553 - MITLL" <uri@ll.mit.edu>
References: <64D97E59-8FC3-40B5-A07B-AA927AF2C671@gmail.com> <5338244B-B1AC-4735-9F4A-B643663499E8@ll.mit.edu>
X-Mailer: Apple Mail (2.3693.60.0.1.1)
Archived-At: <https://mailarchive.ietf.org/arch/msg/spasm/Vvd5X7BImnCnnkVAswK4MsSGGLw>
Subject: Re: [lamps] [EXTERNAL] Re: Security Consideration for draft-turner-lamps-nist-pqc-kem-certificates
X-BeenThere: spasm@ietf.org
X-Mailman-Version: 2.1.29
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: Mon, 28 Mar 2022 13:15:58 -0000

On Mar 27, 2022, at 14:00, Blumenthal, Uri - 0553 - MITLL <uri@ll.mit.edu> wrote:
> 
> On Mar 25, 2022, at 19:14, Douglas Stebila <dstebila@gmail.com <mailto:dstebila@gmail.com>> wrote:
>> 
>> Length prefixing a variable length shared secret will not avoid this type of attack.
> 
> Would you mind clarifying - what attack/type-of-attack you mean?

https://github.com/nimia/kdf_public#readme

>> It doesn't arise from ambiguity about how long something is (which is what length prefixing resolves), it arises from being able to control where certain parts of the string land with respect to a hash function block boundary.
> 
> Now you know where your 32-byte part of the string lands. Variable length would allow moving where your part of the string lands, somewhat. Still, so what? I don’t see a viable attack (assuming a decent hash function).

That's the whole point of this scenario -- that one is not assuming a decent hash function.

Douglas


> 
> Thanks
> 
> 
>>> On Mar 25, 2022, at 3:58 PM, Blumenthal, Uri - 0553 - MITLL <uri@ll.mit.edu <mailto:uri@ll.mit.edu>> wrote:
>>> 
>>> What I had in mind was something like (described loosely 😉)
>>> 
>>> SS_i ::= <len_in_bytes> || <ss_i>
>>> 
>>> Len_in_bytes ::= INTEGER (1..65536) – field taking 4 bytes
>>> ss_i ::= symmetric shared secret obtained from the given KEM
>>> 
>>> SS_final = H(SS_1 || SS_2 || . . . || SS_n)
>>> 
>>> Sorry for sloppy handwaving, but I’m sure you understand what I mean.
>>> 
>>> TNX
>>> --
>>> V/R,
>>> Uri
>>> 
>>> There are two ways to design a system. One is to make it so simple there are obviously no deficiencies.
>>> The other is to make it so complex there are no obvious deficiencies.
>>>                                                                                                                                    -  C. A. R. Hoare
>>> 
>>> 
>>> From: Mike Ounsworth <Mike.Ounsworth@entrust.com <mailto:Mike.Ounsworth@entrust.com>>
>>> Date: Friday, March 25, 2022 at 12:34
>>> To: Uri Blumenthal <uri@ll.mit.edu <mailto:uri@ll.mit.edu>>, Ilari Liusvaara <ilariliusvaara@welho.com <mailto:ilariliusvaara@welho.com>>, LAMPS <spasm@ietf.org <mailto:spasm@ietf.org>>
>>> Subject: RE: [lamps] [EXTERNAL] Re: Security Consideration for draft-turner-lamps-nist-pqc-kem-certificates
>>> 
>>> Thanks Uri.
>>> 
>>> Can you provide the concrete construction you have in mind when you say “include the length field in the hash”? I will add a note to our composite kem combiner draft, but I do not want to mis-interpret your suggestion.
>>> 
>>> ---
>>> Mike Ounsworth
>>> Software Security Architect, Entrust
>>> 
>>> From: Spasm <spasm-bounces@ietf.org <mailto:spasm-bounces@ietf.org>> On Behalf Of Blumenthal, Uri - 0553 - MITLL
>>> Sent: March 25, 2022 9:39 AM
>>> To: Ilari Liusvaara <ilariliusvaara@welho.com <mailto:ilariliusvaara@welho.com>>; LAMPS <spasm@ietf.org <mailto:spasm@ietf.org>>
>>> Subject: Re: [lamps] [EXTERNAL] Re: Security Consideration for draft-turner-lamps-nist-pqc-kem-certificates
>>> 
>>> In general, I agree with the points Ilari made. However…
>>> 
>>> ·         I think it’s good to allow SS of variable length;
>>> ·         When you allow variable length, you must include the length field into the hash;
>>> ·         I don't think padding is necessary in this case;
>>> ·         We should be careful regarding “max possible SS length”: while I don’t expect to ever see SS of, e.g., 56MB - I doubt it would stay at 32 or 48 bytes forever. I definitely don’t want to see “max possible SS len = 32”.
>>> 
>>> What’s the purpose of padding, if you included the length?
>>> 
>>> Re. RACOON attack – besides being pretty darn difficult to launch, it’s rather limited in applicability, IMHO – to the point I don’t really care. Besides, offhand, it isn’t applicable to NIST KEMs.
>>> 
>>> Thanks
>>> -- 
>>> V/R,
>>> Uri
>>> 
>>> 
>>> On 3/25/22, 09:50, "Spasm on behalf of Ilari Liusvaara" <spasm-bounces@ietf.org <mailto:spasm-bounces@ietf.org> on behalf of ilariliusvaara@welho.com <mailto:ilariliusvaara@welho.com>> wrote:
>>> 
>>>   On Fri, Mar 25, 2022 at 01:30:28PM +0000, Mike Ounsworth wrote:
>>>>> So if your scenario envisions concatenating a traditional
>>>> (RSA/FFDH/ECC) shared secret and a PQ shared secret, one would want
>>>> to be sure the first component of the concatenation is not variable
>>>> length.
>>>> 
>>>> Another good point!
>>>> 
>>>> Thinking out loud: does padding solve the problem?
>>>> 
>>>> H(ss_1 || ss_2 || .. || ss_n)
>>>> 
>>>> if ss_i are each padded / truncated to, say, the security level of
>>>> the underlying hash function, does that work?
>>> 
>>>   One could solve the issue for variable length SS by adding a length
>>>   field and padding to the maximum possible SS length. I think truncating
>>>   is a bad idea, and could interact badly with some oddball KEMs.
>>> 
>>>   However, using KEMs with variable-length SS seems like a bad idea
>>>   anyway. E.g., see the TLS RACCOON attack.
>>> 
>>> 
>>>   -Ilari
>>> 
>>>   _______________________________________________
>>>   Spasm mailing list
>>>   Spasm@ietf.org
>>>   https://www.ietf.org/mailman/listinfo/spasm
>>> 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.
>>> _______________________________________________
>>> Spasm mailing list
>>> Spasm@ietf.org
>>> https://www.ietf.org/mailman/listinfo/spasm
>> 
>> _______________________________________________
>> Spasm mailing list
>> Spasm@ietf.org <mailto:Spasm@ietf.org>
>> https://www.ietf.org/mailman/listinfo/spasm <https://www.ietf.org/mailman/listinfo/spasm>