Re: [Secdispatch] [art] Plain text JSON digital signatures

Bret Jordan <jordan.ietf@gmail.com> Wed, 28 April 2021 17:06 UTC

Return-Path: <jordan.ietf@gmail.com>
X-Original-To: secdispatch@ietfa.amsl.com
Delivered-To: secdispatch@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id E4F333A170C; Wed, 28 Apr 2021 10:06:46 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.096
X-Spam-Level:
X-Spam-Status: No, score=-2.096 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_FONT_LOW_CONTRAST=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, 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 3_FI4Fxw18TU; Wed, 28 Apr 2021 10:06:41 -0700 (PDT)
Received: from mail-pj1-x1032.google.com (mail-pj1-x1032.google.com [IPv6:2607:f8b0:4864:20::1032]) (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 717AE3A1708; Wed, 28 Apr 2021 10:06:41 -0700 (PDT)
Received: by mail-pj1-x1032.google.com with SMTP id k3-20020a17090ad083b0290155b934a295so3012922pju.2; Wed, 28 Apr 2021 10:06:41 -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=+xc7t7DZbJLX7ukgaJA/u4nxDO32xC1A8B/8LuZWzZw=; b=sPBoFDGCh7/rMuguZhe6u87kG7MKpOR7jAdfIo/tCmIuRH0z1CFSmJGapxe+S+D6oz fUg4IvM3TNGQo3WqVJFmxpPM3r3/r8K5tC7x3rLIYiHnyhKcnaWyyArTrTlHJFuWrmat W4K1y7FCe199fMLZ4zqxnSU8aCz3jTP+YZVQku/82zWb7ygpuiok2okLaGFbbPTykNep bAmk3NQV35SC4si/ds6LBfj0Ek//CUvroLeg7Qg8CxPuv9irccPJy3io3IFV0baENHaz mCwbz0jrlquHMYDbNhy1ET+FWW7IEs0GVJgI30uvfpFfm1mqSarKdnuHFcbzN+F6qgyS OVXg==
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=+xc7t7DZbJLX7ukgaJA/u4nxDO32xC1A8B/8LuZWzZw=; b=Rq+IoLVdm/TVHAbHU0a4Ofo0Nr1m+iuPnlG7APMNrbqL8dGv+n3KYuyghYo/jgsYTv AUWF6GeL3P6/sCEm58oU41xxc0VX0hzo2bdygZv96nvYgjKidst+O0wzBPw9a8vL/ROe h5MOh7LvKYDgtfyPbykThwi6dMt3RpzOcnNPKx3C4lsJNIQ5TBcAKYDtYf0IoMTiDG9m BUou0Rg8Ff7BI9+sBXo2lnZ56P2Qjq5Wut7CWH0+VwqbpWB42OWoBy2qOaP0Y3il5dm+ fBnsBv/C+gnYjyTjiD8s2teqHOpSqMYKbVHJc5PFieN4GvGO+zbgWmVluuEDiT0q1VGO Xx0A==
X-Gm-Message-State: AOAM532cYW7E3hPd3tb4R/9fSwAjw9lappqI3ONtkvJPx+LbSi3aeELq 1ubmIGacm8DDsT4+4cM80XA=
X-Google-Smtp-Source: ABdhPJzRs2S+frw3ms28zSoGO0Sb8mrBYIX92LpFfW0E0Sfx0L4OUIyxuEc9lzZAB54GtaxNX2RqLQ==
X-Received: by 2002:a17:902:9685:b029:e9:abc1:7226 with SMTP id n5-20020a1709029685b02900e9abc17226mr31483518plp.64.1619629599782; Wed, 28 Apr 2021 10:06:39 -0700 (PDT)
Received: from smtpclient.apple ([136.36.112.224]) by smtp.gmail.com with ESMTPSA id i126sm260693pfc.20.2021.04.28.10.06.38 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 28 Apr 2021 10:06:39 -0700 (PDT)
From: Bret Jordan <jordan.ietf@gmail.com>
Message-Id: <19A94F0B-19B6-4E19-B913-F27C5CB6AD32@gmail.com>
Content-Type: multipart/alternative; boundary="Apple-Mail=_C2F3C8C4-DEFB-4D6B-A423-EA8BE3563CA4"
Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.80.0.2.43\))
Date: Wed, 28 Apr 2021 11:06:37 -0600
In-Reply-To: <FD23AA4B-4224-4162-9243-FAFD9EAD9656@manchester.ac.uk>
Cc: Dick Hardt <dick.hardt@gmail.com>, "art@ietf.org" <art@ietf.org>, DISPATCH <dispatch@ietf.org>, "rfc-ise@rfc-editor.org" <rfc-ise@rfc-editor.org>, IETF SecDispatch <Secdispatch@ietf.org>
To: Stian Soiland-Reyes <soiland-reyes@manchester.ac.uk>
References: <CAD9ie-v7uJOpjj+nbZCfQe+4JEQt-6=b6cm57iFPAn_enGeRCQ@mail.gmail.com> <3B394519-4061-43A8-8963-55A6ADEDF269@gmail.com> <FD23AA4B-4224-4162-9243-FAFD9EAD9656@manchester.ac.uk>
X-Mailer: Apple Mail (2.3654.80.0.2.43)
Archived-At: <https://mailarchive.ietf.org/arch/msg/secdispatch/BISqr6AXuUKi1EvaLFmZT4IvPN8>
Subject: Re: [Secdispatch] [art] Plain text JSON digital signatures
X-BeenThere: secdispatch@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: Security Dispatch <secdispatch.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/secdispatch>, <mailto:secdispatch-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/secdispatch/>
List-Post: <mailto:secdispatch@ietf.org>
List-Help: <mailto:secdispatch-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/secdispatch>, <mailto:secdispatch-request@ietf.org?subject=subscribe>
X-List-Received-Date: Wed, 28 Apr 2021 17:06:47 -0000

