Re: [jose] Would it be possible to add DEFLATE compression for the JWT payload into the JWT/JWS/JWE specs?

John Bradley <ve7jtb@ve7jtb.com> Thu, 09 February 2012 21:03 UTC

Return-Path: <ve7jtb@ve7jtb.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 6559521E805B for <jose@ietfa.amsl.com>; Thu, 9 Feb 2012 13:03:17 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -3.535
X-Spam-Level:
X-Spam-Status: No, score=-3.535 tagged_above=-999 required=5 tests=[AWL=0.064, BAYES_00=-2.599, 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 i3ax8cgb-WMF for <jose@ietfa.amsl.com>; Thu, 9 Feb 2012 13:03:15 -0800 (PST)
Received: from mail-yx0-f172.google.com (mail-yx0-f172.google.com [209.85.213.172]) by ietfa.amsl.com (Postfix) with ESMTP id 789E121E8061 for <jose@ietf.org>; Thu, 9 Feb 2012 13:03:14 -0800 (PST)
Received: by yenm3 with SMTP id m3so1341897yen.31 for <jose@ietf.org>; Thu, 09 Feb 2012 13:03:13 -0800 (PST)
Received: by 10.101.170.2 with SMTP id x2mr1554211ano.45.1328821393495; Thu, 09 Feb 2012 13:03:13 -0800 (PST)
Received: from [192.168.1.213] ([190.22.41.248]) by mx.google.com with ESMTPS id h29sm8591640ann.16.2012.02.09.13.03.09 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 09 Feb 2012 13:03:11 -0800 (PST)
Mime-Version: 1.0 (Apple Message framework v1257)
Content-Type: multipart/signed; boundary="Apple-Mail=_02091F8E-3980-454F-81B6-4B184DEEF0B8"; protocol="application/pkcs7-signature"; micalg="sha1"
From: John Bradley <ve7jtb@ve7jtb.com>
In-Reply-To: <397B382EC2E6D9479F9A5D6D050FB707033ABB@WO-SFOEXCH-02.wideorbit.com>
Date: Thu, 09 Feb 2012 18:03:06 -0300
Message-Id: <25CABF36-27D0-4DDB-8644-58EBFEDFC4EC@ve7jtb.com>
References: <397B382EC2E6D9479F9A5D6D050FB707033ABB@WO-SFOEXCH-02.wideorbit.com>
To: Steffen Yount <syount@wideorbit.com>
X-Mailer: Apple Mail (2.1257)
X-Gm-Message-State: ALoCoQm+kMqM7LIU8HZPSfe7vUjG4m9JmyX8JYB8tEc1BY7PkmsDvB0YgCzdLx90zOs04uwyPdyn
X-Mailman-Approved-At: Thu, 09 Feb 2012 13:20:11 -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 Y. Goland" <yarong@microsoft.com>, "Michael B. Jones" <mbj@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: Thu, 09 Feb 2012 21:03:17 -0000

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
>