
From nobody Thu Mar 15 22:46:31 2018
Return-Path: <anders.rundgren.net@gmail.com>
X-Original-To: json@ietfa.amsl.com
Delivered-To: json@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id E03F7124BFA for <json@ietfa.amsl.com>; Thu, 15 Mar 2018 22:46:29 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.699
X-Spam-Level: 
X-Spam-Status: No, score=-2.699 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_LOW=-0.7, 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 5u_cRgTNRM7x for <json@ietfa.amsl.com>; Thu, 15 Mar 2018 22:46:27 -0700 (PDT)
Received: from mail-wm0-x234.google.com (mail-wm0-x234.google.com [IPv6:2a00:1450:400c:c09::234]) (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 BAA9D1200F1 for <json@ietf.org>; Thu, 15 Mar 2018 22:46:26 -0700 (PDT)
Received: by mail-wm0-x234.google.com with SMTP id e194so848527wmd.3 for <json@ietf.org>; Thu, 15 Mar 2018 22:46:26 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;  h=to:from:subject:message-id:date:user-agent:mime-version :content-language; bh=a8v25rOrrixs2mRMfKr6wLBquECnSW6L09oOJZnmRfY=; b=SOh6mfPL5U5msmculsEyMNS2gzvYqqwFHqgchdOICV+gLMiPgWSr5+aQhfzL5eP/DS Uur1u7cjkcSkbFcClP8BqA8qthw66I1D0ps95WTCifb2XqZM26lrGX1D4KDQKMJUC5tn u0HrMAofossVm304ujlsCNct3xYW8xLlKS8LmHx1j+u8Ib1jD1Y6XU+ny1yf1LNTD39i 8FMDcgxCI0ffbM/s1ktR+I0XzEa3Km3Ysw105NeVShI1wMHucCpY3oFxsoqo7aR4JIOa AS0ee9TxLi7ERwETlyJWZRaROi0cXbI/nt3TLnlvNmzCHmRdjm8UaJNUe6GCM+H7TOoC nhkQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:from:subject:message-id:date:user-agent :mime-version:content-language; bh=a8v25rOrrixs2mRMfKr6wLBquECnSW6L09oOJZnmRfY=; b=MxKQcC8WPG4iHI+7SoumWYHMxyiCuQFZiID/u9Uy+e1CsPEajfzI/FfTI0Odl+PkJD tGkvGUSv+erRGSW1JTIkj33wmj1uDYcKbcHhwTdBQf7ooEikW0QD5KCry/mfIJVDy47/ M2HnsfH/a2V/eKE7Onqgztraod0GIyuPrV0XACznYrmb50pGsAxiZhz1oefbV6j60uyn l1MgLKsKLo3A1mOTVTxJ4xUtWP/Sd1Cp7Y+lRxfbXupp1VVQ4JGYddgNOgNouhkg9CPC aKi0dnnjkmUEZv75+Ur/koWnD8PfUWMLuJoKClBsd4//VxaBS9OC/gBMvYHdPizYIc5D m64Q==
X-Gm-Message-State: AElRT7F703J0p0hdyKKdKgkGf0HxI9kjNAgUwC7H8b9CGkZDDbrh2oit ZeYSxn3uQnrjCJWczLlmVFs=
X-Google-Smtp-Source: AG47ELt8gz6m2bbJqnF9cblxSAWMVb67XTE/OlfOdHyL8EIP5ylSCWtz7p1nurvyreqW7vrm3tydmw==
X-Received: by 10.80.178.134 with SMTP id p6mr1042641edd.35.1521179185280; Thu, 15 Mar 2018 22:46:25 -0700 (PDT)
Received: from [192.168.1.79] (25.131.146.77.rev.sfr.net. [77.146.131.25]) by smtp.googlemail.com with ESMTPSA id w16sm3336878edd.61.2018.03.15.22.46.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 15 Mar 2018 22:46:24 -0700 (PDT)
To: "json@ietf.org" <json@ietf.org>
From: Anders Rundgren <anders.rundgren.net@gmail.com>
Message-ID: <65d998cb-8aed-205b-98bd-ac1297310a50@gmail.com>
Date: Fri, 16 Mar 2018 06:46:20 +0100
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0
MIME-Version: 1.0
Content-Type: multipart/alternative; boundary="------------C8D6BDF83EF4968C6574A8A5"
Content-Language: en-US
Archived-At: <https://mailarchive.ietf.org/arch/msg/json/nJFkcKqG-im13X5tzITROWxMVIY>
Subject: [Json] I-D: draft-rundgren-json-canonicalization-scheme-00
X-BeenThere: json@ietf.org
X-Mailman-Version: 2.1.22
Precedence: list
List-Id: "JavaScript Object Notation \(JSON\) WG mailing list" <json.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/json>, <mailto:json-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/json/>
List-Post: <mailto:json@ietf.org>
List-Help: <mailto:json-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/json>, <mailto:json-request@ietf.org?subject=subscribe>
X-List-Received-Date: Fri, 16 Mar 2018 05:46:30 -0000

This is a multi-part message in MIME format.
--------------C8D6BDF83EF4968C6574A8A5
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit

No, this I-D has not yet been submitted to the IETF but it is available anyway :-)

    Abstract

        Cryptographic operations like hashing and signing depend on that the
        target data does not change during serialization, transport, or
        parsing.  By applying the rules defined by JCS (JSON Canonicalization
        Scheme), data provided in the JSON [RFC8259] format can be exchanged
        "as is", while still being subject to secure cryptographic
        operations.  JCS achieves this by exploiting the strict operation of
        the JSON serialization method defined in ECMAScript beginning with
        version 6 [ES6].

        The intended audiences of this document are JSON tool vendors, as
        well as designers of JSON based cryptographic solutions.

