Re: [Cfrg] Second RGLC on draft-irtf-cfrg-hpke

Karthikeyan Bhargavan <karthik.bhargavan@gmail.com> Thu, 10 September 2020 01:31 UTC

Return-Path: <karthik.bhargavan@gmail.com>
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 0473E3A0A07 for <cfrg@ietfa.amsl.com>; Wed, 9 Sep 2020 18:31:30 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.087
X-Spam-Level:
X-Spam-Status: No, score=-2.087 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_KAM_HTML_FONT_INVALID=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 21V_-Mn-qneF for <cfrg@ietfa.amsl.com>; Wed, 9 Sep 2020 18:31:27 -0700 (PDT)
Received: from mail-wm1-x32d.google.com (mail-wm1-x32d.google.com [IPv6:2a00:1450:4864:20::32d]) (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 4D0913A0A04 for <cfrg@irtf.org>; Wed, 9 Sep 2020 18:31:27 -0700 (PDT)
Received: by mail-wm1-x32d.google.com with SMTP id b79so4141447wmb.4 for <cfrg@irtf.org>; Wed, 09 Sep 2020 18:31:27 -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=V2GaXZbSMak0uBsaFSoWj9iSdzJ0mFB92827pZ+cPBY=; b=dme1/VurmvUlALDtFwZySdxqHIAERdn/KKRLv70ObUftgT7tCrBc3uxN+bDJzEybt5 iO23V1MoZ1wdSnJ+7dLJq3a90PRJndUQHOIPtZMAsD1O17ORZHf0xlb0//54pYLcSud9 9Ra8Q1iqEDg8I4xPi/SgHv1vbeI0tRS0dMc8OZ6zmYzTdr+P8QvWVNHrzDHNy53nTE8X OYvEjxvhnR/6rvRj1rz7A9NOr9fvVqBNVIBHhItuNcANYUCydfhhF2pGyhvgpxiloJnu 7AffPbU3IacTY1AnZaf7uUBs8d9i8vQcXJ7eZInRUazgC65QmdREioa7/zQSLF/f6cRe nJKA==
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=V2GaXZbSMak0uBsaFSoWj9iSdzJ0mFB92827pZ+cPBY=; b=rFUpyUiMN4P9y0GC9/o5+Qf8HR8Igmt2sj6GUXpsMLnC6+FCfttPE7nKT7OoiZghbQ Z9WtfqIg8dkEfmK0mKHrq6k26hv1B+FGoENNlgD0lBLGEaVyZBCevJOs60gRJtbsQ1S6 Obf9OC+icojByvb902AKA/G1NMD0pD77ekBI6W0MRnfSfw9LplSPaq8uQefbRnZdyfex gIBoUQyJku9eRI0i1sNNJj7RQWFxYdyuBP/se9pOsrHDxa7sLHBafc8BaY8Qg065UfjD MQZqbWnNkhjyUXpBlyJdF4wBUrBKo7sW948+rgW4SLaEFakhbnvJn1Ru/dvk549B35eX JWsw==
X-Gm-Message-State: AOAM530haJ/OD3PA9fnVbmZ5/ZoKZMdyWW1lJz7bVodTIWC3ZzECaFpA YBVqJpMmNVnSaGkgd7en3gpQj6VMaVbP7Q==
X-Google-Smtp-Source: ABdhPJyLYdiDs2voMWhmkgxJROWEWK86Hrhb4tnXVzVGuwcn94pFa3c/ZpaFtFTW/6Ov2IZ6/0tQbA==
X-Received: by 2002:a05:600c:21d4:: with SMTP id x20mr5878864wmj.26.1599701485671; Wed, 09 Sep 2020 18:31:25 -0700 (PDT)
Received: from [192.168.0.20] (89-156-101-160.rev.numericable.fr. [89.156.101.160]) by smtp.gmail.com with ESMTPSA id j14sm6438519wrr.66.2020.09.09.18.31.24 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 09 Sep 2020 18:31:24 -0700 (PDT)
From: Karthikeyan Bhargavan <karthik.bhargavan@gmail.com>
Message-Id: <01F5178D-5308-417A-B1BC-E189C1422FE1@gmail.com>
Content-Type: multipart/alternative; boundary="Apple-Mail=_CAD72C49-E583-443F-AE32-89ABF74BD0A7"
Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.1\))
Date: Thu, 10 Sep 2020 03:31:23 +0200
In-Reply-To: <CAK0e1DrM6MVz5vk6HV4NPtcXExB88vWdsoPFiOicUOMOest26Q@mail.gmail.com>
Cc: cfrg@irtf.org
To: Julia Len <jlen@cs.cornell.edu>
References: <CAK0e1DrM6MVz5vk6HV4NPtcXExB88vWdsoPFiOicUOMOest26Q@mail.gmail.com>
X-Mailer: Apple Mail (2.3608.120.23.2.1)
Archived-At: <https://mailarchive.ietf.org/arch/msg/cfrg/WjbLgCVpkk9uQbcneSEk5wN4NzY>
Subject: Re: [Cfrg] Second RGLC on draft-irtf-cfrg-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: Thu, 10 Sep 2020 01:31:30 -0000

Hello Julia,

Thanks for this email.

Could you share a draft of [LGR20] so we can study the issue?

-Karthik

