Re: [lamps] [EXTERNAL] Re: hashed public key for "BSI" KEMTLS

"Markku-Juhani O. Saarinen" <mjos@pqshield.com> Thu, 25 March 2021 18:32 UTC

Return-Path: <mjos@pqshield.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 797863A29A3 for <spasm@ietfa.amsl.com>; Thu, 25 Mar 2021 11:32:23 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.898
X-Spam-Level:
X-Spam-Status: No, score=-1.898 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_MESSAGE=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=pqshield-com.20150623.gappssmtp.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 2xOE-Mm0qU1p for <spasm@ietfa.amsl.com>; Thu, 25 Mar 2021 11:32:17 -0700 (PDT)
Received: from mail-lj1-x236.google.com (mail-lj1-x236.google.com [IPv6:2a00:1450:4864:20::236]) (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 5D7A33A29A1 for <spasm@ietf.org>; Thu, 25 Mar 2021 11:32:17 -0700 (PDT)
Received: by mail-lj1-x236.google.com with SMTP id u20so4363461lja.13 for <spasm@ietf.org>; Thu, 25 Mar 2021 11:32:17 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pqshield-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=cw7BgW5GcVKA4G6FVlavU/tXNvqrCSCmUfg3tiVDOOw=; b=gX+mugRqAQ8LfQhrffm287ayeWGMSpjBqLKyTbUFkOW8gEfSqMCFiQ8hZODQxHY3vL S6/nZO8s7bS4QMv7ixmgFN7A8BbXPbE0j9BAmjrCXrpX6MoiA093c5ePETlDvVJxG8gx vb16XJXFwN/O9HKwPiYGPIBr0cNjkJIzbahc1iltsaNm65BXBJezB899/iUYEJeO/fsd sga3hQ4klX6Lh54+hIDZBxXh2MFBTzdjL+IKBXpvxDpDEznag52AJwYKSV80qQ78xCcs aKkUXrsWdzTyPwiypUmWmBtws/+EubUMYTBZobbOnNZ3Vhb4ZR3tVEHZygfcmInKLfoM XRMg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=cw7BgW5GcVKA4G6FVlavU/tXNvqrCSCmUfg3tiVDOOw=; b=UlLIe/+zmggisVeSUVqRBzYvcO4d4IQv03oDndN/lBLUhuoMmbKliUO89eOPtGC0gq IHTeWpbXFDQn3XxteZfHy34wmAG2lQwpqM08X0He7feMKwu3pthAQPqnYefku+GA2x5x us9Zlvngk6RUmJdx5I+ylj5c+y9x897TLeASV33o6gUa+Bh8GdeZVVINk0Ls6aOEa+1U lTf2ER6iMpbCw3OYZF7/1YjOgkRsPfDyk/HWeqWRkinsALAbsAKVYUdRkwElm6Ti2K7r kJC8Ierg7vajBHc1BG6182U1FxEipDaXX16+V70rhM3oeA8JO/f2EJtj32TUiKwmPMD4 A/PA==
X-Gm-Message-State: AOAM532iYP9WCFj/hlGlyca0nSmeh5GQAIv5zJgj+9y3ETfzSH9p7awn pA7BI5O/8c/j/3qK5DRFHCkhwEbQh0cHOOxzASkbLDQhiCk=
X-Google-Smtp-Source: ABdhPJw7jmjI1CAuOmVcBDOPCbp4yRyEiJPEc7uqZ0VAKdZmT407SuenG1FPiC28KjL0Gk4FXtJY1TyRgplVpag8UN0=
X-Received: by 2002:a2e:924f:: with SMTP id v15mr6730078ljg.172.1616697133979; Thu, 25 Mar 2021 11:32:13 -0700 (PDT)
MIME-Version: 1.0
References: <CAPwdP4PN6Ek9BufoOK6GQmb5t+ySqO56_01Sh5YKeMPXKJi+kg@mail.gmail.com> <5CC61690-C402-42D5-AB0A-91AD43B65784@vigilsec.com> <DM6PR11MB438054EE205D5A10CD133F299F639@DM6PR11MB4380.namprd11.prod.outlook.com> <CAErg=HGo=Q0vvrvJgAvwvW2cDmvSyGbOJ7O9BJA_C0p3k=UQbA@mail.gmail.com> <BN7PR11MB2547C1591020EF0C11C19094C9629@BN7PR11MB2547.namprd11.prod.outlook.com> <DM6PR11MB43802551459E76EC638670299F629@DM6PR11MB4380.namprd11.prod.outlook.com> <BN7PR11MB25476884CA9E5D7BE70820FAC9629@BN7PR11MB2547.namprd11.prod.outlook.com>
In-Reply-To: <BN7PR11MB25476884CA9E5D7BE70820FAC9629@BN7PR11MB2547.namprd11.prod.outlook.com>
From: "Markku-Juhani O. Saarinen" <mjos@pqshield.com>
Date: Thu, 25 Mar 2021 18:32:03 +0000
Message-ID: <CAPwdP4Pkg7xKfD7owYZB0jF2igfJJqXXA2WZyyRqZdUN8Dm-tg@mail.gmail.com>
To: "Panos Kampanakis (pkampana)" <pkampana@cisco.com>
Cc: "spasm@ietf.org" <spasm@ietf.org>
Content-Type: multipart/alternative; boundary="000000000000616b5c05be60a2d0"
Archived-At: <https://mailarchive.ietf.org/arch/msg/spasm/lMhRGv61RRd9NQTeVeGvWywRAFw>
Subject: Re: [lamps] [EXTERNAL] Re: hashed public key for "BSI" KEMTLS
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: Thu, 25 Mar 2021 18:32:24 -0000

On Thu, Mar 25, 2021 at 2:42 PM Panos Kampanakis (pkampana) <
pkampana@cisco.com> wrote:

> > The core question here is whether externalized public keys (and
> signature values?) as a hash+url is worth spending effort on given the
> expected size of PQC algs? Does the footgun-ness outweigh the potential
> usefulness?
>
>
>
> Personally, I would like to avoid drastic changes to (D)TLS/QUIC/SSH etc
> altogether unless there is no other choice. But as I have said before, if
> one or two of the PQ lattice based signatures don’t get standardized we
> will have to get creative. That could include externalized public keys in
> DNS or URLs with fancy caching mechanisms, KEMTLS with fancy caching
> mechanisms and more. These come with their complications of course.
>

Hi Panos,

Yep.. I'd note that KEMTLS has performance advantages too with the
structured lattice algorithms likely to be selected for mainstream use --
which can be faster to compute than pre-quantum algorithms. They have pk
and ct sizes of only up to 2kB so referencing/caching makes little sense
for them. I personally expect KEMTLS to see use with the big cloud
providers.

I wouldn't push the public key cache mechanism to TLS/QUIC/SSH itself,
while I'd hope/expect KEMTLS to be there. However, if the cache mechanism
is just an encoding in the cert, using off-band techniques (a la CRLs) to
fetch the pk blob, then it doesn't modify the protocol spec too much to
facilitate this admittedly niche application.

The caching / pk size complexities here arise just from the specific types
of use cases that we're dealing with right now. Since proprietary solutions
for these PQC use cases already exist, perhaps it would still be preferable
to document it within IETF too (at least the cert format).


> Nothing wrong with investigating options now of course. Another question
> about the hash+url proposal is the rest of the cert chain. Is it
> big_heavy_sig_algo with hash+urls? Is it cached and fetched occasionally as
> well? More complications there, but worth thinking about it.
>

Apologies for discussing national standards and detailed use cases again..
I appreciate that these requirements are just one part of the picture, but
I also think that it's appropriate that IETF PKI engineering is informed by
such things.

So.. to recap, the Germans have already chosen the PQC KEM algorithms and
parameters that they recommend [1], NIST has already released the final SP
800-208 [2], and XMSS and LMS have a likely-pass NSS [3] status. These are
not algorithms that I would necessarily personally prefer, but here we are.

So an ultra-conservative customer is seeking long-term quantum resilience
for trusted comms links. They have a "PQC" PKI with an XMSS root, and
possibly an XMSS immediate too. All XMSS ops are with an HSM that can
manage the state. This signature solution is also used for other purposes,
such as system updates.

In comms they can live with a limited number of signatures -- signatures
are only in these certificates and endpoint authentication is with KEM
decapsulation in KEMTLS.  XMSS signatures are 2500 bytes, public keys are
64 bytes, so the cert chains are long but manageable if the subject public
key is referenced with a hash.

The caching mechanism is not particularly fancy (essentially a web cache --
integrity checking of the blob is via the hash).  Wrt DoS;  if the URL is
invalid as that would mean that the CA has signed the invalid URL. An
attempt to fetch the final subject public key is performed only after cert
signature verification. There will be a full handshake retry if this fetch
is successful.

Cheers,
- markku

[1]
https://www.bsi.bund.de/SharedDocs/Downloads/EN/BSI/Publications/TechGuidelines/TG02102/BSI-TR-02102-1.pdf
[2] NIST, "SP 800-208: Recommendation for Stateful Hash-Based Signature
Schemes", October 2020. https://doi.org/10.6028/NIST.SP.800-208
[3]
https://www.nsa.gov/What-We-Do/Cybersecurity/NSAs-Cybersecurity-Perspective-on-Post-Quantum-Cryptography-Algorithms/

Dr. Markku-Juhani O. Saarinen <mjos@pqshield.com> PQShield, Oxford UK.


>
>
>
>
>
> *From:* Spasm <spasm-bounces@ietf.org> *On Behalf Of *Mike Ounsworth
> *Sent:* Thursday, March 25, 2021 12:33 AM
> *To:* Panos Kampanakis (pkampana) <pkampana=40cisco.com@dmarc.ietf.org>;
> Markku-Juhani O. Saarinen <mjos@pqshield.com>
> *Cc:* spasm@ietf.org; Ryan Sleevi <ryan-ietf@sleevi.com>; Russ Housley <
> housley@vigilsec.com>
> *Subject:* Re: [lamps] [EXTERNAL] Re: hashed public key for "BSI" KEMTLS
>
>
>
> Thanks Ryan and Panos.
>
>
>
> I wasn’t really intending this draft to be a formal submission, just a
> hastily-written thing to illustrate the concept. I take your points that
> this is a simple concept with a ton of implementation landmines.
>
>
>
> The core question here is whether externalized public keys (and signature
> values?) as a hash+url is worth spending effort on given the expected size
> of PQC algs? Does the footgun-ness outweigh the potential usefulness?
>
>
>
> ---
>
> *Mike* Ounsworth
>
>
>
> *From:* Panos Kampanakis (pkampana) <pkampana=40cisco.com@dmarc.ietf.org>
> *Sent:* March 24, 2021 10:10 PM
> *To:* Markku-Juhani O. Saarinen <mjos@pqshield.com>
> *Cc:* spasm@ietf.org; Russ Housley <housley@vigilsec.com>; Ryan Sleevi <
> ryan-ietf@sleevi.com>; Mike Ounsworth <Mike.Ounsworth@entrust.com>
> *Subject:* RE: [lamps] [EXTERNAL] Re: hashed public key for "BSI" KEMTLS
>
>
>
> > There are other elements to think through, such as the aforementioned
> document/email signing case. Since domains and URIs come and go, the CT
> problem isn’t really a “CT” problem: it’s a problem with offline scenarios.
>
>
>
> I would also add the concerns spelled out in Section 5 and the Sec
> Consideration of https://tools.ietf.org/html/rfc7924#section-7
>
>
>
>
>
> *From:* Spasm <spasm-bounces@ietf.org> *On Behalf Of *Ryan Sleevi
> *Sent:* Wednesday, March 24, 2021 7:09 PM
> *To:* Mike Ounsworth <Mike.Ounsworth=40entrust.com@dmarc.ietf.org>
> *Cc:* spasm@ietf.org; Markku-Juhani O. Saarinen <mjos@pqshield.com>; Russ
> Housley <housley@vigilsec.com>
> *Subject:* Re: [lamps] [EXTERNAL] Re: hashed public key for "BSI" KEMTLS
>
>
>
> I’m not sure I fully understand the GeneralName approach. Are you
> imagining a situation where a user is going to look up within EDI or an
> X.400 directory? Since few implementations support anything other than LDAP
> and HTTP URIs, and since the various GREASE efforts (and X.509 itself) have
> shown arbitrary extensibility continues to be a security and
> interoperability tirefire, we should keep it as simple as possible. We can
> always use an extra OID if we need to, and any new transport will require
> updating clients anyways, so there’s no harm.
>
>
>
> The only other GeneralName that even makes sense is otherName, but you
> already have extensibility via URI schemes, so it’s a superfluous encoding.
> Several of these are vestigial carryovers from X.509 that don’t make any
> sense in a “PKIX” world of the Internet.
>
>
>
> I’m definitely with Russ that the principle here is easy, and I think this
> draft more or less gets close, but I would strongly encourage just
> IA5String for a URI. This seems like it should fully cover the non-TLS
> cases mentioned.
>
>
>
> The other concern I would have is that 2.1 and 2.2 are unnecessarily
> ambiguous and flexible. If the goal is to model after RFC 5280, then it
> should be explicit about the transport coding (and mime types, as
> appropriate). “DER or Base64” is a bit awkward, even when constrained to
> just HTTP URIs.
>
>
>
> This was some discussion of this approach in the past. For example, IETF
> 101’s minutes for LAMPS tracks some of that context and discussion,
> including the “like LogoTypes” suggestion.
>
>
>
> While I don’t really expect IETF drafts to cover the implementation
> challenges, I think it’s worth thinking carefully about the protocol state
> machine through all of this. For example, you’d have to decide early on in
> the handshake, before the peer has proven their possession of the key even,
> to both verify a certificate and de-reference a potentially Very Large
> Blob. Depending on your threat model, such verification could be a huge
> amplification of work factor, creating DoS possibilities.
>
>
>
> Even if you “only” support HTTP as a transport, you still have to figure
> out a caching story and the relevant headers (e.g. as RFC 5019 had to do),
> since those can also have application impact, even if it’s “just” an
> implementation detail.
>
>
>
> There are other elements to think through, such as the aforementioned
> document/email signing case. Since domains and URIs come and go, the CT
> problem isn’t really a “CT” problem: it’s a problem with offline scenarios.
>
>
>
> On Wed, Mar 24, 2021 at 4:58 PM Mike Ounsworth <Mike.Ounsworth=
> 40entrust.com@dmarc.ietf.org> wrote:
>
> Hi Russ,
>
>
>
> Yeah, that’s exactly the structure I came up with also, though I would use
> a GeneralName for the location to give the same amount of flexibility as
> AIA does.
>
>
>
> While chatting with Markku, I threw my thoughts into I-D format just to
> write out the ASN.1 and security considerations that come to mind.
>
>
>
> https://datatracker.ietf.org/doc/draft-ounsworth-pq-external-pubkeys/
>
>
>
> At this point WE ARE NOT asking for review of this draft. WE ARE NOT
> looking for a debate on specific PQC algorithms.
>
>
>
> WE ARE asking if anyone can remember historical discussions of
> externalized pubkeys or signatureValues in certificates. What were the pros
> / cons? WE ARE asking if this is a problem space worth re-visiting in light
> of the pubkey and sig sizes we expect to see with PQC algorithms.
>
>
>
> References:
>
> The only similar work I’m aware of is IKEv2 (RFC 7296) which supports “Hash
> and URL of X.509 certificate” over HTTP (ie the whole cert, not just the
> pub key / sig). Though we did find this 2018 paper by Panos, Dan Van Geest,
> et. al [1] which says
>
>
>
> > To address these concerns, RFC7296 defines the use of a hash and an URL
> that serve the certificate in order to avoid sending it over UDP. This
> method is almost never used in IKEv2 deployments today.
>
>
>
>
>
> [1]: https://eprint.iacr.org/2018/063.pdf
>
>
>
> ---
>
> *Mike* Ounsworth
>
>
>
> *From:* Spasm <spasm-bounces@ietf.org> *On Behalf Of *Russ Housley
> *Sent:* March 24, 2021 12:49 PM
> *To:* Markku-Juhani O. Saarinen <mjos@pqshield.com>
> *Cc:* spasm@ietf.org
> *Subject:* [EXTERNAL] Re: [lamps] hashed public key for "BSI" KEMTLS
>
>
>
> WARNING: This email originated outside of Entrust.
> DO NOT CLICK links or attachments unless you trust the sender and know the
> content is safe.
> ------------------------------
>
> Markku:
>
>
>
> I would like to avoid discussion of the algorithms that are supported by
> various governments around the world.  It is clear that they will not make
> the same choices.  However, so far, I have not see algorithm identifiers
> assigned for PQC candidate algorithms.
>
>
>
> RFC 3709 does something like you are talking about for logos.  The idea is
> that the certificate contains a hash of the object that will be obtained
> from the URI.  In this way, the web server cannot swap the public key.  I
> am assuming that the object returned will be a SubjectPublicKeyInfo.
>
>
>
> A structure like this will work:
>
>
>
>    PublicKeyReference ::= SEQUENCE {
>
>      hashAlg AlgorithmIdentifier,
>
>      refHash OCTET STRING,
>
>      refURI IA5String }
>
>
>
> Russ
>
>
>
>
>
> On Mar 24, 2021, at 1:13 PM, Markku-Juhani O. Saarinen <mjos@pqshield.com>
> wrote:
>
>
>
> Hello,
>
> We've been doing some engineering for a customer who has a requirement for
> post-quantum cryptography using the German BSI recommended algorithms
> (category 3 or 5 FrodoKEM or Classic McEliece [1-2]). Yes, I'm aware of
> their respective statuses in the NIST PQC competition -- but this is
> essentially an active German government requirement.
>
> The KEMTLS [3] mechanism would allow certificate-based authentication (in
> addition to the key establishment) using a KEM such as these two.
>
> Classic McEliece has particularly large public keys (261,120 to 1,357,824
> bytes) but only 128 to 240-byte ciphertexts. The transmission of those
> large public key is only required as a part of the public key certificate.
>
> QUESTION: We'd like to transmit certificates still, but replace the big
> public key subject blob (subjectPublicKey) with an appropriate construct
> that contains just a secure hash of the key a reference (such as an URL)
> from where that data can be obtained off-line (if it is not cached).
>
> What would be the "best" way of doing this?  Mike Ounsworth has already
> kindly proposed an encoding for it (that he may choose to share on this
> list), but we're wondering if this sort of thing has been done before and
> how/where.
>
> Rationale: This would knock off 1MB from certificates, making them match
> current certificate sizes and flows. As noted, the ciphertext itself is
> shorter than an RSA ciphertext. The same "compressed"/"cached" certificate
> format could also be used for other PKI applications in that same "McEliece
> BSI user" scenario (e.g. e-mail and messaging).
>
>
>
> Note that there is also a PQC finalist signature algorithm with a similar
> profile; Rainbow has 60,192 to 1,930,600 byte public keys but 66 to
> 212-byte signatures. We don't have a current engineering requirement for it
> though, and its fate and parameter selection looks a bit uncertain in view
> of some recent analysis (also NSS folks have expressed reservations on it).
>
>
>
> Cheers,
> - markku
>
> [1] BSI. "Cryptographic Mechanisms: Recommendations and Key Lengths."
>  Technical Guideline TR-02102-1. March, 2020.
> https://www.bsi.bund.de/SharedDocs/Downloads/EN/BSI/Publications/TechGuidelines/TG02102/BSI-TR-02102-1.pdf
> <https://urldefense.com/v3/__https:/www.bsi.bund.de/SharedDocs/Downloads/EN/BSI/Publications/TechGuidelines/TG02102/BSI-TR-02102-1.pdf__;!!FJ-Y8qCqXTj2!PVS70xPSSnZiShFmeREght7e7BmADK2MzBPEEeUsPQkkeoDd6sbURJYHV_ayRXadVA3DXryp5A$>
> [2] BSI. "Migration zu Post-Quanten-Kryptografie." Handlungsempfehlungen
> des BSI. August, 2020.
> https://www.bsi.bund.de/SharedDocs/Downloads/DE/BSI/Krypto/Post-Quanten-Kryptografie.pdf
> <https://urldefense.com/v3/__https:/www.bsi.bund.de/SharedDocs/Downloads/DE/BSI/Krypto/Post-Quanten-Kryptografie.pdf__;!!FJ-Y8qCqXTj2!PVS70xPSSnZiShFmeREght7e7BmADK2MzBPEEeUsPQkkeoDd6sbURJYHV_ayRXadVA0WO3wkOQ$>
>
> [3] P. Schwabe, D. Stebila, and T. Wiggers. "Post-quantum TLS without
> handshake signatures." ACM CCS 2020, October 2020. https://ia.cr/2020/534
> <https://urldefense.com/v3/__https:/ia.cr/2020/534__;!!FJ-Y8qCqXTj2!PVS70xPSSnZiShFmeREght7e7BmADK2MzBPEEeUsPQkkeoDd6sbURJYHV_ayRXadVA1C5JeFYg$>
>
>
>
> Dr. Markku-Juhani O. Saarinen <mjos@pqshield.com> PQShield, Oxford UK.
>
> _______________________________________________
> Spasm mailing list
> Spasm@ietf.org
> https://www.ietf.org/mailman/listinfo/spasm
> <https://urldefense.com/v3/__https:/www.ietf.org/mailman/listinfo/spasm__;!!FJ-Y8qCqXTj2!PVS70xPSSnZiShFmeREght7e7BmADK2MzBPEEeUsPQkkeoDd6sbURJYHV_ayRXadVA3sKApRXA$>
>
>
>
> _______________________________________________
> Spasm mailing list
> Spasm@ietf.org
> https://www.ietf.org/mailman/listinfo/spasm
>
>