Current draft:
https://cyberphone.github.io/doc/security/draft-rundgren-json-canonicalization-scheme.html

Workspace:
https://github.com/cyberphone/json-canonicalization

I would be VERY happy to get some feedback on this!
If you have any interest in co-authoring, I'm open to suggestions.

Thanx,
Anders

// ES6 based JSON canonicalizer
'use strict';
var canonicalize = function(object) {

     var buffer = '';
     serialize(object);
     return buffer;

     function serialize(object) {
         if (object !== null && typeof object === 'object') {
             if (Array.isArray(object)) {
                 buffer += '[';
                 let next = false;
// Array - Maintain element order
                 object.forEach((element) => {
                     if (next) {
                         buffer += ',';
                     }
                     next = true;
// Recursive call
                     serialize(element);
                 });
                 buffer += ']';
             } else {
                 buffer += '{';
                 let next = false;
// Object - Sort properties before serializing
Object.keys(object).sort().forEach((property) => {
                     if (next) {
                         buffer += ',';
                     }
                     next = true;
// Properties are just strings - Use ES6
                     buffer += JSON.stringify(property);
                     buffer += ':';
// Recursive call
                     serialize(object[property]);
                 });
                 buffer += '}';
             }
         } else {
// Primitive data type - Use ES6
             buffer += JSON.stringify(object);
         }
     }
};

--------------C8D6BDF83EF4968C6574A8A5
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: 8bit

