Re: [hybi] It's time to ship

Bjoern Hoehrmann <derhoermi@gmx.net> Wed, 12 January 2011 23:45 UTC

Return-Path: <derhoermi@gmx.net>
X-Original-To: hybi@core3.amsl.com
Delivered-To: hybi@core3.amsl.com
Received: from localhost (localhost [127.0.0.1]) by core3.amsl.com (Postfix) with ESMTP id 6CBE23A67D4 for <hybi@core3.amsl.com>; Wed, 12 Jan 2011 15:45:21 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -3.233
X-Spam-Level:
X-Spam-Status: No, score=-3.233 tagged_above=-999 required=5 tests=[AWL=-1.234, BAYES_00=-2.599, J_CHICKENPOX_31=0.6]
Received: from mail.ietf.org ([64.170.98.32]) by localhost (core3.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 2sClpng3ke55 for <hybi@core3.amsl.com>; Wed, 12 Jan 2011 15:45:20 -0800 (PST)
Received: from mail.gmx.net (mailout-de.gmx.net [213.165.64.23]) by core3.amsl.com (Postfix) with SMTP id CB87C3A6822 for <hybi@ietf.org>; Wed, 12 Jan 2011 15:45:19 -0800 (PST)
Received: (qmail invoked by alias); 12 Jan 2011 23:47:39 -0000
Received: from dslb-094-223-191-191.pools.arcor-ip.net (EHLO hive) [94.223.191.191] by mail.gmx.net (mp007) with SMTP; 13 Jan 2011 00:47:39 +0100
X-Authenticated: #723575
X-Provags-ID: V01U2FsdGVkX1+i4ntFdoqiwuqj0gvJlTZPYNsrmraysF7j87BsNU OqUQ2R8bF2ErbW
From: Bjoern Hoehrmann <derhoermi@gmx.net>
To: Adam Barth <ietf@adambarth.com>
Date: Thu, 13 Jan 2011 00:47:34 +0100
Message-ID: <l2bsi6ll7c25ogv53kc1tj1gu88c2jjhg8@hive.bjoern.hoehrmann.de>
References: <AANLkTim2VGfH2FiJ4iH85wYiuXNKQ1Arh1C1Kg4M58Fs@mail.gmail.com> <sk1si6dvl4s1lmroa5qdt0ra2erd5066ri@hive.bjoern.hoehrmann.de> <AANLkTinBZeMoTLUjPUxjixB7sfhJ4yeHi3REk=oz76FC@mail.gmail.com>
In-Reply-To: <AANLkTinBZeMoTLUjPUxjixB7sfhJ4yeHi3REk=oz76FC@mail.gmail.com>
X-Mailer: Forte Agent 3.3/32.846
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Y-GMX-Trusted: 0
Cc: Hybi <hybi@ietf.org>
Subject: Re: [hybi] It's time to ship
X-BeenThere: hybi@ietf.org
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: Server-Initiated HTTP <hybi.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/listinfo/hybi>, <mailto:hybi-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/hybi>
List-Post: <mailto:hybi@ietf.org>
List-Help: <mailto:hybi-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/hybi>, <mailto:hybi-request@ietf.org?subject=subscribe>
X-List-Received-Date: Wed, 12 Jan 2011 23:45:21 -0000

* Adam Barth wrote:
>Here's an example RFC that uses AES-128-CTR
>
>http://www.ietf.org/rfc/rfc4344.txt
>
>I believe it's technically defined by combining
>http://csrc.nist.gov/publications/fips/fips197/fips-197.pdf and
>http://csrc.nist.gov/publications/nistpubs/800-38a/sp800-38a.pdf, the
>later of which contains test vectors.  (Careful readers will notice
>that my example is wrong.)

I agree your example is wrong. So the concern was a chosen ciphertext
attack. For simplicity let's say Websocket frames are just 16 byte long
blocks and the attacker has full control over them. From the same 16
byte input the browser would generate at most 2^32 ciphertexts, so an
attacker can compute the masked frame for one of the nonces and send it
over and over again, eventually his ciphertext will appear.

Example: The handshake establishes the per-connection key K, I want to
put "0123456789ABCDEF" on the wire, I compute "0123456789ABCDEF" `xor`
AES(K, 0x12345678000000...) and ask the browser to send that again and
again; eventually it will pick 0x12345678 as per-frame nonce, it will
xor with the same AES value, and I get my attack payload on the wire
(if the block counter is not reset, I'd just take that into account by
recomputing the masked frame still assuming the same per-frame nonce.)

So is there an error in this analysis, or is the argument simply that
using your AES scheme seems to make attacks a little bit harder?
-- 
Björn Höhrmann · mailto:bjoern@hoehrmann.de · http://bjoern.hoehrmann.de
Am Badedeich 7 · Telefon: +49(0)160/4415681 · http://www.bjoernsworld.de
25899 Dagebüll · PGP Pub. KeyID: 0xA4357E78 · http://www.websitedev.de/