> On 2 Sep 2020, at 00:07, Julia Len <jlen@cs.cornell.edu> wrote:
> 
> The HPKE PSK-based sender authentication scheme could be vulnerable to what we call a partitioning oracle (PO) attack (the paper [LGR20] is in preparation -- drafts are available upon request). 
> 
> Partitioning oracle attacks against HPKE target authenticated encryption with associated data (AEAD) schemes that are non-committing, meaning attackers can construct ciphertexts that decrypt without error under more than one key. HPKE only supports GCM and ChaCha20/Poly1305 for AEAD, both of which are non-committing.
> 
> If decryption failures are observable to the sender of an HPKE ciphertext, a partitioning oracle attack can recover the PSK from a set of possible keys S as follows. An attacker can split S into two sets S0 and S1. It can then run the KEM with the receiver’s public key to get the DH shared secret, and then derive the set of AEAD keys K for each key in S0. A ciphertext can be computed so that it decrypts correctly for all keys in K. The attacker must then be able to determine whether decryption succeeds. If the ciphertext is decrypted correctly, the correct PSK must be in S0, and if the ciphertext does not decrypt, the correct PSK must be in S1. The attacker can then repeat the above steps, setting S appropriately to S0 or S1, until it finds the correct PSK. This attack enables the adversary to recover the PSK in time logarithmic in the size of the original set S. 
> 
> The draft anticipates a decryption oracle being used to attempt to learn the PSK. The authors observe that with “access to an oracle that allows to distinguish between a good and a wrong PSK, [the sender] can perform a dictionary attack on the PSK”. However, because the AEADs are non-committing, a PO attack can potentially give an exponential speed-up over a naive dictionary attack, making remote PSK recovery more feasible. Furthermore, while the scheme specifies it is not suitable for use with passwords, it does permit short PSKs. (Section 8.4 currently says ‘Using a PSK shorter than "Nh" bytes is permitted.’, where Nh is the output size of the key derivation function.)
> 
> Our recommended mitigation is changing the HPKE PSK sender auth construction to use a committing AEAD scheme. For example, Encrypt-then-HMAC type schemes can be made committing. Unfortunately we are unaware of any standard that specifies a committing AEAD scheme. A less disruptive mitigation is to strengthen the language in the HPKE specification, warning about partitioning oracle attacks and requiring PSKs to have sufficient min-entropy (say, 128 bits) to make PSK extraction via partitioning oracle infeasible. Example text for consideration is below:
> 
> The second paragraph of Section 8.4 could be modified to say the following:
> 
> HPKE is specified to use HKDF as key derivation function. HKDF is not designed to slow down dictionary attacks, see [RFC5869 <https://www.ietf.org/id/draft-irtf-cfrg-hpke-05.html#RFC5869>]. Thus, HPKE's PSK mechanism is not suitable for use with a low-entropy password as the PSK: in scenarios in which the adversary knows the KEM shared secret shared_secret and has access to an oracle that allows to distinguish between a good and a wrong PSK, it can perform PSK-recovering attacks. This oracle can be the decryption operation on a captured HPKE ciphertext or any other recipient behavior which is observably different when using a wrong PSK. The adversary knows the KEM shared secret shared_secret if it knows all KEM private keys of one participant. In the PSK mode this is trivially the case if the adversary acts as sender.  
> 
> To recover a lower entropy PSK, an attacker in this scenario can trivially perform a dictionary attack. Given a set S of possible PSK values, the attacker generates an HPKE ciphertext using each value in S, and submits the resulting ciphertexts to the oracle to learn which PSK is being used by the receiver. Further, because HPKE uses AEAD schemes that are not key-committing, an attacker can mount a partitioning oracle attack [LGR20] which can recover the PSK from a set of S possible PSK values, with |S| = m*k, in roughly m + log k queries to the oracle using ciphertexts of length proportional to k, the maximum message length in blocks. The PSK must therefore be chosen with sufficient entropy so that m + log k is prohibitive for attackers (e.g., 2^128).
> 
> [LGR20] Len, J., Grubbs, P., Ristenpart, T. Partitioning Oracle Attacks. In preparation, 2020.
> 
> Regards,
> Julia Len, Paul Grubbs, and Tom Ristenpart
> 
> 
> > Dear CFRG participants,
> >
> > This message starts a second 2-week RGLC on "Hybrid Public Key
> > Encryption" (draft-irtf-cfrg-hpke-05), that will end on August 31st. See
> > https://datatracker.ietf.org/doc/draft-irtf-cfrg-hpke/ <https://datatracker.ietf.org/doc/draft-irtf-cfrg-hpke/> for the latest
> > version of the draft.
> >
> > We are having the second RGLC because we didn't have much feedback during
> > the first RGLC and because we have obtained two new Crypto Panel reviews:
> >
> > https://mailarchive.ietf.org/arch/msg/crypto-panel/Ol1Mm8JUpmgapgq8ppnBQQSlEkE/ <https://mailarchive.ietf.org/arch/msg/crypto-panel/Ol1Mm8JUpmgapgq8ppnBQQSlEkE/>
> > https://mailarchive.ietf.org/arch/msg/cfrg/7zhOHPFkCyZC00xLZnsEBT3o6ZU/ <https://mailarchive.ietf.org/arch/msg/cfrg/7zhOHPFkCyZC00xLZnsEBT3o6ZU/>
> >
> > Please send your comments, as well as expression of support to publish as
> > an RFC (or possible reasons for not doing so) in reply to this message or
> > directly to CFRG chairs.
> >
> >
> 
> > Regards,
> > Stanislav, Nick and Alexey
> > _______________________________________________
> > Cfrg mailing list
> > Cfrg@irtf.org <mailto:Cfrg@irtf.org>
> > https://www.irtf.org/mailman/listinfo/cfrg <https://www.irtf.org/mailman/listinfo/cfrg>_______________________________________________
> Cfrg mailing list
> Cfrg@irtf.org
> https://www.irtf.org/mailman/listinfo/cfrg