<html>
  <head>

    <meta http-equiv="content-type" content="text/html; charset=utf-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    No, this I-D has not yet been submitted to the IETF but it is
    available anyway :-)<br>
    <blockquote><font size="-1" color="#999999">Abstract</font><br>
      <br>
      <font size="-1" color="#999999">   Cryptographic operations like
        hashing and signing depend on that the</font><br>
      <font size="-1" color="#999999">   target data does not change
        during serialization, transport, or</font><br>
      <font size="-1" color="#999999">   parsing.  By applying the rules
        defined by JCS (JSON Canonicalization</font><br>
      <font size="-1" color="#999999">   Scheme), data provided in the
        JSON [RFC8259] format can be exchanged</font><br>
      <font size="-1" color="#999999">   "as is", while still being
        subject to secure cryptographic</font><br>
      <font size="-1" color="#999999">   operations.  JCS achieves this
        by exploiting the strict operation of</font><br>
      <font size="-1" color="#999999">   the JSON serialization method
        defined in ECMAScript beginning with</font><br>
      <font size="-1" color="#999999">   version 6 [ES6].</font><br>
      <br>
      <font size="-1" color="#999999">   The intended audiences of this
        document are JSON tool vendors, as</font><br>
      <font size="-1" color="#999999">   well as designers of JSON based
        cryptographic solutions.</font><br>
    </blockquote>
    Current draft:<br>
<a class="moz-txt-link-freetext" href="https://cyberphone.github.io/doc/security/draft-rundgren-json-canonicalization-scheme.html">https://cyberphone.github.io/doc/security/draft-rundgren-json-canonicalization-scheme.html</a><br>
    <br>
    Workspace:<br>
    <a class="moz-txt-link-freetext" href="https://github.com/cyberphone/json-canonicalization">https://github.com/cyberphone/json-canonicalization</a><br>
    <br>
    I would be VERY happy to get some feedback on this!<br>
    If you have any interest in co-authoring, I'm open to suggestions.<br>
    <br>
    Thanx,<br>
    Anders<br>
    <br>
    <font color="#009900"><tt>// ES6 based JSON canonicalizer</tt></font><tt><br>
    </tt><tt>'use strict';</tt><tt><br>
    </tt><tt>var canonicalize = function(object) {</tt><tt><br>
    </tt><tt><br>
    </tt><tt>    var buffer = '';</tt><tt><br>
    </tt><tt>    serialize(object);</tt><tt><br>
    </tt><tt>    return buffer;</tt><tt><br>
    </tt><tt><br>
    </tt><tt>    function serialize(object) {</tt><tt><br>
    </tt><tt>        if (object !== null &amp;&amp; typeof object ===
      'object') {</tt><tt><br>
    </tt><tt>            if (Array.isArray(object)) {</tt><tt><br>
    </tt><tt>                buffer += '[';</tt><tt><br>
    </tt><tt>                let next = false;</tt><tt><br>
    </tt><tt>                <font color="#009900">// Array - Maintain
        element order</font></tt><tt><br>
    </tt><tt>                object.forEach((element) =&gt; {</tt><tt><br>
    </tt><tt>                    if (next) {</tt><tt><br>
    </tt><tt>                        buffer += ',';</tt><tt><br>
    </tt><tt>                    }</tt><tt><br>
    </tt><tt>                    next = true;</tt><tt><br>
    </tt><tt>                    <font color="#009900">// Recursive
        call</font></tt><tt><br>
    </tt><tt>                    serialize(element);</tt><tt><br>
    </tt><tt>                });</tt><tt><br>
    </tt><tt>                buffer += ']';</tt><tt><br>
    </tt><tt>            } else {</tt><tt><br>
    </tt><tt>                buffer += '{';</tt><tt><br>
    </tt><tt>                let next = false;</tt><tt><br>
    </tt><tt>                <font color="#009900">// Object - Sort
        properties before serializing</font></tt><tt><br>
    </tt><tt>               
      Object.keys(object).sort().forEach((property) =&gt; {</tt><tt><br>
    </tt><tt>                    if (next) {</tt><tt><br>
    </tt><tt>                        buffer += ',';</tt><tt><br>
    </tt><tt>                    }</tt><tt><br>
    </tt><tt>                    next = true;</tt><tt><br>
    </tt><tt>                    <font color="#009900">// Properties
        are just strings - Use ES6</font></tt><tt><br>
    </tt><tt>                    buffer += JSON.stringify(property);</tt><tt><br>
    </tt><tt>                    buffer += ':';</tt><tt><br>
    </tt><tt>                    <font color="#009900">// Recursive
        call</font></tt><tt><br>
    </tt><tt>                    serialize(object[property]);</tt><tt><br>
    </tt><tt>                });</tt><tt><br>
    </tt><tt>                buffer += '}';</tt><tt><br>
    </tt><tt>            }</tt><tt><br>
    </tt><tt>        } else {</tt><tt><br>
    </tt><tt>            <font color="#009900">// Primitive data type -
        Use ES6</font></tt><tt><br>
    </tt><tt>            buffer += JSON.stringify(object);</tt><tt><br>
    </tt><tt>        }</tt><tt><br>
    </tt><tt>    }</tt><tt><br>
    </tt><tt>};</tt><br>
  </body>
