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

Willy Tarreau <w@1wt.eu> Mon, 10 January 2011 07:06 UTC

Return-Path: <w@1wt.eu>
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 F16C23A693A for <hybi@core3.amsl.com>; Sun, 9 Jan 2011 23:06:12 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.077
X-Spam-Level:
X-Spam-Status: No, score=-2.077 tagged_above=-999 required=5 tests=[AWL=-0.034, BAYES_00=-2.599, HELO_IS_SMALL6=0.556]
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 ju7YXWjVNx8X for <hybi@core3.amsl.com>; Sun, 9 Jan 2011 23:06:11 -0800 (PST)
Received: from 1wt.eu (1wt.eu [62.212.114.60]) by core3.amsl.com (Postfix) with ESMTP id E83EA3A6935 for <hybi@ietf.org>; Sun, 9 Jan 2011 23:06:10 -0800 (PST)
Received: (from willy@localhost) by mail.home.local (8.14.4/8.14.4/Submit) id p0A78KVq011781; Mon, 10 Jan 2011 08:08:20 +0100
Date: Mon, 10 Jan 2011 08:08:20 +0100
From: Willy Tarreau <w@1wt.eu>
To: Adam Barth <ietf@adambarth.com>
Message-ID: <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>
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Disposition: inline
In-Reply-To: <AANLkTinVq9d=fSph8SZiDFrSFCwRQvyJFAiOwBZjnGjA@mail.gmail.com>
User-Agent: Mutt/1.4.2.3i
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:06:13 -0000

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.

Regards,
Willy