Re: [Lake] Static-DH-based Protocols for LAKE

Karthikeyan Bhargavan <karthik.bhargavan@gmail.com> Thu, 24 October 2019 14:27 UTC

Return-Path: <karthik.bhargavan@gmail.com>
X-Original-To: lake@ietfa.amsl.com
Delivered-To: lake@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id EDB87120961 for <lake@ietfa.amsl.com>; Thu, 24 Oct 2019 07:27:57 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.997
X-Spam-Level:
X-Spam-Status: No, score=-1.997 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, 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=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 nm82M_sQxC7O for <lake@ietfa.amsl.com>; Thu, 24 Oct 2019 07:27:54 -0700 (PDT)
Received: from mail-wm1-x331.google.com (mail-wm1-x331.google.com [IPv6:2a00:1450:4864:20::331]) (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 3C072120921 for <lake@ietf.org>; Thu, 24 Oct 2019 07:27:54 -0700 (PDT)
Received: by mail-wm1-x331.google.com with SMTP id r141so2818439wme.4 for <lake@ietf.org>; Thu, 24 Oct 2019 07:27:54 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:message-id:mime-version:subject:date:in-reply-to:cc:to :references; bh=eJyzG7i4wVWy+6/GhMCR1ZSufa0+vHqDViMdGTcA5EU=; b=UJyLfaDNTX/yBw2JoUA2u/IkzjENOyLLmBZ1ULhZzh2gyznpy73nKfEuDCl9VyEFZO b4XERJrzhAHuq55M3YJa9ms5YsAmjVK4lzCk2DahgFrRVraS9X7+o1ONIcRBtf8IfaS+ 2phO+TxL4yIUwUGMWRKsB+deVJh4HeWVeJEPJewd0LWjd6W1qemW9sjgRMVTMCGh4x/M t97lxc+CzomTo0mPo2tBd6u+EejFHQojoH1Rjt20N7uzcnzFhRW0yqvlMmchlFxsp8xn TSNmcXRmjCPL2Wpq1SBqG53eYujcdbkmWDsoKoYDgfe74w3ADjkFyGkBUbwfoPCXIjhI uDWw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:message-id:mime-version:subject:date :in-reply-to:cc:to:references; bh=eJyzG7i4wVWy+6/GhMCR1ZSufa0+vHqDViMdGTcA5EU=; b=BzljkiVYfVrtIWTdZ7rg27hQmCyk+4L0Oix+oL3YZVFZwdRSK+dHnllCPVS6MleAN+ RiBzhGqE9+gAGR42k5b6pAzcOIZaZSttKKUe3o7j1LAXnL9pahbV0EKqbJcmtQNabhN/ HUELVSJ6CBnYbXwOWmCHDS79P+1SEvgutUFtGt3IciE5fkCh4LB0XvRCkIowcVJFs9A0 d38gOODXCQhK1oa/6592bgvaO3GC2A9vUBBoKuwRLePzIbAScMsAfcNuMtriJl02aTHP NWOlHi0VoYSPPHESF/OaluVJw85TKdOM8R2gmwqEn7TXq0B4vGtBvEfMCg1SXpbKMIol Si8w==
X-Gm-Message-State: APjAAAUoAJTkdNMF+neqnoslMpvsCse8KVehZKbSjrneR8m6YgukDRvx i1bRz7mi8Y45RGcfhugm0BI=
X-Google-Smtp-Source: APXvYqztkyC93xYVwL3R+uuJqGSA0o1/ve6vexBd8azfXZ9D7lQ4LAj8uxvJX9IzABkAu3nM/eifew==
X-Received: by 2002:a1c:a546:: with SMTP id o67mr5260837wme.57.1571927272470; Thu, 24 Oct 2019 07:27:52 -0700 (PDT)
Received: from [192.168.0.62] (89-156-101-160.rev.numericable.fr. [89.156.101.160]) by smtp.gmail.com with ESMTPSA id x21sm3314947wmj.42.2019.10.24.07.27.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 24 Oct 2019 07:27:51 -0700 (PDT)
From: Karthikeyan Bhargavan <karthik.bhargavan@gmail.com>
Message-Id: <EDB75FDB-CC49-48FD-AB23-32AB9B3D19F3@gmail.com>
Content-Type: multipart/alternative; boundary="Apple-Mail=_597A1C7F-BBF1-4E95-AC06-012B803A6561"
Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\))
Date: Thu, 24 Oct 2019 16:27:50 +0200
In-Reply-To: <2A6658F1-15AC-4BD0-87E2-E49EC36CE79D@ericsson.com>
Cc: "lake@ietf.org" <lake@ietf.org>
To: Göran Selander <goran.selander@ericsson.com>
References: <E28DDCCB-7F3B-4CFD-898C-93A9A80B7184@gmail.com> <948ECECE-5425-4720-A0BA-F1E918F9F8F9@gmail.com> <2A6658F1-15AC-4BD0-87E2-E49EC36CE79D@ericsson.com>
X-Mailer: Apple Mail (2.3445.104.11)
Archived-At: <https://mailarchive.ietf.org/arch/msg/lake/IIIAORQN3_nvmEhzixEfrAMttiI>
Subject: Re: [Lake] Static-DH-based Protocols for LAKE
X-BeenThere: lake@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: Lightweight Authenticated Key Exchange <lake.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/lake>, <mailto:lake-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/lake/>
List-Post: <mailto:lake@ietf.org>
List-Help: <mailto:lake-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/lake>, <mailto:lake-request@ietf.org?subject=subscribe>
X-List-Received-Date: Thu, 24 Oct 2019 14:27:58 -0000