</html>

--------------C8D6BDF83EF4968C6574A8A5--


From nobody Sat Mar 17 11:58:28 2018
Return-Path: <anders.rundgren.net@gmail.com>
X-Original-To: json@ietfa.amsl.com
Delivered-To: json@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 2DE0F12D86B for <json@ietfa.amsl.com>; Sat, 17 Mar 2018 11:58:26 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.998
X-Spam-Level: 
X-Spam-Status: No, score=-1.998 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, 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 YiY1qB2K9DnU for <json@ietfa.amsl.com>; Sat, 17 Mar 2018 11:58:24 -0700 (PDT)
Received: from mail-wr0-x230.google.com (mail-wr0-x230.google.com [IPv6:2a00:1450:400c:c0c::230]) (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 9646412D868 for <json@ietf.org>; Sat, 17 Mar 2018 11:58:23 -0700 (PDT)
Received: by mail-wr0-x230.google.com with SMTP id s18so14652972wrg.9 for <json@ietf.org>; Sat, 17 Mar 2018 11:58:23 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;  h=subject:from:to:references:message-id:date:user-agent:mime-version :in-reply-to:content-language; bh=Vpb2O/gI/dYtvxZYAX+n+z44CvRNXI6cD7QZz4YuAJE=; b=kCJHO9m+3Iz7zTmfxMX+vwCGQaMwbdwBQ8SwOmNQYEjzLmSwye6Ob34qBYqzgT4th/ IrvFLOL+q4Bf58xr+S9mbGPduirnYzPzB9bSP3qLFnKDpmMUC6063boowZEd95aaPX/e T7X+afpj/nbrbBGqb2Kac0p24UpjZjcuYoGPLc1gY/z6j7e2cPyrflTlCg0WesSOHtWv p7isehB/gNh8zJErNBqeLDEV2UgF90gVdwlmQQdhfEjJtIZX8Hfn/Og4/ELAhV99fu6G 9nqWljxPohhG38r2F19fJQ014JIXW0d9Rn8uvmCe8sUxDKv49r4337asSdEhu+T/q0ZG Y9bQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:from:to:references:message-id:date :user-agent:mime-version:in-reply-to:content-language; bh=Vpb2O/gI/dYtvxZYAX+n+z44CvRNXI6cD7QZz4YuAJE=; b=hGNGGsKyk+CkJy0jQmJOeP1nhspfDgouadk4ALAK5a7dWF1GLVHN0uwBBfHaJe4/m0 RhHUGQsdxXlRGWW0s86bgBI9+Y2mObL7DM2uhyEgBmi7n+zdKUAP3BRY3WIqoRfut10h Qcu9jtxvjJ6wBae+wMpPi52gQljj/kqOWJNutUSITqK49vWw5IBYyAQ70IjLTLUS8SDu kyFTt8sWBsxdqi3t+D3v479v0RYP6YF4SjUea92uB7Ugtjghw/1mx2dqWf9eMcRFC0SN HBzbHmudr3MQBwTdBTXQUUhjmEO0F/fWzqEV3PsTDAGJR2Tw8MeNtlOAkaOdzLGn4DeR zEAA==
X-Gm-Message-State: AElRT7FaJO4mOByEzY8KzpUXjpH336cLIA2mjhnvBuT0S0BG8Hew998c hiy8Yc29k+RYOB00QpgSLGOjFw==
X-Google-Smtp-Source: AG47ELuw64BRjGh4a9MDD0cFU0JUlvV1ppVQ++KToB9aBQrPH8CTzdC2z0RwNrrfxP8eFKgr6O7Y2Q==
X-Received: by 10.223.195.206 with SMTP id d14mr5470751wrg.0.1521313101738; Sat, 17 Mar 2018 11:58:21 -0700 (PDT)
Received: from [192.168.1.79] (25.131.146.77.rev.sfr.net. [77.146.131.25]) by smtp.googlemail.com with ESMTPSA id 142sm10815067wmq.47.2018.03.17.11.58.19 for <json@ietf.org> (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 17 Mar 2018 11:58:20 -0700 (PDT)
From: Anders Rundgren <anders.rundgren.net@gmail.com>
To: "json@ietf.org" <json@ietf.org>
References: <65d998cb-8aed-205b-98bd-ac1297310a50@gmail.com>
Message-ID: <bf013bf4-087c-d529-9473-e7a511b79869@gmail.com>
Date: Sat, 17 Mar 2018 19:58:18 +0100
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0
MIME-Version: 1.0
In-Reply-To: <65d998cb-8aed-205b-98bd-ac1297310a50@gmail.com>
Content-Type: multipart/alternative; boundary="------------35E866BC5555AB8A22FE0170"
Content-Language: en-US
Archived-At: <https://mailarchive.ietf.org/arch/msg/json/-hjkus912kG31ru7PQPpqTVLsJ0>
Subject: [Json] Browser Polyfill. Re: I-D: draft-rundgren-json-canonicalization-scheme-00
X-BeenThere: json@ietf.org
X-Mailman-Version: 2.1.22
Precedence: list
List-Id: "JavaScript Object Notation \(JSON\) WG mailing list" <json.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/json>, <mailto:json-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/json/>
List-Post: <mailto:json@ietf.org>
List-Help: <mailto:json-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/json>, <mailto:json-request@ietf.org?subject=subscribe>
X-List-Received-Date: Sat, 17 Mar 2018 18:58:26 -0000

This is a multi-part message in MIME format.
--------------35E866BC5555AB8A22FE0170
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit

https://cyberphone.github.io/doc/security/browser-json-canonicalization.html

On 2018-03-16 06:46, Anders Rundgren wrote:
> No, this I-D has not yet been submitted to the IETF but it is available anyway :-)
>
>     Abstract
>
>        Cryptographic operations like hashing and signing depend on that the
>        target data does not change during serialization, transport, or
>        parsing.  By applying the rules defined by JCS (JSON Canonicalization
>        Scheme), data provided in the JSON [RFC8259] format can be exchanged
>        "as is", while still being subject to secure cryptographic
>        operations.  JCS achieves this by exploiting the strict operation of
>        the JSON serialization method defined in ECMAScript beginning with
>        version 6 [ES6].
>
>        The intended audiences of this document are JSON tool vendors, as
>        well as designers of JSON based cryptographic solutions.
>
> Current draft:
> https://cyberphone.github.io/doc/security/draft-rundgren-json-canonicalization-scheme.html
>
> Workspace:
> https://github.com/cyberphone/json-canonicalization
>
> I would be VERY happy to get some feedback on this!
> If you have any interest in co-authoring, I'm open to suggestions.
>
> Thanx,
> Anders
>
> // ES6 based JSON canonicalizer
> 'use strict';
> var canonicalize = function(object) {
>
>     var buffer = '';
>     serialize(object);
>     return buffer;
>
>     function serialize(object) {
>         if (object !== null && typeof object === 'object') {
>             if (Array.isArray(object)) {
>                 buffer += '[';
>                 let next = false;
> // Array - Maintain element order
>                 object.forEach((element) => {
>                     if (next) {
>                         buffer += ',';
>                     }
>                     next = true;
> // Recursive call
>                     serialize(element);
>                 });
>                 buffer += ']';
>             } else {
>                 buffer += '{';
>                 let next = false;
> // Object - Sort properties before serializing
> Object.keys(object).sort().forEach((property) => {
>                     if (next) {
>                         buffer += ',';
>                     }
>                     next = true;
> // Properties are just strings - Use ES6
>                     buffer += JSON.stringify(property);
>                     buffer += ':';
> // Recursive call
>                     serialize(object[property]);
>                 });
>                 buffer += '}';
>             }
>         } else {
> // Primitive data type - Use ES6
>             buffer += JSON.stringify(object);
>         }
>     }
> };


--------------35E866BC5555AB8A22FE0170
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: 8bit

<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <div class="moz-cite-prefix"><a class="moz-txt-link-freetext" href="https://cyberphone.github.io/doc/security/browser-json-canonicalization.html">https://cyberphone.github.io/doc/security/browser-json-canonicalization.html</a><br>
      <br>
      On 2018-03-16 06:46, Anders Rundgren wrote:<br>
    </div>
    <blockquote type="cite"
      cite="mid:65d998cb-8aed-205b-98bd-ac1297310a50@gmail.com">
      <meta http-equiv="content-type" content="text/html; charset=utf-8">
      No, this I-D has not yet been submitted to the IETF but it is
      available anyway :-)<br>
      <blockquote><font size="-1" color="#999999">Abstract</font><br>
        <br>
        <font size="-1" color="#999999">   Cryptographic operations like
          hashing and signing depend on that the</font><br>
        <font size="-1" color="#999999">   target data does not change
          during serialization, transport, or</font><br>
        <font size="-1" color="#999999">   parsing.  By applying the
          rules defined by JCS (JSON Canonicalization</font><br>
        <font size="-1" color="#999999">   Scheme), data provided in the
          JSON [RFC8259] format can be exchanged</font><br>
        <font size="-1" color="#999999">   "as is", while still being
          subject to secure cryptographic</font><br>
        <font size="-1" color="#999999">   operations.  JCS achieves
          this by exploiting the strict operation of</font><br>
        <font size="-1" color="#999999">   the JSON serialization method
          defined in ECMAScript beginning with</font><br>
        <font size="-1" color="#999999">   version 6 [ES6].</font><br>
        <br>
        <font size="-1" color="#999999">   The intended audiences of
          this document are JSON tool vendors, as</font><br>
        <font size="-1" color="#999999">   well as designers of JSON
          based cryptographic solutions.</font><br>
      </blockquote>
      Current draft:<br>
      <a class="moz-txt-link-freetext"
