Re: [jose] [COSE] Consensus on cryptographic agility in modern COSE & JOSE

AJITOMI Daisuke <ajitomi@gmail.com> Sat, 01 April 2023 09:09 UTC

Return-Path: <ajitomi@gmail.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 D26D9C15171E; Sat, 1 Apr 2023 02:09:26 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.094
X-Spam-Level:
X-Spam-Status: No, score=-2.094 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, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, 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=gmail.com
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 a8B6mmoQkU2C; Sat, 1 Apr 2023 02:09:22 -0700 (PDT)
Received: from mail-yb1-xb2a.google.com (mail-yb1-xb2a.google.com [IPv6:2607:f8b0:4864:20::b2a]) (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 955E3C151709; Sat, 1 Apr 2023 02:09:22 -0700 (PDT)
Received: by mail-yb1-xb2a.google.com with SMTP id j7so29897323ybg.4; Sat, 01 Apr 2023 02:09:22 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1680340161; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=+1BnywfseflcUnnEUZRGTV3FUucMEaL3D1BLDBZEr9c=; b=ky0dVS1sBidRvjb5wFJ/VBqxHVSDfTafd8n5nDZ8GbF9dz1/yTA0M6YGASKA7DKzqB x+EFKPFb14XgN52F2qoGYZLwC0PNuNGRE/cKYli9d56D3TxNaRj13pQqRXyGiKabMB63 18aOD4yPSAKXJFcH3KwQkydR+Sfr1Z++sWH6QkbaCS/goNOTyoPXiBHRL0dK6fV3tEtO DlovcMAHBX6vX5EcrwSBRAPWuVdKQaPK8a7UjRCB8JijTIW3UP51PUBII3jugg0aR6Oa vLVqHKb7uRDH9tyk5N6hd3uVmOl7oKSOce82cc0xbY8TCPHkXPkohc7Xo3TiWS3nNT1v ibDg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680340161; 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=+1BnywfseflcUnnEUZRGTV3FUucMEaL3D1BLDBZEr9c=; b=2h3bZjU2cufKCx7cKfhyVIShLI6Y1lZCzYy8YejRT4BYa09Pq9OIsThCP2SQYNc4dT ZKaKU94Z891ZtGtW+DPFCwLiZtSjgBUzZs4h79Q2gNJCUTHDRsvzxGc9o5DoyiVDUwOf lJRL3Wc9zsKZzd34o8NA62Sv8cuw/cifCT8pHmHNH5JypaAkkqj+3VeSTxOb9akOltpR bJpODRKdddpKWENdNIjnMTdpnyyYXhoE0leUBAZ7FQcmDryt3DqubLu7kk7RnyD17G2V /p1m8b+Xf7J5YXPHVCs6w4PYwIja9DaBDoh3OwPWtX/xWeph2ysSNOlnw9XsU9ErFrDU MQhA==
X-Gm-Message-State: AAQBX9flHgolfqm7bT5JRKxCk2JTlRaF03y5OJCKzQ7yeub9oTcFfljv G699u19A5M2aSSGUQlOADe2g69TFRllEw8sOBSDdVOAhWJiT
X-Google-Smtp-Source: AKy350ay1TTQMLPSLC/nBSVLmoYCWQfp96Y1Nh7pHEHs3aiXtEfbk7bt/8l6YHv9zuKYb0YdvZ3aVdqjE/uiozFz4ak=
X-Received: by 2002:a05:6902:1083:b0:b67:d295:d614 with SMTP id v3-20020a056902108300b00b67d295d614mr15863541ybu.12.1680340161294; Sat, 01 Apr 2023 02:09:21 -0700 (PDT)
MIME-Version: 1.0
References: <CAN8C-_KqEbX10mE=3sNWAJoWUkb8OSG9mDJ82XNaZHBwKNtrYg@mail.gmail.com> <ZCAVE4Wh23lc92kn@LK-Perkele-VII2.locald> <CAFWvErXg2wxRnZEj-OU6X8rhxK3XDh24UzX33YtM1vP_hubTCw@mail.gmail.com> <CAMBN2CRBcRZWxr7gq19HdQJG4enKaWyT_G1-8T=i+Lk49EAEhw@mail.gmail.com>
In-Reply-To: <CAMBN2CRBcRZWxr7gq19HdQJG4enKaWyT_G1-8T=i+Lk49EAEhw@mail.gmail.com>
From: AJITOMI Daisuke <ajitomi@gmail.com>
Date: Sat, 01 Apr 2023 18:09:11 +0900
Message-ID: <CAFWvErWcYnCfHHtbG5O-TDbKrnogegXenB+G_sfEJshzPZnhBA@mail.gmail.com>
To: Manu Sporny <msporny@digitalbazaar.com>
Cc: Ilari Liusvaara <ilariliusvaara@welho.com>, cose <cose@ietf.org>, JOSE WG <jose@ietf.org>
Content-Type: multipart/alternative; boundary="0000000000006a745205f842ae75"
Archived-At: <https://mailarchive.ietf.org/arch/msg/jose/0knwqE4tZ9iPCXAFbqeQn_YYlg4>
Subject: Re: [jose] [COSE] Consensus on cryptographic agility in modern COSE & JOSE
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, 01 Apr 2023 09:09:26 -0000

Hi Maru,

The following article is a good summary of a modern take on the
> concerns related to "cryptographic agility":
> https://www.blockchaincommons.com/musings/musings-agility/


Thank you for the information. However, this article has already been
shared previously on this COSE WG mailing list, and I have sent comments to
the author, Christopher, regarding this article.

https://mailarchive.ietf.org/arch/msg/cose/KqFj9VqJ0Fjk45fEPh-Ys8HZiP8/

As I also mention in the link above, I am an implementer of JOSE/COSE and
also an implementer of PASETO, which adopted the "Versioned protocol"
approach born from the criticism of JOSE's cryptoagility feature.

Based on my experience and observations, the Versioned Protocol approach is
not as bad as Ilari mentioned (in fact, I found it easy to implement and
quite like it), but it doesn't seem to be working well in the real world.
In fact, the version switching of PASETO has not been going well at all.

In my opinion, a better approach would be to make a generic cryptographic
utility layer (like COSE or JOSE) be cryptoagility-oriented as much as
possible, and then narrow down the choice of cryptographic algorithms as
needed in higher-level, application-specific specifications.

Best regards,
AJITOMI Daisuke

2023年3月26日(日) 23:27 Manu Sporny <msporny@digitalbazaar.com>:

> On Sun, Mar 26, 2023 at 9:49 AM AJITOMI Daisuke <ajitomi@gmail.com> wrote:
> > Taking Ilari's post into account, I would like to take some time to
> reconsider my proposal and your raised issue.
>
> The following article is a good summary of a modern take on the
> concerns related to "cryptographic agility":
>
> https://www.blockchaincommons.com/musings/musings-agility/
>
> The Data Integrity work that is happening at the W3C, in the
> Verifiable Credentials WG, is an example of an approach that attempts
> to greatly reduce the number of parameters that a non-expert developer
> has access to when configuring cryptographic systems:
>
> Approaches such as "cryptographic agility", "cryptographic layering",
> and versioning are covered here:
>
> https://www.w3.org/TR/vc-data-integrity/#agility-and-layering
> https://www.w3.org/TR/vc-data-integrity/#versioning-cryptography-suites
>
> The design philosophy behind that approach is the notion that a
> non-trivial number of developers that utilize cryptographic libraries
> in application-space are ill equipped to know how to properly choose
> cryptographic parameters, so exposing them to the ability to configure
> those parameters is less safe than choosing good defaults for them.
> Choosing between P256 or RS256 or HS256, or why one would use SHA2-256
> or SHAKE-256, and so on are difficult choices for non-experts.
>
> Therefore, the "cryptosuites approach" attempts to provide reasonable
> defaults (with new versions released when needed) to those developers
> such that the chances of them trying to work with parameters that they
> don't have the skillset to pick are greatly reduced (or, ideally,
> eliminated). This is the approach that systems like Wireguard have
> taken in the Linux kernel. Reduction in parameter choice in
> cryptographic algorithms also leads to, as has been noted in this
> thread, less fan-out and thus an easier audit surface and a reduced
> attack surface.
>
> -- manu
>
> --
> Manu Sporny - https://www.linkedin.com/in/manusporny/
> Founder/CEO - Digital Bazaar, Inc.
> News: Digital Bazaar Announces New Case Studies (2021)
> https://www.digitalbazaar.com/
>