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

Adam Barth <ietf@adambarth.com> Mon, 10 January 2011 00:18 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 207F23A6853 for <hybi@core3.amsl.com>; Sun, 9 Jan 2011 16:18:47 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -3.916
X-Spam-Level:
X-Spam-Status: No, score=-3.916 tagged_above=-999 required=5 tests=[AWL=-0.939, 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 fCScN-Pp36L8 for <hybi@core3.amsl.com>; Sun, 9 Jan 2011 16:18:46 -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 34E5D3A6833 for <hybi@ietf.org>; Sun, 9 Jan 2011 16:18:46 -0800 (PST)
Received: by gyd12 with SMTP id 12so8071823gyd.31 for <hybi@ietf.org>; Sun, 09 Jan 2011 16:20:58 -0800 (PST)
Received: by 10.90.120.12 with SMTP id s12mr5565720agc.21.1294618857975; Sun, 09 Jan 2011 16:20:57 -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 e44sm6829430yha.34.2011.01.09.16.20.56 (version=SSLv3 cipher=RC4-MD5); Sun, 09 Jan 2011 16:20:57 -0800 (PST)
Received: by iwn40 with SMTP id 40so19970843iwn.31 for <hybi@ietf.org>; Sun, 09 Jan 2011 16:20:55 -0800 (PST)
Received: by 10.231.156.1 with SMTP id u1mr11822930ibw.52.1294618855778; Sun, 09 Jan 2011 16:20:55 -0800 (PST)
MIME-Version: 1.0
Received: by 10.231.11.140 with HTTP; Sun, 9 Jan 2011 16:20:25 -0800 (PST)
In-Reply-To: <20110110000908.GD5743@1wt.eu>
References: <20110110000908.GD5743@1wt.eu>
From: Adam Barth <ietf@adambarth.com>
Date: Sun, 09 Jan 2011 16:20:25 -0800
Message-ID: <AANLkTik5BDTB-T8wbyXJF8iseSryfHgOATLDNc6HUz7k@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>
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 00:18:47 -0000

On Sun, Jan 9, 2011 at 4:09 PM, Willy Tarreau <w@1wt.eu> wrote:
> I have reused Maciej's code for AES-128-CTR to make it emit a constant
> stream and look there for a supposedly processable request (which is
> valid since Apache processes it and transcodes it if it finds it at
> the beginning of the stream).
>
> willy@pcw:~/c$ time ./aes-128-ctr-get
> Found the 'GET\n' pattern on the wire after 1608425803 bytes
>
> real    0m20.761s
> user    0m20.761s
> sys     0m0.000s
>
> It requires the client to send more data, but here we're only
> at 1.6 GB, roughly just 1000 times more than with the basic XOR
> method.
>
> However, it's limited to 640 Mbps only. It means that using this
> as a mandatory masking method will not even allow me to use a
> memcache at gigabit speeds on my local network :-(

Then you shouldn't use WebSockets to talk to memcache on your local
network.  WebSockets is not the solution to every problem.  For the
important uses cases, 640 Mbps with today's CPUs is vastly more than
enough.

> Once again, I'm not saying that I'd believe that any intermediary
> would seek a request that far. Neither do I believe it would seek
> one after one megabyte nor after any non CRLF byte BTW.
>
> But we're proposing this method because other ones are not deemed
> sure enough. However, it does not either cover the issues which
> caused the other methods to be proposed.
>
> So now either we should conclude that using AES to prevent a request
> from popping up is acceptable because the risks are low, so it must
> be possible to disable it for some use cases, or we conclude that
> it's not usable and the only masking solution consists in never
> putting a CR/LF on the wire.

The masking is not optional.  If your use case doesn't work with
masking, please a different protocol.

Kind regards,
Adam