Re: [hybi] AES-128-CTR not much safer, but not fast either

Adam Barth <ietf@adambarth.com> Mon, 10 January 2011 07:54 UTC

Return-Path: <ietf@adambarth.com>
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 7C5B13A6A69 for <hybi@core3.amsl.com>; Sun, 9 Jan 2011 23:54:11 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -3.873
X-Spam-Level:
X-Spam-Status: No, score=-3.873 tagged_above=-999 required=5 tests=[AWL=-0.896, BAYES_00=-2.599, FM_FORGED_GMAIL=0.622, RCVD_IN_DNSWL_LOW=-1]
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 FW2kFBUr78Uq for <hybi@core3.amsl.com>; Sun, 9 Jan 2011 23:54:10 -0800 (PST)
Received: from mail-yx0-f172.google.com (mail-yx0-f172.google.com [209.85.213.172]) by core3.amsl.com (Postfix) with ESMTP id 936933A6A64 for <hybi@ietf.org>; Sun, 9 Jan 2011 23:54:10 -0800 (PST)
Received: by yxt33 with SMTP id 33so8389216yxt.31 for <hybi@ietf.org>; Sun, 09 Jan 2011 23:56:23 -0800 (PST)
Received: by 10.151.106.7 with SMTP id i7mr27308201ybm.421.1294646182972; Sun, 09 Jan 2011 23:56:22 -0800 (PST)
Received: from mail-iw0-f172.google.com (mail-iw0-f172.google.com [209.85.214.172]) by mx.google.com with ESMTPS id v6sm1954945ybk.20.2011.01.09.23.56.21 (version=SSLv3 cipher=RC4-MD5); Sun, 09 Jan 2011 23:56:22 -0800 (PST)
Received: by iwn40 with SMTP id 40so20197535iwn.31 for <hybi@ietf.org>; Sun, 09 Jan 2011 23:56:20 -0800 (PST)
Received: by 10.231.192.7 with SMTP id do7mr6239483ibb.102.1294646180674; Sun, 09 Jan 2011 23:56:20 -0800 (PST)
MIME-Version: 1.0
Received: by 10.231.11.140 with HTTP; Sun, 9 Jan 2011 23:55:50 -0800 (PST)
In-Reply-To: <20110110075208.GO5743@1wt.eu>
References: <20110110000908.GD5743@1wt.eu> <8B0A9FCBB9832F43971E38010638454F03F5258EEC@SISPE7MB1.commscope.com> <20110110063646.GJ5743@1wt.eu> <AANLkTintz6hWL1ez0-FnPaZmi1jfBhtZ+NMd60dM=Y=D@mail.gmail.com> <20110110065822.GM5743@1wt.eu> <AANLkTinVq9d=fSph8SZiDFrSFCwRQvyJFAiOwBZjnGjA@mail.gmail.com> <20110110070820.GN5743@1wt.eu> <AANLkTinrhE9SWnPigQxTgPEM-LkugxxRjP++GnppPDnh@mail.gmail.com> <20110110075208.GO5743@1wt.eu>
From: Adam Barth <ietf@adambarth.com>
Date: Sun, 09 Jan 2011 23:55:50 -0800
Message-ID: <AANLkTi=JJquFaa7ReCUVz=5P4ERuGBq=aDrtBy2oDngu@mail.gmail.com>
To: Willy Tarreau <w@1wt.eu>
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: quoted-printable
Cc: Hybi <hybi@ietf.org>, "Thomson, Martin" <Martin.Thomson@andrew.com>
Subject: Re: [hybi] AES-128-CTR not much safer, but not fast either
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: Mon, 10 Jan 2011 07:54:11 -0000

On Sun, Jan 9, 2011 at 11:52 PM, Willy Tarreau <w@1wt.eu> wrote:
> On Sun, Jan 09, 2011 at 11:16:01PM -0800, Adam Barth wrote:
>> On Sun, Jan 9, 2011 at 11:08 PM, Willy Tarreau <w@1wt.eu> wrote:
>> > On Sun, Jan 09, 2011 at 11:02:47PM -0800, Adam Barth wrote:
>> >> On Sun, Jan 9, 2011 at 10:58 PM, Willy Tarreau <w@1wt.eu> wrote:
>> >> > On Sun, Jan 09, 2011 at 10:44:19PM -0800, Adam Barth wrote:
>> >> >> Or we could just use AES-128-CTR like everyone else in the known
>> >> >> universe and not worry about whether we've shaved exactly the right
>> >> >> number of hairs off our home-brew pseudo crypto.
>> >> >
>> >> > Adam, I just explained that AES-128-CTR as you proposed it does not
>> >> > address the points that were raised which made it appear here.
>> >> >
>> >> > In fact the real problem we really want to solve is make the CR/LF
>> >> > bytes disappear from the stream. Those bytes are still present with
>> >> > AES-128-CTR.
>> >>
>> >> Fortunately, we don't need to make the CR/LF bytes disappear from the
>> >> stream.  What we need to do is prevent the attacker from choosing a
>> >> string that can be used to attack an intermediary.  Using AES-128-CTR
>> >> makes it so the attacker is forced to choose a pseudo-random sequence
>> >> of bytes.  I claim that it is infeasible to attack an intermediary in
>> >> this way using a pseudo-random sequence of bytes.
>> >
>> > For short a string lengths accepted by Apache (4 bytes), it *is* feasible
>> > by making the client send an important amount of bytes as I have shown.
>> > If we agree that we don't need to protect against that very unlikely issue,
>> > then the simpler XOR masking is enough because the initial pseudo-random
>> > makes it equally hard for the attacker to guess what the stream will look
>> > like.
>>
>> I stand by my claim that it is infeasible to attack an intermediary in
>> this way using a pseudo-random sequence of bytes.
>>
>> Your "attack" of finding the string "GET\n" after 1608425803 bytes
>> (yes, that's 1.6 gigabytes) is meaningless.
>
> Precisely, and it is as much meaningless as finding it after the same
> amount of bytes using a simple XOR method with a 32-bit key. That was
> the point I wanted to make, because at one point it was speculated
> in the 32-bit vs HMAC that it was a concern.
>
> So now we can move on to simpler algorithms and stop cripling the
> protocol.

Or we could just use AES-128-CTR like everyone else in the known
universe and not worry about whether we've shaved exactly the right
number of hairs off our home-brew pseudo crypto.

Adam