href="https://cyberphone.github.io/doc/security/draft-rundgren-json-canonicalization-scheme.html"
        moz-do-not-send="true">https://cyberphone.github.io/doc/security/draft-rundgren-json-canonicalization-scheme.html</a><br>
      <br>
      Workspace:<br>
      <a class="moz-txt-link-freetext"
        href="https://github.com/cyberphone/json-canonicalization"
        moz-do-not-send="true">https://github.com/cyberphone/json-canonicalization</a><br>
      <br>
      I would be VERY happy to get some feedback on this!<br>
      If you have any interest in co-authoring, I'm open to suggestions.<br>
      <br>
      Thanx,<br>
      Anders<br>
      <br>
      <font color="#009900"><tt>// ES6 based JSON canonicalizer</tt></font><tt><br>
      </tt><tt>'use strict';</tt><tt><br>
      </tt><tt>var canonicalize = function(object) {</tt><tt><br>
      </tt><tt><br>
      </tt><tt>    var buffer = '';</tt><tt><br>
      </tt><tt>    serialize(object);</tt><tt><br>
      </tt><tt>    return buffer;</tt><tt><br>
      </tt><tt><br>
      </tt><tt>    function serialize(object) {</tt><tt><br>
      </tt><tt>        if (object !== null &amp;&amp; typeof object ===
        'object') {</tt><tt><br>
      </tt><tt>            if (Array.isArray(object)) {</tt><tt><br>
      </tt><tt>                buffer += '[';</tt><tt><br>
      </tt><tt>                let next = false;</tt><tt><br>
      </tt><tt>                <font color="#009900">// Array -
          Maintain element order</font></tt><tt><br>
      </tt><tt>                object.forEach((element) =&gt; {</tt><tt><br>
      </tt><tt>                    if (next) {</tt><tt><br>
      </tt><tt>                        buffer += ',';</tt><tt><br>
      </tt><tt>                    }</tt><tt><br>
      </tt><tt>                    next = true;</tt><tt><br>
      </tt><tt>                    <font color="#009900">// Recursive
          call</font></tt><tt><br>
      </tt><tt>                    serialize(element);</tt><tt><br>
      </tt><tt>                });</tt><tt><br>
      </tt><tt>                buffer += ']';</tt><tt><br>
      </tt><tt>            } else {</tt><tt><br>
      </tt><tt>                buffer += '{';</tt><tt><br>
      </tt><tt>                let next = false;</tt><tt><br>
      </tt><tt>                <font color="#009900">// Object - Sort
          properties before serializing</font></tt><tt><br>
      </tt><tt>               
        Object.keys(object).sort().forEach((property) =&gt; {</tt><tt><br>
      </tt><tt>                    if (next) {</tt><tt><br>
      </tt><tt>                        buffer += ',';</tt><tt><br>
      </tt><tt>                    }</tt><tt><br>
      </tt><tt>                    next = true;</tt><tt><br>
      </tt><tt>                    <font color="#009900">// Properties
          are just strings - Use ES6</font></tt><tt><br>
      </tt><tt>                    buffer += JSON.stringify(property);</tt><tt><br>
      </tt><tt>                    buffer += ':';</tt><tt><br>
      </tt><tt>                    <font color="#009900">// Recursive
          call</font></tt><tt><br>
      </tt><tt>                    serialize(object[property]);</tt><tt><br>
      </tt><tt>                });</tt><tt><br>
      </tt><tt>                buffer += '}';</tt><tt><br>
      </tt><tt>            }</tt><tt><br>
      </tt><tt>        } else {</tt><tt><br>
      </tt><tt>            <font color="#009900">// Primitive data type
          - Use ES6</font></tt><tt><br>
      </tt><tt>            buffer += JSON.stringify(object);</tt><tt><br>
      </tt><tt>        }</tt><tt><br>
      </tt><tt>    }</tt><tt><br>
      </tt><tt>};</tt><br>
    </blockquote>
    <br>
  </body>
