Re: [jose] SPI proposal

Anthony Nadalin <> Sat, 09 February 2013 00:43 UTC

Return-Path: <>
Received: from localhost (localhost []) by (Postfix) with ESMTP id DB6D621F8C32 for <>; Fri, 8 Feb 2013 16:43:08 -0800 (PST)
X-Virus-Scanned: amavisd-new at
X-Spam-Flag: NO
X-Spam-Score: 0.534
X-Spam-Status: No, score=0.534 tagged_above=-999 required=5 tests=[AWL=-0.000, BAYES_00=-2.599, HTML_MESSAGE=0.001, UNRESOLVED_TEMPLATE=3.132]
Received: from ([]) by localhost ( []) (amavisd-new, port 10024) with ESMTP id UMRLLwSczdJe for <>; Fri, 8 Feb 2013 16:43:08 -0800 (PST)
Received: from ( []) by (Postfix) with ESMTP id AD6AA21F8C2C for <>; Fri, 8 Feb 2013 16:43:07 -0800 (PST)
Received: from ( by ( with Microsoft SMTP Server (TLS) id 15.0.620.12; Sat, 9 Feb 2013 00:42:58 +0000
Received: from ( by ( with Microsoft SMTP Server (TLS) id 15.0.620.12 via Frontend Transport; Sat, 9 Feb 2013 00:42:58 +0000
Received: from ( by ( with Microsoft SMTP Server (TLS) id 14.2.318.3; Sat, 9 Feb 2013 00:42:56 +0000
Received: from ( by ( with Microsoft SMTP Server id; Sat, 9 Feb 2013 00:42:55 +0000
Received: from mail85-co9 (localhost []) by (Postfix) with ESMTP id 8CC8840310 for <>; Sat, 9 Feb 2013 00:42:55 +0000 (UTC)
X-Forefront-Antispam-Report-Untrusted: CIP:; KIP:(null); UIP:(null); (null);; R:internal; EFV:INT
X-SpamScore: -17
X-BigFish: PS-17(zz98dI9371Ic85fhzz1f42h1ee6h1de0h1202h1e76h1d1ah1d2ah1082kzz1033IL17326ah8275bh8275dh18c673hz31h2a8h668h839hd24hf0ah1288h12a5h12bdh137ah1441h1504h1537h153bh162dh1631h1758h18e1h1946h19b5h19ceh9a9j1155h)
Received-SPF: softfail (mail85-co9: transitioning domain of does not designate as permitted sender) client-ip=;; ; ;
X-Forefront-Antispam-Report-Untrusted: SFV:SKI; SFS:; DIR:OUT; SFP:; SCL:-1; SRVR:BY2PR03MB044;; LANG:en;
Received: from mail85-co9 (localhost.localdomain []) by mail85-co9 (MessageSwitch) id 1360370572775233_24862; Sat, 9 Feb 2013 00:42:52 +0000 (UTC)
Received: from (unknown []) by (Postfix) with ESMTP id BAD1C3E0045; Sat, 9 Feb 2013 00:42:52 +0000 (UTC)
Received: from ( by ( with Microsoft SMTP Server (TLS) id; Sat, 9 Feb 2013 00:42:52 +0000
Received: from ( by ( with Microsoft SMTP Server (TLS) id; Sat, 9 Feb 2013 00:42:50 +0000
Received: from ( by ( with Microsoft SMTP Server (TLS) id 15.0.620.10; Sat, 9 Feb 2013 00:42:48 +0000
Received: from ([]) by ([]) with mapi id 15.00.0620.005; Sat, 9 Feb 2013 00:42:47 +0000
From: Anthony Nadalin <>
To: Brian Campbell <>, Richard Barnes <>
Thread-Topic: [jose] SPI proposal
Thread-Index: AQHOBLcZ2BTnadeNlEmbRXkPp/zKN5hueUmAgAI5p2A=
Date: Sat, 9 Feb 2013 00:42:47 +0000
Message-ID: <>
References: <> <>
In-Reply-To: <>
Accept-Language: en-US
Content-Language: en-US
x-originating-ip: []
Content-Type: multipart/alternative; boundary="_000_7cbaa4d142cf45a2bdc5bc29b9c0d579BY2PR03MB041namprd03pro_"
MIME-Version: 1.0
X-Forefront-Antispam-Report: CIP:; CTRY:US; IPV:CAL; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(24454001)(199002)(189002)(377454001)(15202345001)(74502001)(5343635001)(54356001)(47446002)(74662001)(31966008)(46102001)(56776001)(65816001)(56816002)(16236675001)(20776003)(80022001)(53806001)(16676001)(66066001)(63696002)(44976002)(54316002)(47976001)(59766001)(50986001)(6806001)(4396001)(49866001)(5343655001)(51856001)(77982001)(47736001)(76482001)(33646001)(79102001)(512954001)(42262001)(24736002); DIR:OUT; SFP:; SCL:1; SRVR:BY2FFO11HUB019;; RD:InfoDomainNonexistent; A:1; MX:1; LANG:en;
X-Forefront-PRVS: 07521929C1
Cc: "" <>
Subject: Re: [jose] SPI proposal
X-Mailman-Version: 2.1.12
Precedence: list
List-Id: Javascript Object Signing and Encryption <>
List-Unsubscribe: <>, <>
List-Archive: <>
List-Post: <>
List-Help: <>
List-Subscribe: <>, <>
X-List-Received-Date: Sat, 09 Feb 2013 00:43:09 -0000

I also think that this would be very  cumbersome to support and needs much more thought

From: [] On Behalf Of Brian Campbell
Sent: Thursday, February 7, 2013 6:43 AM
To: Richard Barnes
Subject: Re: [jose] SPI proposal

Admittedly I'm not really up on this spi issue or the motivation behind it but a couple questions came to mind when I saw this. How does the receiver protect against unbounded growth of the cache? And index collision? And for distributed environments, it seems supporting this could be very cumbersome.

On Wed, Feb 6, 2013 at 3:11 PM, Richard Barnes <<>> wrote:
To move us toward closing Issue #9 [9], here is some proposed text for an SPI [1] field.  To recall, SPI stands for "security parameters index", borrowing a term from IPsec.  The idea is that in cases where the same crypto parameters are being used repeatedly, this would save the parties from having to re-send the same parameters.

The below text is designed for the JWE spec, but could be adapted for JWS (just keep header, ignore part about key/iv).  Similar text is probably needed for the encryption/decryption/signing/verification sections.

Feedback welcome,

Section 4.1.X. "spi" Header Parameter

The "spi" (Security Parameters Index) header parameter contains an opaque byte string that labels a set of security parameters.  This index is designed to enable the use of smaller headers in cases where entities will be re-using the same security parameters for several messages.

Entities supporting the use of the "spi" parameter MUST maintain a table of cached security parameters.  When an entity receives an object whose header contains both "spi" and "alg" values, then it MUST cache the following values from the JWE, indexed by the "spi" value:
-- Contents of the JWE header
-- Encrypted Key
-- Initialization Vector

If an object containing an "spi" parameter but no "alg" parameter, then it MUST NOT contain an Encrypted Key or Initialization Vector.  That is, it will have the form "header.ciphertext.integrity_value".  When a recipient receives such an object, it uses the "spi" value to retrieve cached header, key, and initialization vector and reconstructs a full JWE.  This full JWE can then be further processed according to the normal JWE processing rules.  If the recipient has no cached parameters for the "spi" value, the process MUST fail.


jose mailing list<>