Hi Goran

> https://ericssonresearch.github.io/EDHOC/OPTLS-type-authentication/draft-selander-ace-cose-ecdhe.html#rfc.appendix.B <https://ericssonresearch.github.io/EDHOC/OPTLS-type-authentication/draft-selander-ace-cose-ecdhe.html#rfc.appendix.B>

Thanks for the GitHub link, I was not aware of this version.

> The protocol specified in Appendix B in the github is very similar to what you spell out in the mail below and with the same favorable message overhead as you listed in the table below. There are also the differences which we would like to understand in detail, but haven't had time to look at yet. Obviously, the ability to prove strong security properties should be guiding the detailed design. Also, it should be noted that the protocol in Appendix B is not optimized.

Indeed, it will be good to thrash through the options here. 
As I noted, there are many variants that will do the job, as long as we can agree what the constraints are.

> In our understanding of the requirements, we are targeting an AKE with three modes: PSK-only, RPK and certificate based. For PSK-only we do not require static DH-keys (which you do not either in your PSK LAKE instance below). For the certificate based mode we are requested to support signature-based public keys, since that is what is standardized and available in e.g. the X.509 based ecosystem. This does not exclude the use of certificates with static DH-keys, but for wide applicability we can't restrict to that certificate use case. The static DH mode corresponds in our view to an intermediate mode of the protocol between PSK-only and signature based. This is what we intended with the protocol setup as described in the github version, but this is still open for discussion and in particular in the details. 

One possibility for the certificate-based mode is to use a delegated credential. 
That is, use an X.509 certificate as usual, and use the leaf key to sign the DH key.
This adds the bit-cost of one signature, but since such credentials can be cached, this need not be not be a recurring cost.

