[CFRG] Bart: a deniable key exchange using HPKE

Dan Harkins <dharkins@lounge.org> Wed, 20 January 2021 20:25 UTC

Return-Path: <dharkins@lounge.org>
X-Original-To: cfrg@ietfa.amsl.com
Delivered-To: cfrg@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id B25173A1447 for <cfrg@ietfa.amsl.com>; Wed, 20 Jan 2021 12:25:33 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.9
X-Spam-Level:
X-Spam-Status: No, score=-1.9 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
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 cPJ54jngVJFl for <cfrg@ietfa.amsl.com>; Wed, 20 Jan 2021 12:25:32 -0800 (PST)
Received: from www.goatley.com (www.goatley.com [198.137.202.94]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 5AC643A1446 for <cfrg@irtf.org>; Wed, 20 Jan 2021 12:25:32 -0800 (PST)
Received: from trixy.bergandi.net (cpe-76-176-14-122.san.res.rr.com [76.176.14.122]) by wwwlocal.goatley.com (PMDF V6.8 #2433) with ESMTP id <0QN90010S22J89@wwwlocal.goatley.com> for cfrg@irtf.org; Wed, 20 Jan 2021 14:25:32 -0600 (CST)
Received: from blockhead.local ([69.12.173.8]) by trixy.bergandi.net (PMDF V6.7-x01 #2433) with ESMTPSA id <0QN900N1U1ZE7G@trixy.bergandi.net> for cfrg@irtf.org; Wed, 20 Jan 2021 12:23:38 -0800 (PST)
Received: from 69-12-173-8.static.dsltransport.net ([69.12.173.8] EXTERNAL) (EHLO blockhead.local) with TLS/SSL by trixy.bergandi.net ([10.0.42.18]) (PreciseMail V3.3); Wed, 20 Jan 2021 12:23:38 -0800
Date: Wed, 20 Jan 2021 12:25:29 -0800
From: Dan Harkins <dharkins@lounge.org>
To: "cfrg@irtf.org" <cfrg@irtf.org>
Message-id: <fd3ce067-1e1c-194b-f3e6-5dee22b00dbe@lounge.org>
MIME-version: 1.0
Content-type: text/plain; charset="utf-8"; format="flowed"
Content-language: en-US
Content-transfer-encoding: 8bit
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:68.0) Gecko/20100101 Thunderbird/68.12.0
X-PMAS-SPF: SPF check skipped for authenticated session (recv=trixy.bergandi.net, send-ip=69.12.173.8)
X-PMAS-External-Auth: 69-12-173-8.static.dsltransport.net [69.12.173.8] (EHLO blockhead.local)
X-PMAS-Software: PreciseMail V3.3 [210119] (trixy.bergandi.net)
X-PMAS-Allowed: system rule (rule allow header:X-PMAS-External noexists)
Archived-At: <https://mailarchive.ietf.org/arch/msg/cfrg/zjQLxV2u1wUZMFraDuy6KRPIaqU>
Subject: [CFRG] Bart: a deniable key exchange using HPKE
X-BeenThere: cfrg@irtf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: Crypto Forum Research Group <cfrg.irtf.org>
List-Unsubscribe: <https://www.irtf.org/mailman/options/cfrg>, <mailto:cfrg-request@irtf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/cfrg/>
List-Post: <mailto:cfrg@irtf.org>
List-Help: <mailto:cfrg-request@irtf.org?subject=help>
List-Subscribe: <https://www.irtf.org/mailman/listinfo/cfrg>, <mailto:cfrg-request@irtf.org?subject=subscribe>
X-List-Received-Date: Wed, 20 Jan 2021 20:25:34 -0000

   Hello,

   IKEv1 had an "encrypted nonce" mode of authentication that was, sadly,
left out of IKEv2. This exchange was based on the SHARE and EXCH modes
of SKEME [1]. The HPKE draft has created the opportunity to robustly and
straightforwardly do something similar, where two honest participants can
get strong mutual authentication but have plausible deniability that the
exchange actually took place by running HPKE twice. Call it Bart [2].

   HPKE is used in BASE mode only, and only with the one-shot API (the HPKE
context is destroyed after doing a single encryption and exporting a single
secret). [Note: I'm taking liberties with the HPKE APIs defined in the draft
somewhat but it should be obvious what I'm doing].

   Sa/Sb is the static identity key of Alice/Bob respectively (private 
analog is
sa/sb). Ea/Eb is ephemeral key of Alice/Bob respectively, Ka/Kb is 
secret exported
from Alice's and Bob's HPKE context, respectively. Ca/Cb is ciphertext 
from Alice
and Bob, respectively. Basically Bart does two static-ephemeral DH 
exchanges to
encrypt nonces and extract secrets, and then HKDFs the nonces as salt 
and the
secrets as keying material to produce authenticated and secret outputs.

   1. Alice and Bob already trust each other's static DH (identity) key, 
Sb/Sa.
   2. Alice and Bob create random nonces, Na and Nb respectively, and 
use HPKE to
       create contexts, ctxa/ctxb, encrypt the random nonce in the 
peer's public key,
       they both extract secrets, Ka and Kb, from the respective HPKE 
contexts:

     Na <-- Rand()
     ctxa = HPKE-setup(Sb)
     Ea, Ca = HPKE-encap(ctxa, Na)
     Ka = HPKE-export(ctxa, "some label")

                    Ea, Ca --------->
                                              ctxa = HPKE-setup(Ea, sb)
                                              Na = HPKE-decap(ctxa, Ca)
                                              Ka = HPKE-export(ctxa, 
"some label")

                                              Nb <-- Rand()
                                              ctxb = HPKE-setup(Sa)
                                              Eb, Cb = HPKE-encap(ctxb, Nb)
                                              Kb = HPKE-export(ctxb, 
"some label")

                            <----------   Eb, Cb

     ctxb = HPKE-setup(Eb, sa)
     Nb = HPKE-decap(ctxb, Cb)
     Kb = HPKE-export(ctxb, "some label")

    3. HKDF-Extract is then passed a concatenation of the two decrypted 
nonces as
(an authenticated) salt and a concatenation of the extracted secrets as 
IKM to
produce a secret:

     secret = HKDF-Extract(Na | Nb, Ka | Kb)

The secret can then be used with HKDF-Expand() to derive a key used to MAC a
transcript of the exchange (and authenticate Bart) and a key to export to an
upper-layer application.

   The nice thing is that in this exchange the key is authenticated, not 
just the
exchange. And it's completely deniable. Chas can produce a simulated 
exchange
between Alice and Bob that neither party took part in. This fact can be 
used by
both Alice and Bob to plausibly deny that they ever took part in a 
legitimate
exchange, useful for whistleblowing and muckraking use cases.

   regards,

   Dan.

[1] https://www.ndss-symposium.org/wp-content/uploads/2017/09/krawczyk.ps
[2] Bart Simpson: "I didn't do it. Nobody saw me do it. You can't prove
     anything."

-- 
"The object of life is not to be on the side of the majority, but to
escape finding oneself in the ranks of the insane." -- Marcus Aurelius