Re: [jose] Would it be possible to add DEFLATE compression for the JWT payload into the JWT/JWS/JWE specs?
Mike Jones <Michael.Jones@microsoft.com> Fri, 10 February 2012 22:45 UTC
Return-Path: <Michael.Jones@microsoft.com>
X-Original-To: jose@ietfa.amsl.com
Delivered-To: jose@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 3436B21F8699 for <jose@ietfa.amsl.com>; Fri, 10 Feb 2012 14:45:23 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -3.769
X-Spam-Level:
X-Spam-Status: No, score=-3.769 tagged_above=-999 required=5 tests=[AWL=-0.171, BAYES_00=-2.599, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-1]
Received: from mail.ietf.org ([12.22.58.30]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Tn2nlzALaYba for <jose@ietfa.amsl.com>; Fri, 10 Feb 2012 14:45:19 -0800 (PST)
Received: from DB3EHSOBE005.bigfish.com (db3ehsobe006.messaging.microsoft.com [213.199.154.144]) by ietfa.amsl.com (Postfix) with ESMTP id BB86121F84EF for <jose@ietf.org>; Fri, 10 Feb 2012 14:45:17 -0800 (PST)
Received: from mail23-db3-R.bigfish.com (10.3.81.254) by DB3EHSOBE005.bigfish.com (10.3.84.25) with Microsoft SMTP Server id 14.1.225.23; Fri, 10 Feb 2012 22:45:16 +0000
Received: from mail23-db3 (localhost [127.0.0.1]) by mail23-db3-R.bigfish.com (Postfix) with ESMTP id 4CD0E600B1; Fri, 10 Feb 2012 22:45:16 +0000 (UTC)
X-SpamScore: -56
X-BigFish: VS-56(zz9371I936eKc85fh148cM1444M542M1dbaL1432N98dK111aLzz1202hzz1033IL8275bh8275dhz2fh2a8h668h839h)
X-Forefront-Antispam-Report: CIP:131.107.125.8; KIP:(null); UIP:(null); IPV:NLI; H:TK5EX14HUBC104.redmond.corp.microsoft.com; RD:none; EFVD:NLI
Received-SPF: pass (mail23-db3: domain of microsoft.com designates 131.107.125.8 as permitted sender) client-ip=131.107.125.8; envelope-from=Michael.Jones@microsoft.com; helo=TK5EX14HUBC104.redmond.corp.microsoft.com ; icrosoft.com ;
Received: from mail23-db3 (localhost.localdomain [127.0.0.1]) by mail23-db3 (MessageSwitch) id 1328913914748210_4646; Fri, 10 Feb 2012 22:45:14 +0000 (UTC)
Received: from DB3EHSMHS015.bigfish.com (unknown [10.3.81.237]) by mail23-db3.bigfish.com (Postfix) with ESMTP id B0774C0045; Fri, 10 Feb 2012 22:45:14 +0000 (UTC)
Received: from TK5EX14HUBC104.redmond.corp.microsoft.com (131.107.125.8) by DB3EHSMHS015.bigfish.com (10.3.87.115) with Microsoft SMTP Server (TLS) id 14.1.225.23; Fri, 10 Feb 2012 22:45:14 +0000
Received: from TK5EX14MBXC284.redmond.corp.microsoft.com ([169.254.1.12]) by TK5EX14HUBC104.redmond.corp.microsoft.com ([157.54.80.25]) with mapi id 14.02.0247.005; Fri, 10 Feb 2012 14:45:06 -0800
From: Mike Jones <Michael.Jones@microsoft.com>
To: John Bradley <ve7jtb@ve7jtb.com>, Steffen Yount <syount@wideorbit.com>
Thread-Topic: Would it be possible to add DEFLATE compression for the JWT payload into the JWT/JWS/JWE specs?
Thread-Index: AQHM525CysEwrlAIgUatL5gULAQISJY1770AgAFCKQD//4oZkA==
Date: Fri, 10 Feb 2012 22:45:05 +0000
Message-ID: <4E1F6AAD24975D4BA5B16804296739436639FEB9@TK5EX14MBXC284.redmond.corp.microsoft.com>
References: <397B382EC2E6D9479F9A5D6D050FB707033ABB@WO-SFOEXCH-02.wideorbit.com> <25CABF36-27D0-4DDB-8644-58EBFEDFC4EC@ve7jtb.com> <397B382EC2E6D9479F9A5D6D050FB707033BFF@WO-SFOEXCH-02.wideorbit.com> <2ED0B3DE-CB1C-4C2E-8A66-0FD6B359368D@ve7jtb.com>
In-Reply-To: <2ED0B3DE-CB1C-4C2E-8A66-0FD6B359368D@ve7jtb.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-originating-ip: [157.54.51.73]
Content-Type: multipart/alternative; boundary="_000_4E1F6AAD24975D4BA5B16804296739436639FEB9TK5EX14MBXC284r_"
MIME-Version: 1.0
X-OriginatorOrg: microsoft.com
X-Mailman-Approved-At: Fri, 10 Feb 2012 15:00:32 -0800
Cc: Eric Rescorla <ekr@rtfm.com>, Dirk Balfanz <balfanz@google.com>, "jose@ietf.org" <jose@ietf.org>, John Panzer <jpanzer@google.com>, Brian Campbell <brian.d.campbell@gmail.com>, Yaron Goland <yarong@microsoft.com>, Joe Hildebrand <jhildebr@cisco.com>, Paul Tarjan <pt@fb.com>, Nat Sakimura <n-sakimura@nri.co.jp>, Chuck Mortimore <cmortimore@salesforce.com>
Subject: Re: [jose] Would it be possible to add DEFLATE compression for the JWT payload into the JWT/JWS/JWE specs?
X-BeenThere: jose@ietf.org
X-Mailman-Version: 2.1.12
Precedence: list
List-Id: Javascript Object Signing and Encryption <jose.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/jose>, <mailto:jose-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/jose>
List-Post: <mailto:jose@ietf.org>
List-Help: <mailto:jose-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/jose>, <mailto:jose-request@ietf.org?subject=subscribe>
X-List-Received-Date: Fri, 10 Feb 2012 22:45:23 -0000
Compression isn't specified in JWS thus far because every mandatory-to-implement feature makes implementations that much harder to do and simplicity is a core goal. That being said, if the WG has a clear and compelling need for this that outweighs the complexity downside, it could of course be added. Discussion?
-- Mike
From: John Bradley [mailto:ve7jtb@ve7jtb.com]
Sent: Friday, February 10, 2012 1:46 PM
To: Steffen Yount
Cc: Mike Jones; Brian Campbell; Chuck Mortimore; Dirk Balfanz; Yaron Goland; John Panzer; Nat Sakimura; Paul Tarjan; Eric Rescorla; Joe Hildebrand; jose@ietf.org
Subject: Re: Would it be possible to add DEFLATE compression for the JWT payload into the JWT/JWS/JWE specs?
The reason I had for originally proposing LZ77 with 32 bitCRC was to provide an integrity check against tampering when using AES-CBC encryption.
If we make encryption with integrity the default I don't have any issue with dropping the internal CRC.
I can see your point about compressing signed tokens in the header being easier if it is directly supported by the spec.
I would not be opposed to that change if there is consensus in the WG to make it.
John B.
On 2012-02-09, at 11:32 PM, Steffen Yount wrote:
Hi John,
Thanks for pointing that out, I've located that reserved header parameter "zip" in the JWE spec. (http://tools.ietf.org/html/draft-jones-json-web-encryption-02#section-4.1 )
Yes, I think this "zip" header should be added for JWS signing as well.
My use case:
I'm looking at using JWS as a Bearer token for HTTP Authorization and encoding multiple "scope" grants into the token. The clients will be treating the token as opaque data and it is not clear that they will know if a server supports HTTP compression when their requests are made. So, I'm expecting that the client's HTTP requests will be submitted uncompressed.
Since I can't rely on HTTP level compression, I would like to compress the payload before it is used in the request. Compression should reduce my token size considerably, since the multiple scope grants will be repeating name-space parts.
Would it be possible to specify a "zip"="DEFLATE" option too for both JWS and JWE?
* This option should rely only on RFC1951 compression without a ZLIB header or checksum field. (a.k.a: DEFLATE with the "nowrap" option)
* The difference is 18 bytes of GZIP wrapper data overhead.
* When dealing with small payloads containing only few repeating parts, these 18 bytes are likely to leave the compressed output longer than the input.
Thanks again,
-Steffen
-----Original Message-----
From: John Bradley [mailto:ve7jtb@ve7jtb.com]<mailto:[mailto:ve7jtb@ve7jtb.com]>
Sent: Thursday, February 09, 2012 1:03 PM
To: Steffen Yount
Cc: Michael B. Jones; Brian Campbell; Chuck Mortimore; Dirk Balfanz; Yaron Y. Goland; John Panzer; Nat Sakimura; Paul Tarjan; Eric Rescorla; Joe Hildebrand; jose@ietf.org<mailto:jose@ietf.org>
Subject: Re: Would it be possible to add DEFLATE compression for the JWT payload into the JWT/JWS/JWE specs?
We do currently have the option of RFC1952 compression of the plain text before encryption.
Personally I think compression before encryption should be the default. Others prefer it as a option.
We didn't add it to signing as there are existing ways to compress content in http.
If you think it needs to be added to signing then let us know.
Regards
John Bradley
On 2012-02-09, at 4:21 PM, Steffen Yount wrote:
> Hi,
>
> I hope this email reaches someone who can respond. I've included authors from the various JWT specs.
>
> I was thinking through JSON Web Token (JWT) Bearer Token Profiles for OAuth 2.0 draft spec (http://tools.ietf.org/html/draft-jones-oauth-jwt-bearer-03 ) while researching options for a REST based SSO implementation.
>
> One of the stated motivators for the JWT/JWS/JWE formats is compactness. And, I want compactness in my HTTP headers.
>
> It has been pointed out that HTTP load times can be dramatically effected by relatively small amounts of data in the HTTP headers. (see:http://mike.bailey.net.au/2010/07/tcp-and-the-lower-bound-of-web-performance/ )
>
> Would it be possible to add DEFLATE compression for the JWT payload into the JWT/JWS/JWE specs?
>
> My suggestion here has 2 parts, each can be considered separately:
> 1. Add the option to apply DEFLATE compression (omitting the ZLIB header and checksum fields) on the payload before encryption/signing. (It is important to apply the compression before the encryption, since an encrypted payload will contain a bunch of pseudo-random noise that isn't easily compressed.) This feature should be accompanied by a JWT header option to toggle compression on/off. (Maybe something like "dfl" : true/false)
> 2. Make the DEFLATE compressed payload the default behavior only requiring the JWT header option for disabling compression.
>
> I have tested it and found that:
> With small payloads containing only keys and values having minimal substring overlap it is possible for the DEFLATE compression to produce equivalent or larger output.
> But I have also found that:
> Payloads including keys or values with any repeated name-space parts easily achieve payload size reduction.
>
> I believe that in common use cases compression will achieve payload size reduction, since repeated name-space parts are likely to occur:
> 1. A number of the "reserved claim names" type keys expect content of type "StringOrURI" which are likely to have repeated name-space parts.
> 2. The specs support the "public claim names" type key extensions which will also most likely share common base URI name-space parts.
>
> Another benefit is that DEFLATE compression on the payload should encourage the use of unique name-spaced identifiers, since DEFLATE compression removes the payload size penalty otherwise incurred when repeating a common name-space part over and over again.
>
> Is this doable?
>
> Desired?
>
> What do you think of these ideas?
>
> Thanks for your consideration,
> -Steffen
>
- Re: [jose] Would it be possible to add DEFLATE co… John Bradley
- Re: [jose] Would it be possible to add DEFLATE co… John Bradley
- Re: [jose] Would it be possible to add DEFLATE co… Mike Jones
- Re: [jose] Would it be possible to add DEFLATE co… Mike Jones