Re: [COSE] COSE Support for AES-CTR and AES-CBC

Russ Housley <housley@vigilsec.com> Mon, 31 October 2022 19:33 UTC

Return-Path: <housley@vigilsec.com>
X-Original-To: cose@ietfa.amsl.com
Delivered-To: cose@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 6F877C1526ED for <cose@ietfa.amsl.com>; Mon, 31 Oct 2022 12:33:45 -0700 (PDT)
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, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_HI=-5, RCVD_IN_ZEN_BLOCKED_OPENDNS=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=unavailable 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 s6KhW0qxjP9J for <cose@ietfa.amsl.com>; Mon, 31 Oct 2022 12:33:41 -0700 (PDT)
Received: from mail3.g24.pair.com (mail3.g24.pair.com [66.39.134.11]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 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 31284C1526EE for <cose@ietf.org>; Mon, 31 Oct 2022 12:33:41 -0700 (PDT)
Received: from mail3.g24.pair.com (localhost [127.0.0.1]) by mail3.g24.pair.com (Postfix) with ESMTP id 356A06ABAC; Mon, 31 Oct 2022 15:33:40 -0400 (EDT)
Received: from [10.0.1.2] (pfs.iad.rg.net [198.180.150.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail3.g24.pair.com (Postfix) with ESMTPSA id 01E706AC38; Mon, 31 Oct 2022 15:33:39 -0400 (EDT)
From: Russ Housley <housley@vigilsec.com>
Message-Id: <16B86DB2-7777-4944-8C70-01B79A22B5F6@vigilsec.com>
Content-Type: multipart/alternative; boundary="Apple-Mail=_FFB2CE4F-B8FC-4CAB-8F38-ACD181DA8EA1"
Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.21\))
Date: Mon, 31 Oct 2022 15:33:39 -0400
In-Reply-To: <CAEEbLAb4eBq3HZD7dqCY0R6r0YdAcmgEJPH_cEtseZ4wsJx8Mg@mail.gmail.com>
Cc: David Brown <david.brown@linaro.org>, Stephen Farrell <stephen.farrell@cs.tcd.ie>, Hannes Tschofenig <Hannes.Tschofenig@arm.com>, "Arciszewski, Scott" <scottarc@amazon.com>, "Zundel, Brent" <brent.zundel@avast.com>, "cose@ietf.org" <cose@ietf.org>
To: Sophie Schmieg <sschmieg=40google.com@dmarc.ietf.org>
References: <CAGi82uNOmJJdO2HKcE8M491Vv_PLgk8J8vvfsEE88CMZkmALmw@mail.gmail.com> <a69db82e96374a36b1f7164da3c5556e@amazon.com> <CAEEbLAZXLmvQbXkdqJcO2erQLVBic3gfuGPv8XRTSxZRiAaAvQ@mail.gmail.com> <DBBPR08MB59154655A83674320C831E32FA329@DBBPR08MB5915.eurprd08.prod.outlook.com> <a14fb861-5575-1896-0636-478148062562@cs.tcd.ie> <93270E49-2197-433A-A5A0-C8484ED26BE5@vigilsec.com> <Y1vq7ezTZ+/TeELE@davidb.org> <CAEEbLAb4eBq3HZD7dqCY0R6r0YdAcmgEJPH_cEtseZ4wsJx8Mg@mail.gmail.com>
X-Mailer: Apple Mail (2.3445.104.21)
X-Scanned-By: mailmunge 3.09 on 66.39.134.11
Archived-At: <https://mailarchive.ietf.org/arch/msg/cose/4-a8OvzA1E_BUHUqHkf5uRzFlD0>
Subject: Re: [COSE] COSE Support for AES-CTR and AES-CBC
X-BeenThere: cose@ietf.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: CBOR Object Signing and Encryption <cose.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/cose>, <mailto:cose-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/cose/>
List-Post: <mailto:cose@ietf.org>
List-Help: <mailto:cose-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/cose>, <mailto:cose-request@ietf.org?subject=subscribe>
X-List-Received-Date: Mon, 31 Oct 2022 19:33:45 -0000

Sophie:

You will see in https://www.ietf.org/archive/id/draft-moran-suit-mti-02.txt tis proposing a hash-based signature algorithm in the SUIT WG.

Russ


> On Oct 31, 2022, at 3:30 PM, Sophie Schmieg <sschmieg=40google.com@dmarc.ietf.org> wrote:
> 
> I'd like to note that with firmware in particular, we will soon have to switch to hash based signature schemes in order to gain post-quantum readiness (firmware usually uses fixed signing keys, so this transition needs to happen soon and it needs to use hash based solutions to avoid parameter drift), where the signature is 1KB in the "best" case (this corresponds to stateful hash based signatures, RFC 8554 and RFC 8391, I put "best" in quotation marks because statefulness comes with its own challenges), and 8KB in the easier to use case (the stateless scheme Sphincs+ [1], currently being standardized by NIST), so the devices will need to be able to tolerate a substantial amount of overhead already, so that the 16 byte per chunk tags are less likely to be an issue in any case.
> 
> You mention that the signature is checked over the plaintext, and not over the ciphertext. This should immediately rule out CBC mode, as we would still suffer from CBC padding oracle problems, bypassing the encryption in that case. With CTR mode, this scheme is, if looked at in isolation, secure, although it would adversely affect the rest of the COSE ecosystem, for saving what is a fairly minuscule overhead of 16 bytes per chunk (with chunks being able to be several KB in size) for a use case that is as far as I can tell a DRM scheme (which usually do not rely on standardized approaches, as obfuscation is a major part of DRM).
> 
> [1] https://sphincs.org/ <https://sphincs.org/>
> On Fri, Oct 28, 2022 at 7:45 AM David Brown <david.brown@linaro.org <mailto:david.brown@linaro.org>> wrote:
> On Fri, Oct 28, 2022 at 10:21:30AM -0400, Russ Housley wrote:
> 
> > > For this purpose ciphers without integrity protection are used to
> > >   encrypt the firmware image.  Integrity protection for the firmware
> > >   image must, however, be provided and the the suit-parameter-image-
> > >   digest, defined in Section 8.4.8.6 of [I-D.ietf-suit-manifest], MUST
> > >   be used.
> > > 
> > > I'm not convinced by that. Why couldn't you just store
> > > the tag for each chunk wherever the signature is stored?
> > > 
> > > Overall, I'd say defining non-AEAD modes doesn't seem
> > > like a good trade-off.
> 
> > AES-CCM and AES-GCM require the authentication check to be performed
> > before any plaintext is returned.  So, one would have to have a
> > separate tag for each storage block, which adds a lot of overhead
> > and complexity, especially since there is already a digital
> > signature over the whole thing.
> 
> In the case described, there simply isn't storage space for a tag per
> block.  This use case performs a full signature check on the image
> before making use of it, as Russ mentions.
> 
> In the firmware update case, the system needs to be able to verify the
> signature of the image, even after the image has been decrypted, there
> has to be a signature that covers the entire plaintext.  Additional
> space for tags would reduce the space available for the firmware
> itself.  The decryption happens during an image upgrade state.  Any
> attack that results in modified plaintext would prevent the firmware
> from running, as the signature check would fail.
> 
> The goal here is to make these algorithms available for a use-case
> where they are already being used, and significant resource
> constraints make other solutions unavailable.  We would like to be
> able to register these algorithms in such a way that it is clear that
> they should not be adopted for any new use, while at the same time
> capturing this existing use case.
> 
> David
>