</html>

--------------35E866BC5555AB8A22FE0170--


From nobody Thu Mar 22 13:19:19 2018
Return-Path: <anders.rundgren.net@gmail.com>
X-Original-To: json@ietfa.amsl.com
Delivered-To: json@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 7CD91126FB3 for <json@ietfa.amsl.com>; Thu, 22 Mar 2018 13:19:18 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2
X-Spam-Level: 
X-Spam-Status: No, score=-2 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, 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 B9m3oTt-3nDC for <json@ietfa.amsl.com>; Thu, 22 Mar 2018 13:19:17 -0700 (PDT)
Received: from mail-wr0-x235.google.com (mail-wr0-x235.google.com [IPv6:2a00:1450:400c:c0c::235]) (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 D7EDD12426E for <json@ietf.org>; Thu, 22 Mar 2018 13:19:16 -0700 (PDT)
Received: by mail-wr0-x235.google.com with SMTP id z8so9979683wrh.7 for <json@ietf.org>; Thu, 22 Mar 2018 13:19:16 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;  h=to:from:subject:message-id:date:user-agent:mime-version :content-transfer-encoding:content-language; bh=ptGLq74bEGdSElHwO3uIyR/AzJSilsPOZheZzhYmv4M=; b=BquEiTZFm5feWtUpiQgQz0s4XlI1kMXbkA8OjlaTyjyaN9xwuxbR1Zq1wdXuBmjUUQ 4yDoKorZb8oPS4WrDaS0qi9PF1VBTQAzranifVA5QOmZNgYaAkd/psOIS/1tcpH026/v kHcAThtjP6B+ogRRNX0acoUX6sFlYgqg3RvjSLIHQUPK/8ywEKU+raukhWGK2dYP7LUf IecasgSRSWSkAMVBFXHW1skJSkZ0EgVM31BFXSA9mrst3VkJ8qmckkJ9zUynz4/l9QaI 3HfwMcJyxyy6Mx9RTSPJ9/prZRqeFcJJ5y+ilb6MQAxOECH2DMc6flzOpmnFj/T4Nbjh SuNQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:from:subject:message-id:date:user-agent :mime-version:content-transfer-encoding:content-language; bh=ptGLq74bEGdSElHwO3uIyR/AzJSilsPOZheZzhYmv4M=; b=rywd0zJHrSUbektuqE5egxDV7QyLjl/n8d0dIdZ8aa9YujOJl7oATndQcPyjrSdgxH wGNETpvSS1X1kpHJN+3L/s+V77rWG4ZYSgbSgB0YktVYxPfTEzaTDqn1WIx5cua1I5g3 TW34l9ZNgl34RNldWW2jS/wNVSr4kllFo2iid0qFVIJH1OQdkOwRS+lMmvScrDtAAWNG youmxqObk3oByp4/rM7UE05URt5yly6WjTWByGKJGNpq0M45hLU+QoDDFBGSsGFdA1bT QIa9rk0nS7TkPewbpnXcuIvKy4V31EAneGGkHMzgHZHgznHy18i/bD/hFkqY1nXaOXcM DgOQ==
X-Gm-Message-State: AElRT7GzgaQZp7rnnUk23mRThsSMnhDkpv8i4bnZBJWTUtGEIts+//Ta DYlWxMSohkj7Y1zeyHouzMQzIw==
X-Google-Smtp-Source: AG47ELvd3irNN6h1mo4KjErPr285TaqUc679apXqDjdemylsbNH58QI9tQXMvK9ZLB9g23m4s0kg8w==
X-Received: by 10.223.179.9 with SMTP id j9mr17123855wrd.276.1521749955131; Thu, 22 Mar 2018 13:19:15 -0700 (PDT)
Received: from [192.168.1.79] (25.131.146.77.rev.sfr.net. [77.146.131.25]) by smtp.googlemail.com with ESMTPSA id 142sm8337659wmq.47.2018.03.22.13.19.13 for <json@ietf.org> (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 22 Mar 2018 13:19:14 -0700 (PDT)
To: "json@ietf.org" <json@ietf.org>
From: Anders Rundgren <anders.rundgren.net@gmail.com>
Message-ID: <40564b5a-c8a9-c6a1-9e70-ba7b6d0d80e8@gmail.com>
Date: Thu, 22 Mar 2018 21:19:13 +0100
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Content-Language: en-US
Archived-At: <https://mailarchive.ietf.org/arch/msg/json/ODgv4mJEqKqhg30t5sVxzzOYHWY>
Subject: [Json] Update on JSON Canonicalization
X-BeenThere: json@ietf.org
X-Mailman-Version: 2.1.22
Precedence: list
List-Id: "JavaScript Object Notation \(JSON\) WG mailing list" <json.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/json>, <mailto:json-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/json/>
List-Post: <mailto:json@ietf.org>
List-Help: <mailto:json-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/json>, <mailto:json-request@ietf.org?subject=subscribe>
X-List-Received-Date: Thu, 22 Mar 2018 20:19:18 -0000

https://github.com/cyberphone/json-canonicalization#json-canonicalization

The new version of the spec contains more on the rationale behind the design decisions.

Lots of information was gathered in an ECMAScript forum.

It is essentially only one thing which causes friction and that is how to deal with the fact that JSON spec does not impose hard limits on the "Number" type.

Anders

