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

Adam Barth <ietf@adambarth.com> Mon, 10 January 2011 07:14 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 A0FAC3A6945 for <hybi@core3.amsl.com>; Sun, 9 Jan 2011 23:14:22 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -3.879
X-Spam-Level:
X-Spam-Status: No, score=-3.879 tagged_above=-999 required=5 tests=[AWL=-0.902, 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 LKmIPfkbYq7g for <hybi@core3.amsl.com>; Sun, 9 Jan 2011 23:14:21 -0800 (PST)
Received: from mail-gy0-f172.google.com (mail-gy0-f172.google.com [209.85.160.172]) by core3.amsl.com (Postfix) with ESMTP id 9078E3A693A for <hybi@ietf.org>; Sun, 9 Jan 2011 23:14:21 -0800 (PST)
Received: by gyd12 with SMTP id 12so8156968gyd.31 for <hybi@ietf.org>; Sun, 09 Jan 2011 23:16:34 -0800 (PST)
Received: by 10.100.112.4 with SMTP id k4mr16830202anc.66.1294643794330; Sun, 09 Jan 2011 23:16:34 -0800 (PST)
Received: from mail-iy0-f172.google.com (mail-iy0-f172.google.com [209.85.210.172]) by mx.google.com with ESMTPS id z12sm5855476anp.19.2011.01.09.23.16.32 (version=SSLv3 cipher=RC4-MD5); Sun, 09 Jan 2011 23:16:33 -0800 (PST)
Received: by iyi42 with SMTP id 42so19104694iyi.31 for <hybi@ietf.org>; Sun, 09 Jan 2011 23:16:32 -0800 (PST)
Received: by 10.231.192.7 with SMTP id do7mr6209741ibb.102.1294643792127; Sun, 09 Jan 2011 23:16:32 -0800 (PST)
MIME-Version: 1.0
Received: by 10.231.11.140 with HTTP; Sun, 9 Jan 2011 23:16:01 -0800 (PST)
In-Reply-To: <20110110070820.GN5743@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>
From: Adam Barth <ietf@adambarth.com>
Date: Sun, 09 Jan 2011 23:16:01 -0800
Message-ID: <AANLkTinrhE9SWnPigQxTgPEM-LkugxxRjP++GnppPDnh@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:14:22 -0000

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.  How many bytes do you
think you'd have to examine before finding the string "Willy Tarreau"
?

Kind regards,
Adam