Re: [dispatch] Other uses of JCS (JSON Canonicalization Scheme)

Bret Jordan <jordan.ietf@gmail.com> Fri, 17 May 2019 17:01 UTC

Return-Path: <jordan.ietf@gmail.com>
X-Original-To: dispatch@ietfa.amsl.com
Delivered-To: dispatch@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id C5D58120144 for <dispatch@ietfa.amsl.com>; Fri, 17 May 2019 10:01:00 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.999
X-Spam-Level:
X-Spam-Status: No, score=-1.999 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-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 Z0BwzbYwYaIf for <dispatch@ietfa.amsl.com>; Fri, 17 May 2019 10:00:57 -0700 (PDT)
Received: from mail-it1-x134.google.com (mail-it1-x134.google.com [IPv6:2607:f8b0:4864:20::134]) (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 6825012013C for <dispatch@ietf.org>; Fri, 17 May 2019 10:00:57 -0700 (PDT)
Received: by mail-it1-x134.google.com with SMTP id q65so13091108itg.2 for <dispatch@ietf.org>; Fri, 17 May 2019 10:00:57 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:mime-version:subject:date:references:to:in-reply-to:message-id; bh=a142rN0usmyLSUQXcisBC6JNaqBuq1fooiAhYa19EO4=; b=CSLT3sXndBPaLmWs1Wej1AiDcv/2Rw5pOSGQMXIx9rjYCW2lR0H9+ov9B9UWyIpRnG Q/DTJ54wMVuz4hiB2AYTpo0hdcmaBohtpfZw1eOT23rSLFbRGSwSn/bIqWiYiZ5vXIr7 sB84R2F08MOWpYejQoCfSixJuQqYd6Bm9NQX041apjCMa94kxSN9U9LA/voh7bQN3DCN W0S2l29gZbYv0l5Bsjb5gHWPqJm0jw3WbSrcv+uNo+KjRVdUxPP+GsdyMS/+Zs2zqWmh zhL58kSifMxntrBN3TOly3/iMIfZYlktBqJCaVnTbPt5ievD4i6MZxpKNnBwVO9bJ9RY Qhmw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:mime-version:subject:date:references:to :in-reply-to:message-id; bh=a142rN0usmyLSUQXcisBC6JNaqBuq1fooiAhYa19EO4=; b=f0bBarxWZgpT1TtN/iC4i9sh/fVScZgYIcp6U5UL3D7pX3xta8JIFyYG0RZ9781Xvm fXfqBkQlVkwYLTDCtsl2m/RRNiAc24PK9joZYkPBDMugqO2aqSotFfp2tFqhQ7PZZ7Um pe6M5enZKGnXNOD3fd9c/CGYspYSNbB4fohgcdPqXWTDKkhrtTt1S3t97v04Tu/PCuPn uOhNLmHkVqqbZGI33b/EEXEOwcMaRwJEHcyJuLgchtO2UmqWmp8z6AyHJ0NnnOC0g0Oi DZgenbL/HYmL5dL+2pq7MBJ+MkAa333VXLUEjlGXMvVEcgXr2QGr+0zSOir2My9l4Ob/ VbXg==
X-Gm-Message-State: APjAAAXwwI8WSSx66W33a4OXRvEvdtq4JGUdRsH+8/tTUfTG4VdTwPmJ wnhfVDKxXS5UwJVkrk0zM9o=
X-Google-Smtp-Source: APXvYqxfADMEqegJHdu8KWhKLOcsjRWm7JeoJ/fqjcSEgQzcPBBFD/o5RPnv0/5FZB+2PUCMiqjKIA==
X-Received: by 2002:a02:5143:: with SMTP id s64mr38553787jaa.54.1558112456639; Fri, 17 May 2019 10:00:56 -0700 (PDT)
Received: from ?IPv6:2605:a601:a990:4d00:4c14:8bc4:fe81:2a1c? ([2605:a601:a990:4d00:4c14:8bc4:fe81:2a1c]) by smtp.gmail.com with ESMTPSA id m30sm434130iti.41.2019.05.17.10.00.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 17 May 2019 10:00:55 -0700 (PDT)
From: Bret Jordan <jordan.ietf@gmail.com>
Content-Type: multipart/alternative; boundary="Apple-Mail=_4AD61FC8-0832-47B2-830F-90352292FBF0"
Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.8\))
Date: Fri, 17 May 2019 11:00:52 -0600
References: <2c55fd23-592a-98f0-ee6f-4308a8e43e73@gmail.com>
To: Anders Rundgren <anders.rundgren.net@gmail.com>, dispatch@ietf.org
In-Reply-To: <2c55fd23-592a-98f0-ee6f-4308a8e43e73@gmail.com>
Message-Id: <79C6CAA9-F5AF-4044-BAF4-9A2B141C12F5@gmail.com>
X-Mailer: Apple Mail (2.3445.104.8)
Archived-At: <https://mailarchive.ietf.org/arch/msg/dispatch/MIv991jxRrwLm41427RFQ6G9du0>
Subject: Re: [dispatch] Other uses of JCS (JSON Canonicalization Scheme)
X-BeenThere: dispatch@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: DISPATCH Working Group Mail List <dispatch.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/dispatch>, <mailto:dispatch-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/dispatch/>
List-Post: <mailto:dispatch@ietf.org>
List-Help: <mailto:dispatch-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/dispatch>, <mailto:dispatch-request@ietf.org?subject=subscribe>
X-List-Received-Date: Fri, 17 May 2019 17:01:01 -0000