Thanks Stian. It would be great to use this in IEEE 2791. Let's see what we need to do to make it more clear. 

Bret


> On Apr 28, 2021, at 3:21 AM, Stian Soiland-Reyes <soiland-reyes@manchester.ac.uk> wrote:
> 
> This draft is well written and an approach we would like to use in IEEE 2791, and from your text it will fit right into our “etag” field <https://opensource.ieee.org/2791-object/ieee-2791-schema/-/blob/master/2791object.json#L129> where we hope for a consistent hashing mechanism to detect changes.
>  
> The draft seems to build on JSON Web Signature (RFC7515 <https://www.rfc-editor.org/rfc/rfc7517.html>) and JSON Web Key (RFC7517 <https://www.rfc-editor.org/rfc/rfc7517.html>), but the 3.1.3 is a bit too brief for readers new to these standards, perhaps give a brief summary for this example, especially as RFC7517 is quite comprehensive with many options?
>  
> In particular it is unclear if the JWS Header also needs to be JSON canonicalized – which may be a good idea for consistent “hash” purposes like in our use case?
>  
> Here’s my rough suggestion – probably wrong! My additions unindented.
>  
> 3.1.3.  Generate a JWS String
>  
>    Use the result of the previous step as "JWS Payload" to the signature
>    process described in Appendix F of JWS [RFC7515].
>  
> In short a detached JWS is represented as the string concatenated from
>  
>       BASE64URL(UTF8(JWS Protected Header)) || '.' ||
>       || '.' ||
>       BASE64URL(JWS Signature)
>  
> Notice, for comparison with the JWS Compact Serialization, 
> that the JWS Payload is not included in the detached JWS String, 
> but replaced by an empty string.
>  
>    For the example, the JWS header is assumed to be:
>  
>    {"alg":"HS256"}
>  
> The above example is equal to its own JCS canonicalization. 
> JSON Canonicalization is not a requirement for the 
> JWS Header, however this is RECOMMENDED, combined with
> a fixed algorithm choice, if generating a consistent JWS/CT signature
> that is s also to be used as as a canonical version identifier 
> of the JSON payload content, e.g. as a strong ETag (RFC7232).
>  
> The JWS Signature of the canonicalized JSON payload, using the key 
> specified in Section 3, is the bytes
>  
> 54 75 48 b4 20 42 6f c4 39 x8 8e 3d 8a 66 ab xe 
> d2 5e 4b 11 f6 b8 b5 34 xe 1a 90 3f 96 63 c3
>  
>  
> Encoding as Base64
>  
> The resulting concatenated JWS string should then read as follows:
>  
>    eyJhbGciOiJIUzI1NiJ9..VHVItCBCb8Q5CI-49imarDtJeSxH2uLU0DhqQP5Zjw4
>  
>  
> You may want to move my ETag recommendation to an appendix, as I don’t feel it fits well where I put it, but I think it is worth pointing out. As a use case.
>  
> I don’t know enough about RFC7515, is it possible to do something like regular SHA3 or would my fingerprint use case need to just publicly declare the signature key to use?
>  
>  
> --
> Stian Soiland-Reyes, The University of Manchester
> https://www.esciencelab.org.uk/ <https://www.esciencelab.org.uk/>
> https://orcid.org/0000-0001-9842-9718 <https://orcid.org/0000-0001-9842-9718>
>     Please note that I may work flexibly – whilst it suits me to email now,
>     I do not expect a response or action outside of your own working hours.
>  
>  
> From: art <art-bounces@ietf.org <mailto:art-bounces@ietf.org>> on behalf of Bret Jordan <jordan.ietf@gmail.com <mailto:jordan.ietf@gmail.com>>
> Date: Wednesday, 28 April 2021 at 03:29
> To: Dick Hardt <dick.hardt@gmail.com <mailto:dick.hardt@gmail.com>>
> Cc: "art@ietf.org <mailto:art@ietf.org>" <art@ietf.org <mailto:art@ietf.org>>, DISPATCH <dispatch@ietf.org <mailto:dispatch@ietf.org>>, "rfc-ise@rfc-editor.org <mailto:rfc-ise@rfc-editor.org>" <rfc-ise@rfc-editor.org <mailto:rfc-ise@rfc-editor.org>>, IETF SecDispatch <Secdispatch@ietf.org <mailto:Secdispatch@ietf.org>>
> Subject: Re: [art] Plain text JSON digital signatures
>  
> Luckily this time we have RFC8785 that solves the canonicalization problem for JSON. 
> 
> Bret 
> 
> Sent from my Commodore 64
>  
> PGP Fingerprint: 63B4 FC53 680A 6B7D 1447  F2C0 74F8 ACAE 7415 0050
> 
> 
>> On Apr 27, 2021, at 7:39 PM, Dick Hardt <dick.hardt@gmail.com <mailto:dick.hardt@gmail.com>> wrote:
>> 
>> I am supportive of this work, and would also be willing to work towards a PS. I am seeing rapid growth in the demand to embed JWS in JWS.
>>  
>> Given my experience with XML-DSig (see below) making it more XML-DSig like does not sound like a good thing.
>>  
>> For any interested in some JWT history, when we were brewing up what became OAuth 2.0, we did not want to tie a token format to the implementation as many deployments had their own proprietary token formats -- but we knew new deployments would benefit from standardizing a token.
>>  
>> Our requirements were:
>> - URL safe (access tokens at the time were often passed as a query parameter -- I know, not the best idea, but working with what people wanted)
>> - HTTP header safe
>> - richer than name / value pairs
>>  
>> Options we considered:
>> ASN.1 - the 60s are calling and want their data back
>> XML-DSig - not URL safe, large size, and I personally had many scars canonicalizing XML. (An earlier company of mine had a contract to build XML-DSig libraries for a few languages)
>>  
>> JSON was becoming very cool at that time, and with base 64 URL safe encoding the string, it was URL safe, and treating the JSON text as binary dealt with the canonicalization concerns -- and JSON canonicalization did not exist.
>>  
>> Using a dot as the separator between header, payload, and signature made it easy to parse. The dot was URL safe, but not in the base 64 set.
>>  
>> And Simple Web Tokens were born -- to be renamed JSON Web Tokens.
>>  
>> /Dick
>>  
>>  
>>  
>>  
>> ᐧ
>>  
>> On Tue, Apr 27, 2021 at 8:28 AM Bret Jordan <jordan.ietf@gmail.com <mailto:jordan.ietf@gmail.com>> wrote:
>>> Dear Dispatch,
>>> 
>>> Anders Rundgren, Samuel, Erdtman, and I have been working on an ID for your consideration. This document describes how to use JWS and JCS to create plain-text JSON signatures. The abstract reads as follows:
>>> 
>>> This document describes a method for extending the scope of the JSON Web Signature (JWS) standard, called JWS/CT.  By combining the detached mode of JWS with the JSON Canonicalization Scheme (JCS), JWS/CT enables JSON objects to remain in the JSON format after being signed (aka "Clear Text" signing).  In addition to supporting a consistent data format, this arrangement also simplifies documentation, debugging, and logging.  The ability to embed signed JSON objects in other JSON objects, makes the use of counter-signatures straightforward.
>>> 
>>> The data tracker page for this: https://datatracker.ietf.org/doc/draft-jordan-jws-ct/ <https://datatracker.ietf.org/doc/draft-jordan-jws-ct/>
>>> 
>>> As you know there are large ecosystems that needs digital signatures for plain text JSON data, meaning where the JSON data is not base64 encoded. This ID provides a solution using existing IETF RFCs to make this work. Further, this work looks to be adopted by many groups and organizations from financial services, threat intelligence, and incident response. 
>>> 
>>> We are not sure what direction would be best for this work in the IETF, should we send to the ISE for publication or do you want to create a working group. Ultimately there is a lot of work that could be done in this space to meet the needs of the market. We would be happy with releasing these IDs for ISE publication, or for creating a working group to move them forward. It is just important to note that the market is in desperate need of these solutions. If you want to take it for a spin, there is a JWS/CT playground at: https://mobilepki.org/jws-ct <https://mobilepki.org/jws-ct>
>>>  
>>> Thanks
>>> Bret
>>>  
>>> -- 
>>>  
>>> Sent from my TI-99/4A
>>> 
>>> 
>>> PGP Fingerprint: 63B4 FC53 680A 6B7D 1447  F2C0 74F8 ACAE 7415 0050
>>> _______________________________________________
>>> art mailing list
>>> art@ietf.org <mailto:art@ietf.org>
>>> https://www.ietf.org/mailman/listinfo/art <https://www.ietf.org/mailman/listinfo/art>