[OAUTH-WG] [OT] Validation of JWE spec Appendix 1

Sergey Beryozkin <sberyozkin@gmail.com> Fri, 02 May 2014 16:32 UTC

Return-Path: <sberyozkin@gmail.com>
X-Original-To: oauth@ietfa.amsl.com
Delivered-To: oauth@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 3691F1A6F6B for <oauth@ietfa.amsl.com>; Fri, 2 May 2014 09:32:21 -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, SPF_PASS=-0.001] autolearn=ham
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 WXAp_emLVInA for <oauth@ietfa.amsl.com>; Fri, 2 May 2014 09:32:19 -0700 (PDT)
Received: from mail-ee0-x229.google.com (mail-ee0-x229.google.com [IPv6:2a00:1450:4013:c00::229]) by ietfa.amsl.com (Postfix) with ESMTP id 454F61A08DA for <oauth@ietf.org>; Fri, 2 May 2014 09:32:19 -0700 (PDT)
Received: by mail-ee0-f41.google.com with SMTP id d49so579316eek.0 for <oauth@ietf.org>; Fri, 02 May 2014 09:32:16 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject :content-type:content-transfer-encoding; bh=sOd/B+iWKMWZG46EhSES/iynmXGoOUoou+/bTV/H6X8=; b=i/xr8gV/Ql04lLAVbCnUhb1fPgeUla7vNn5CdSeWAI98eLFEGJboPvj9Tv3eEnlEd2 TjUhBWxCOTFJgqnaKPQvKkUz1GmdQHKNMU4jm4Al1HNhCbBwVQnLZgdyJw2T+6ExSHeB EH8Lj/X94UzIt20l8sXU0BXrBt9QtFeBLXUlfFCQp6j35r1sB/LD5ESp5uxdd9A9pNve fOHGwVd9WuCDWn4GSdWbgWG03PTwbvy86VPe5q5yvg7kdTPfL3adacQECKI+ALopPJZG +dV5s6PM9B1LyuD17WDN71B7JvuRmtBDqodndpJWtSG8gfedx//ayKCaXLiz2gW3BB33 86pg==
X-Received: by 10.14.210.65 with SMTP id t41mr15975415eeo.35.1399048336433; Fri, 02 May 2014 09:32:16 -0700 (PDT)
Received: from [10.36.226.2] ([80.169.137.63]) by mx.google.com with ESMTPSA id y51sm5790935eeu.0.2014.05.02.09.32.15 for <oauth@ietf.org> (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 02 May 2014 09:32:15 -0700 (PDT)
Message-ID: <5363C88E.5070209@gmail.com>
Date: Fri, 02 May 2014 17:32:14 +0100
From: Sergey Beryozkin <sberyozkin@gmail.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0
MIME-Version: 1.0
To: "<oauth@ietf.org>" <oauth@ietf.org>
Content-Type: text/plain; charset="ISO-8859-1"; format="flowed"
Content-Transfer-Encoding: 7bit
Archived-At: http://mailarchive.ietf.org/arch/msg/oauth/Nr1wTFp6iPKDgaxhsKfqFm20JxM
Subject: [OAUTH-WG] [OT] Validation of JWE spec Appendix 1
X-BeenThere: oauth@ietf.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: OAUTH WG <oauth.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/oauth>, <mailto:oauth-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/oauth/>
List-Post: <mailto:oauth@ietf.org>
List-Help: <mailto:oauth-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/oauth>, <mailto:oauth-request@ietf.org?subject=subscribe>
X-List-Received-Date: Fri, 02 May 2014 16:32:21 -0000

Hi,

I'm starting experimenting with JWE, and the 1st thing I wanted to do 
was to quickly test the example at [1].

Sorry if it is something that is very obvious and off-topic, but I can't 
seem to validate the encryption of the content encryption key: I keep 
getting a different output every time the test code runs.

The code is the one that I wrote by 'scraping' the code from all over 
the Web but also I see Jose.4.j [3] produces a different output too.
Is it due to the given key properties specified in [1] or it is actually 
indeed expected that production at [2] is reproducible ?

Cheers, Sergey

[1] 
http://tools.ietf.org/html/draft-ietf-jose-json-web-encryption-26#appendix-A.1
[2] 
http://tools.ietf.org/html/draft-ietf-jose-json-web-encryption-26#appendix-A.1.3
[3] https://bitbucket.org/b_c/jose4j/wiki/Home