Another set of examples are:

1) In the cyber threat intelligence space, organizations, ISACs, ISAOs, vendors, and tools share a lot of indicators of compromise and higher level intelligence (threat actors, campaigns, intrusion sets, TTPs, etc)  that is related in a graph (nodes/vertices and edges). In the ecosystem there can be billions of new objects created on a daily basis.  Each of these are connected to the graph.  The data in the objects is acted on and used all across the ecosystem and is used as linkage to the graph. What is needed is the ability to have a canonical representation of JSON so that it can be hashed and/or digitally signed by a producer so that a consumer will know that it was not modified by a threat actor trying to poison the data.  This community is very large and very stable and needs JCS or something very much like it ASAP.

2) In the CTI space, one often wants to do semantic equivalency checks against nodes in the graph. This can be done by using a deterministic ID method like UUIDv5 from RFC4122 where the “name” is canonicalized JSON.  Another option is using fuzzy hash technologies to see how different various pieces of threat intelligence actually are. In both cases, you need a canonicalization of JSON.  

3) The CACAO work for playbooks and collaborative courses of action will need the ability to like CTI to hash and sign data, but it will also need the ability to layer hashes and signatures and also hash and sign parts of the JSON data.  JCS gives us this ability.  

Some say, well JCS does not work for every conceivable type of data that someone might stick in to a JSON blob.  These individuals would be 100% correct.  But we are not trying to boil the ocean.  Nor solve corner cases and edge cases.  We are trying to solve the 98+% use case.  Further, in the CTI space and in the future CACAO documents, we will be talking about using I-JSON to limit JSON numbers to the IEEE number anyway.  So in this case, the specs will ALREADY support any restrictions that JCS requires.  



Thanks,
Bret
PGP Fingerprint: 63B4 FC53 680A 6B7D 1447  F2C0 74F8 ACAE 7415 0050
"Without cryptography vihv vivc ce xhrnrw, however, the only thing that can not be unscrambled is an egg."

> On May 16, 2019, at 7:11 AM, Anders Rundgren <anders.rundgren.net@gmail.com> wrote:
> 
> Since the value of clear text messaging has been unilaterally declared to be zero, maybe other and more sophisticated uses of JCS could be of some interest?
> 
> In Saturn[1] JCS is used in many different ways including for signatures and encryption.
> However, the ability to only take a hash of JSON objects has also been put to good work.  Yes, "hashable" JSON is what JCS really is.
> 
> Slightly simplified....
> 1. Merchant creates a signed PaymentRequest in the form of a JSON object and sends it to the User for authorization.
> 2. The User (SW) creates a JSON object with various properties including a timestamp, account ID and a hash of the received PaymentRequest.
> 3. The User (SW) signs the new JSON object using an account- and user-specific authorization private key.
> 4. The User (SW) encrypts the signed JSON object (User authorization) using a bank-specific encryption public key.
> 5. The User(SW) returns the encrypted authorization object + URL to the User's Bank to the Merchant.
> 6. The Merchant puts the PaymentRequest, the encrypted User authorization object and a Merchant receive account in a new JSON object.
> 7. The Merchant counter-signs the new JSON object and sends it to the User's Bank for "redemption".
> 8. The User's Bank verifies the inner and outer Merchant signatures and decrypts the User authorization object.
> 9. The User's Bank verifies that the User authorization object is signed by a key matching the claimed account ID.
> 10. If the hash of the Merchant-supplied PaymentRequest matches that of the hash in the User authorization object the request is considered valid.
> Next follows the actual payment transaction...
> 
> Using JWS as is, the PaymentRequest would need to be duplicated in step #2.
> This may not seem like a big deal but why duplicate data if not necessary?
> 
> JCS is BTW used some 8 times above.
> 
> Quirky, ugly and potentially error-prone signature solutions like TEEP's OTrP also isn't my cup of tea: https://mailarchive.ietf.org/arch/msg/dispatch/ULq1QoecXC0xXu6M5o6m3xPtUPQ
> 
> Thanx,
> Anders
> 
> 1] https://cyberphone.github.io/doc/saturn
> 
> 
> _______________________________________________
> dispatch mailing list
> dispatch@ietf.org
> https://www.ietf.org/mailman/listinfo/dispatch