Re: [jose] HPKE Compact JWE Demo

Orie Steele <orie@transmute.industries> Sat, 10 February 2024 21:15 UTC

Return-Path: <orie@transmute.industries>
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 889FDC14F602 for <jose@ietfa.amsl.com>; Sat, 10 Feb 2024 13:15:28 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -7.105
X-Spam-Level:
X-Spam-Status: No, score=-7.105 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, HTML_MESSAGE=0.001, 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_BLOCKED=0.001, URIBL_DBL_BLOCKED_OPENDNS=0.001, URIBL_ZEN_BLOCKED_OPENDNS=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=transmute.industries
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 xVqhsLp5KCXd for <jose@ietfa.amsl.com>; Sat, 10 Feb 2024 13:15:24 -0800 (PST)
Received: from mail-pl1-x635.google.com (mail-pl1-x635.google.com [IPv6:2607:f8b0:4864:20::635]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 633AEC14F5FA for <jose@ietf.org>; Sat, 10 Feb 2024 13:15:24 -0800 (PST)
Received: by mail-pl1-x635.google.com with SMTP id d9443c01a7336-1d99c5f6bfeso19660295ad.1 for <jose@ietf.org>; Sat, 10 Feb 2024 13:15:24 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=transmute.industries; s=google; t=1707599723; x=1708204523; darn=ietf.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=NDZyHokRheLs8ZWdcnVK911OK71+g0NY8A4pzurTjd0=; b=bbU6K1NldoViOYdd977pNxLVvx/aViWPc4Eyzl/CJqNEEh/tmldvUPbMgua90bin1S 6qLZM+xK0UC/xruAtH0WMQPBcFo9ssK4Pit4AdJZ3XYv+Sl3+2Is8MCqqfc10e3qTE+v ljqQPZVfUcwvboW+durqBpChJyy4of9TSzqasrKO1YU+9l9Uf7m+0AoxgNhm8GGoG06l hjc09tjXGVL/ZkTr1a89U/PVCdKWut/ZvwxJuY7yT4arpd6XvAv0AWbMTpbcdz+s5nqR njFVs0vROw0i9nx3Mg6yNvh7Rco8U+PJTidycOXTem0KmcSuwDQAvplcwK/+1BSY/gBq qSPQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707599723; x=1708204523; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=NDZyHokRheLs8ZWdcnVK911OK71+g0NY8A4pzurTjd0=; b=uKdoiIqtRiguZCrKVrQIbp3NDoiDBLX2wmuy9Ez5sq3Gt4jU7KtAcqPpXHaN6wQHNE hW8dufuuit5rqbC89/wXhnT4BD9N+IEpZRudOI+/Ik0aOA+q/6Gc8PeJ7jc2zeFNEE9P 7sH6dyQDI65KO7QTRB5rBk3Ib0VkM4Ox2erEmWBeVAjsAlLtt3RzTO2x9oCDDQR43PB2 W8ShLhX0ccHlVRdzT25P0sJ939DTBESyg5YqKcEoviwo0faFEVrKsqVaUgqO4b5nwU/Z TH+a651MUz0WDIIACgwQcoUDR8OECeiM/lJjaaLebRezuk80cXtCylvF9VZEB/suIPdy LJhA==
X-Gm-Message-State: AOJu0YyB7H8o8EFcSZ9w/3zF24xfFr2I2PIY1I8q5Q4STUQwINUIbEQH aubSCdvBnjFl7lodSIgWTzfbxq9Bbprvqr4TehzGMM0xL8iejiVkOeMaCwApM73WxBmXdLYa/Mm QP5DmhEFQLmwgHP6AnrEydyLE7uCDU0w9MIMVqL+5MkZKCr9o
X-Google-Smtp-Source: AGHT+IFljFh7l3K9GQvwT+CZthqyZUYpck/4SOhBOgMWtcnVKrL8HtyM/6PGpNBOxbBg9rRwZ9XOovFWDR6sf+k2zdg=
X-Received: by 2002:a17:90a:f0d2:b0:296:530:996e with SMTP id fa18-20020a17090af0d200b002960530996emr4050897pjb.20.1707599723530; Sat, 10 Feb 2024 13:15:23 -0800 (PST)
MIME-Version: 1.0
References: <CAN8C-_KgcsaY9A4icRhjHAPnEVb8fYu3vzf0=mk_ODkGEVDDtw@mail.gmail.com> <Zce0L9JgcfA2CAE7@LK-Perkele-VII2.locald>
In-Reply-To: <Zce0L9JgcfA2CAE7@LK-Perkele-VII2.locald>
From: Orie Steele <orie@transmute.industries>
Date: Sat, 10 Feb 2024 15:15:11 -0600
Message-ID: <CAN8C-_+aK5U3iVLJxg4RFe09K+OmkPfboROjRJYViwoYzcywRw@mail.gmail.com>
To: Ilari Liusvaara <ilariliusvaara@welho.com>
Cc: JOSE WG <jose@ietf.org>
Content-Type: multipart/alternative; boundary="000000000000f09e5d06110d8ae1"
Archived-At: <https://mailarchive.ietf.org/arch/msg/jose/Bve1AEGIkLSpOFLPTQzrhDY2JWQ>
Subject: Re: [jose] HPKE Compact JWE Demo
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: Sat, 10 Feb 2024 21:15:28 -0000

This list feels like mostly complaints about JWE, and not about JOSE HPKE.

With compatibility with ECDH-ES JWE shown, I feel pretty confident that the
design is on a good track.

If there are problems in the design we have now... those problems are
fundamental to JWE.

We are adding HPKE support to JWE not making an incompatible alternative to
JWE, that only works with HPKE.

Adding the ability to upgrade to HPKE without major breaking interface
changes is the objective, and greenfielding alternatives to JWE just delays
adoption of KEMs and resilience to harvest now decrypt later.

The guiding principle is this:

Adding HPKE based single recipient and multiple recipient support, with as
few changes to JWE as possible.

This constraint makes our job simple... What parameters go in headers? How
can we accomplish what is needed with as few HPKE specific changes as
possible.

The current draft does the best at this so far, but it's possible in can be
further improved.

I don't think your suggestion to concatenate strings values for enc and ct
is an improvement.

OS





On Sat, Feb 10, 2024, 11:46 AM Ilari Liusvaara <ilariliusvaara@welho.com>
wrote:

> On Sat, Feb 10, 2024 at 08:39:07AM -0600, Orie Steele wrote:
> > Hello Hybrid Public Key Encryption Enthusiasts,
> >
> > I feel JOSE HPKE is getting very close to stable, we have demonstrated
> > compact and json serialization, including key encryption with both HPKE
> and
> > normal ECDH-ES.
>
> I feel that JOSE HPKE is far from stable.
>
> I did start writing review of draft-rha-jose-hpke-encrypt-03, but never
> finished that because I hit just too many issues to properly write up.
>
>
> Very abbrevated list (some involve aspects of JWE I only learned about
> recently):
>
> 1) Key Management Modes are defined by JWE, not JWA.
> 2) Key Agreement has nothing to do with the way HPKE is used.
> 3) The mode descriptions are misleading.
> 4) Encapsulated key is neither a structure nor a public key.
> 5) Using header parameters for encapsulated key is problematic.
> 6) Using JWK for encapsulated key is too complicated.
> 7) "enc" existing does not mean it is Key Encryption, just not
>    Integrated Encryption.
> 8) JWE requires serialization invariance, which precludes any
>    requirement on serialization used.
> 9) JWE unions the recipient headers, which precludes requirements on
>    bucket used for any existing parameter.
> 10) JWE allows "enc" to be in recipient header(!) if all recipients have
>     the same value. *vomit*. This precludes requiring enc to be in any
>     given bucket.
> 11) Using JWE aad for recipients will cause severe implementation
>     issues. There is clear precedent of not doing that even with
>     something AEAD-capable.
> 12) Mode_auth and mode_auth_psk with Key Encryption are insecure.
>
>
> Deviating from important JWE requirements with single-recipient mode
> needs to be done carefully, because doing so can cause nasty issues with
> implementations. Doing so in multi-recipient mode is categorically not
> acceptable.
>
>
> The simplest way to handle HPKE seal outputs is to just concatenate the
> two, no length markers. This would seem to work well for both modes.
>
> That is:
>
> JWE_ciphertext = hpke_enc || hpke_ct
> JWE_encrypted_key = hpke_enc || hpke_ct
>
>
>
>
> -Ilari
>
> _______________________________________________
> jose mailing list
> jose@ietf.org
> https://www.ietf.org/mailman/listinfo/jose
>