Re: [jose] HPKE Single Shot for Compact JWE

Ilari Liusvaara <ilariliusvaara@welho.com> Sun, 11 February 2024 16:56 UTC

Return-Path: <ilariliusvaara@welho.com>
X-Original-To: jose@ietfa.amsl.com
Delivered-To: jose@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 2E738C14F5FE for <jose@ietfa.amsl.com>; Sun, 11 Feb 2024 08:56:14 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -6.907
X-Spam-Level:
X-Spam-Status: No, score=-6.907 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_HI=-5, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01, URIBL_DBL_BLOCKED_OPENDNS=0.001, URIBL_ZEN_BLOCKED_OPENDNS=0.001] autolearn=ham autolearn_force=no
Received: from mail.ietf.org ([50.223.129.194]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id M3aIhLFjZByI for <jose@ietfa.amsl.com>; Sun, 11 Feb 2024 08:56:12 -0800 (PST)
Received: from welho-filter1.welho.com (welho-filter1b.welho.com [83.102.41.27]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 859F8C14F5E8 for <jose@ietf.org>; Sun, 11 Feb 2024 08:56:06 -0800 (PST)
Received: from localhost (localhost [127.0.0.1]) by welho-filter1.welho.com (Postfix) with ESMTP id A0B9C1802E for <jose@ietf.org>; Sun, 11 Feb 2024 18:56:03 +0200 (EET)
X-Virus-Scanned: Debian amavisd-new at pp.htv.fi
Received: from welho-smtp1.welho.com ([IPv6:::ffff:83.102.41.84]) by localhost (welho-filter1.welho.com [::ffff:83.102.41.23]) (amavisd-new, port 10024) with ESMTP id kv3vUj1kO6iN for <jose@ietf.org>; Sun, 11 Feb 2024 18:56:03 +0200 (EET)
Received: from LK-Perkele-VII2 (78-27-96-203.bb.dnainternet.fi [78.27.96.203]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by welho-smtp1.welho.com (Postfix) with ESMTPSA id A04017A for <jose@ietf.org>; Sun, 11 Feb 2024 18:39:15 +0200 (EET)
Date: Sun, 11 Feb 2024 18:39:15 +0200
From: Ilari Liusvaara <ilariliusvaara@welho.com>
To: JOSE WG <jose@ietf.org>
Message-ID: <Zcj4M8MgUrwny84u@LK-Perkele-VII2.locald>
References: <CAN8C-_LCB33RocisCO21_kgt=vUN3VterUf88HS+mswn4w1fUQ@mail.gmail.com> <CAN8C-_Lyir--FwCqBGOEMuAAs_4WhGB-n=ozMJoTqEo7vYyU5Q@mail.gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Disposition: inline
In-Reply-To: <CAN8C-_Lyir--FwCqBGOEMuAAs_4WhGB-n=ozMJoTqEo7vYyU5Q@mail.gmail.com>
Sender: ilariliusvaara@welho.com
Archived-At: <https://mailarchive.ietf.org/arch/msg/jose/LtE_ICuXbpli5UxpQ2yRPJT7H4s>
Subject: Re: [jose] HPKE Single Shot for Compact JWE
X-BeenThere: jose@ietf.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: Javascript Object Signing and Encryption <jose.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/jose>, <mailto:jose-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/jose/>
List-Post: <mailto:jose@ietf.org>
List-Help: <mailto:jose-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/jose>, <mailto:jose-request@ietf.org?subject=subscribe>
X-List-Received-Date: Sun, 11 Feb 2024 16:56:14 -0000

On Sun, Feb 11, 2024 at 08:04:20AM -0600, Orie Steele wrote:
> Sorry for 2 messages, I hit send early on the last one.
> 
> I was just adding the comment about validated enc, see
> https://datatracker.ietf.org/doc/html/rfc8725#name-validate-cryptographic-inpu
> 
> > The JWS/JWE library itself must validate these inputs before using them,
> or it must use underlying cryptographic libraries that do so (or both!).
> 
> It could be cool to trust the HPKE implementation to validate the "enc"
> value, or you might validate it before even invoking a single shot API.

One can trust the HPKE implementation to do that.

RFC 9180, section 7.1.4. (Validation of Inputs and Outputs).
 

> I like the design of transported "encapsulated keys" in protected headers
> when possible.

Normally that is OK, because KEM and AEAD steps are separate. E.g.,
with Direct Key Agreement.

 
> Even if it's redundant to the internals of HPKE, as the JWT BCP notes,
> redundant security checks are ok.

However, HPKE couples KEM and AEAD steps in single-shot, so it is not a
redundant security check anymore. And HPKE multi-shot is intended for
things that will not work with JOSE anyway.

(It is just that HPKE allows mixup between single-shot messages and the
first multi-shot message.)




-Ilari