In fact, the TLS 1.3 semi-static DH draft (https://tools.ietf.org/html/draft-rescorla-tls-semistatic-dh-01 <https://tools.ietf.org/html/draft-rescorla-tls-semistatic-dh-01>) also proposes a DH-based key exchange (a different variant),
and it relies on delegated credentials (https://tools.ietf.org/html/draft-ietf-tls-subcerts-04 <https://tools.ietf.org/html/draft-ietf-tls-subcerts-04>).

> It is interesting to note the trade-off your highlight between ID-PSK privacy and server authentication in the second message. The preferences of the community on this point still needs to be understood.

Yes, this will be good to understand. I find it a bit strange that we are working so hard to protect the privacy public key identities but that we do not try to protect PSK identifiers.

Best,
Karthik

> 
> Looking forward to an interesting discussion!
> 
> Göran
> 
> 
> On 2019-10-23, 13:13, "Lake on behalf of Karthikeyan Bhargavan" <lake-bounces@ietf.org on behalf of karthik.bhargavan@gmail.com> wrote:
> 
>    Hello All,
> 
>    In my team, we have been formally analyzing various key exchange protocols, including some that use static Diffie-Hellman keys for authentication.
>    Some of these protocols would be particularly suited to LAKE, and I note that Appendix B of EDHOC draft 14 already hints at this.
>    I wouldn’t be surprised if this has already been discussed before, so do let me know if I am repeating things everyone knows.
> 
>    For concreteness, I am sketching two protocols below and comparing them with EDHOC.
>    If there is interest in the working group, we could write up a more detailed, more general document describing the protocols and their formal analysis.
> 
>    Static DH+PSK LAKE
>    ==================
>    I propose the following composite protocol that uses both static DH and PSK (where the PSK can be set to Zero if unavailable).
>    We could easily remove PSKs from this protocol, but I left it in to show how the two authentication mechanism can be composed to obtain extra security.
>    In particular, the PSK could include some external key material (e.g. a key generated from a PQ-KEM ), and the use of PSK can protect against some bad-randomness vulnerabilities.
> 
>    For those familiar with the Noise protocol framework, this protocol corresponds to XXpsk3, except that I am using EDHOC notation here to more clearly link the protocol to LAKE:
> 
>    I -> R: TYPE, SUITES_U, G_X, C_U, UAD_1  
>    R->I:   C_U, G_Y, C_V, AEAD(K_2a; ID_CRED_V), AEAD(K_2b; UAD_2)
>    I->R: C_V, AEAD(K_3a; ID_CRED_U, ID_PSK), AEAD(K_3b; PAD_3)
> 
>    Many of the elements here are the same as EDHOC:
>    - G_X = g^x: the initiator’s ephemeral public key
>    - G_Y = g^y: the responder’s ephemeral public key
> 
>    Some things are different:
>    - ID_CRED_V is used to retrieve g^v, the responder's static Diffie-Hellman key
>    - ID_CRED_U is used to retrieve g^u, the initiator's static Diffie-Hellman key
>    - ID_PSK is used to retrieve a PSK (potentially a string of zeroes)
>    - K_2a is derived as KDF(g^xy, TH_2a)
>    - K_2b is derived as KDF(K_2a, g^xv, TH_2b)
>    - K_3a is derived as KDF(K_2b, g^uy, TH_3a)
>    - K_3b is derived as KDF(K_3a, PSK, TH_3b)
> 
>    The transcripts are computed as usual:
>    - TH_2a includes the first message and all elements of the second message up to C_V
>    - TH_2b includes the first message and all elements of the second message up to the first AEAD
>    - TH_3a includes the first two messages and all elements of the third message up to C_V
>    - TH_3b includes the first two messages and all elements of the third message up to the first AEAD
> 
>    Security guarantees: Assuming standard assumptions on full strength cryptographic primitives
>    - UAD_1 is insecure: no authenticity or confidentiality
>    - UAD_2 is authenticated by R and can only be read by the client who knows x.
>    - PAD_3 is secure: it can be read and written only by I and R.
>    - All messages from PAD_3 onwards have forward secrecy and KCI resistance
> 
>    Message Sizes: Using the same overhead numbers as in the EDHOC draft
>    - 1st message: 38 bytes
>    - 2nd message: 58 bytes
>    - 3rd message: 34 bytes
> 
>    Note:
>    - These calculations assume 8-byte AEAD tags.
>      With full 16-byte tags, the sizes would be: 38, 74, 42
>    - This protocol combines the security of PSK and Asymmetric authentication at little cost.
>       Removing PSKs would change only the third message, bringing sizes to: 38,58,32
> 
>    PSK LAKE
>    =========
> 
>    For completeness, here is the protocol using only PSKs and no static DH.
>    In Noise notation, this corresponds to the NNpsk3 pattern.
> 
>    I -> R: TYPE, SUITES_U, G_X, C_U, UAD_1  
>    R->I:   C_U, G_Y, C_V, AEAD(K_2a;  UAD_2)
>    I->R: C_V, AEAD(K_3a; ID_PSK), AEAD(K_3b; PAD_3)
> 
>    Keys:
>    - K_2a is derived as KDF(g^xy,TH_2a)
>    - K_3a is derived as KDF(K_2a, TH_3a)
>    - K_3b is derived as KDF(K_3a, TH_3b)
> 
>    Message sizes: assuming full-sized AEAD tags and the same overheads as EDHOC
>    - 1st message: 38 bytes
>    - 2nd message: 45 bytes
>    - 3rd message: 13 bytes
> 
>    Note:
>    - This protocol has the same structure as the more general protocol, except that it does not use static DH keys
>    - An important difference between this proposal and the EDHOC PSK case, is that here, we seek to provide privacy for ID_PSK by putting it in the third message.
>    - We could modify both protocols to send ID_PSK in the first message.
>      This has a privacy cost, but the benefit that we can obtain server authentication already at the second message.
> 
> 
>    MANY OTHER VARIANTS
>    ======================
> 
>    I have sketched the above variants only to give rough examples of what we think are lightweight protocols for which we can prove strong security properties.
>    Many other variations are possible and may be worth considering. 
> 
>    I am looking forward to your comments, especially if I am misunderstanding some requirements.
> 
>    Best regards,
>    Karthik
>    (Inria Prosecco)
> 
> 
> 
>