Re: [Json] RFC 8785 - JSON Canonicalization Scheme

Ulysse Carion <> Mon, 06 July 2020 01:10 UTC

Return-Path: <>
Received: from localhost (localhost []) by (Postfix) with ESMTP id B1CCB3A0CE9 for <>; Sun, 5 Jul 2020 18:10:57 -0700 (PDT)
X-Virus-Scanned: amavisd-new at
X-Spam-Flag: NO
X-Spam-Score: -2.098
X-Spam-Status: No, score=-2.098 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, RCVD_IN_DNSWL_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: (amavisd-new); dkim=pass (1024-bit key)
Received: from ([]) by localhost ( []) (amavisd-new, port 10024) with ESMTP id xWbm1npr2SAR for <>; Sun, 5 Jul 2020 18:10:55 -0700 (PDT)
Received: from ( [IPv6:2607:f8b0:4864:20::d29]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by (Postfix) with ESMTPS id 1B68C3A0CE6 for <>; Sun, 5 Jul 2020 18:10:55 -0700 (PDT)
Received: by with SMTP id v8so37568221iox.2 for <>; Sun, 05 Jul 2020 18:10:54 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=M7j92A29fq4YY2PoB1MJumNClb6RioajxmYUEpkmUGI=; b=mto6vQq2EddOY6p1h0wqxhqO+X4Kz+aT+JCbSwJJsYAE6/3rFbOmKVxis3Ab9FV69j JBIS0TxnEZLrZPT/S1uZlGGcKQjvLTROc19zDLCnD/bqe7pELSjx4LQoDMgb8VGrh4dH Xf0BgmA9LDm8ceZhejffnndbzcDoxvGkqBIOc=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=M7j92A29fq4YY2PoB1MJumNClb6RioajxmYUEpkmUGI=; b=HCxp52y143Y0yxjkzbXTgDR+Kna4OGhORIMMnU7XN/pZUKeETrwzpj9SfKcfd5j8wJ zK3ajLnnmv05uBEcW8Wut//gpe0mG8jQbNwpVA974VRo/mNcWs0fB2HvgZG9y7+XdLf7 damiEniTRSYBHEBYjd3KN+ArJkhmsJPMnK4uZPFFs6moPqOceuAjKK0zPDWQ65OSawKx yjpVzHT5YAAxQWek3iJNLbuv080++FtisxH6ITLSCD9G6UOwKkyOwUzZVG+R0TQMbzuY Mx1mJnDjSHEqEnKPDgZDGwZASnejpxH5DC6pH78Br4Ce56KWoFrwPyRR9vX8d5LgTdni b6BA==
X-Gm-Message-State: AOAM532syR7AkhXNoQ4yhI/Kij5fMSkWqkYFQW/FQB2oEEvLox9jj4wk v7DN1fnLKr2GyWUjDdgorcGsU8+djDfUEVoRM1Rfew==
X-Google-Smtp-Source: ABdhPJyVUSWLSKuEaMnTJ7kPBveIigVaqS3F3Ww3cg4i3sft01R0pS01/lG51hTnw6ZUyIOuQnvPD8exaq0GgGl2rio=
X-Received: by 2002:a6b:b483:: with SMTP id d125mr22989176iof.186.1593997854052; Sun, 05 Jul 2020 18:10:54 -0700 (PDT)
MIME-Version: 1.0
References: <> <>
In-Reply-To: <>
From: Ulysse Carion <>
Date: Sun, 5 Jul 2020 18:10:33 -0700
Message-ID: <>
To: Anders Rundgren <>
Cc: "" <>
Content-Type: text/plain; charset="UTF-8"
Archived-At: <>
Subject: Re: [Json] RFC 8785 - JSON Canonicalization Scheme
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: "JavaScript Object Notation \(JSON\) WG mailing list" <>
List-Unsubscribe: <>, <>
List-Archive: <>
List-Post: <>
List-Help: <>
List-Subscribe: <>, <>
X-List-Received-Date: Mon, 06 Jul 2020 01:10:58 -0000

Hi Anders,

Nice job with JCS. I've taken a stab at implementing it here (in
Golang), because I have a possible use for something like this, and
your Golang reference implementation wasn't super usable as-is:

Overall, I think this document makes sense, and -- given its
prerequisites -- is the design any one of us would have landed on
given time to meditate on the details. I usually specifically avoid
embedding signatures within the data being signed, but when that's not
an option JCS seems a quite reasonable choice.

Two notes on what you could do to help future implementers:

1. I wish you could provide some sort of script that generates
floating-point test-cases, instead of having folks download a 3.8G
file if they want to make sure they're correctly aping JavaScript's
float-to-string algorithm.

2. I don't understand why implementations MUST detect and error on
invalid surrogate pairs. For implementations that aren't implementing
their own JSON parser at the same time, doing so may not always be
possible. Can you elaborate on the reasoning, and maybe offer
implementers guidance on the relevant parts of the Unicode spec? A
prospective implementer already needs to go pretty deep into the hairy
details of floating-point numbers and character encoding, and a bit of
guidance in the developer portal would go a long way.

These are just details. Overall, I think JCS is quite nicely done.
Thanks for making this.


On Sat, Jul 4, 2020 at 11:27 AM Anders Rundgren
<> wrote:
> In case you would like to test what you can do with JSON canonicalization, there are two public Web applications at your disposal:
> Using JWS:
> Using an "unwrapped" JWS called Java Signature Format (JSF):
> A real-world implementation from OWASP using JSF:
> In Saturn JSF is not only a security solution, it is also used for counter-signatures to simplify state-holding in payment systems:
> By securely embedding related messages in each other (aka "Russian doll"), there is no need for external references to previous messages.
> Enjoy!
> Anders
> _______________________________________________
> json mailing list