Re: [TLS] Consensus call on Implicit IV for AEAD

Yoav Nir <ynir.ietf@gmail.com> Mon, 06 April 2015 13:17 UTC

Return-Path: <ynir.ietf@gmail.com>
X-Original-To: tls@ietfa.amsl.com
Delivered-To: tls@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 755971A8880 for <tls@ietfa.amsl.com>; Mon, 6 Apr 2015 06:17:33 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2
X-Spam-Level:
X-Spam-Status: No, score=-2 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, SPF_PASS=-0.001] autolearn=ham
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id PoO042scV1-n for <tls@ietfa.amsl.com>; Mon, 6 Apr 2015 06:17:32 -0700 (PDT)
Received: from mail-wg0-x234.google.com (mail-wg0-x234.google.com [IPv6:2a00:1450:400c:c00::234]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id C58841A87EF for <tls@ietf.org>; Mon, 6 Apr 2015 06:17:31 -0700 (PDT)
Received: by wgbdm7 with SMTP id dm7so26660300wgb.1 for <tls@ietf.org>; Mon, 06 Apr 2015 06:17:30 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=pxVBw4Dj+pw0ggLjFIiNrEA67fFiZN+SyCaZCc5pumY=; b=NDwC+kDlax4ame6a9K7l+l4qxJduZU7Qpl7WE2VdZ7K+FJO1eMG8hXNggpbDxPb6R1 M0ohRW3e3xToXQibooZ+U6frF3bjgMh7mXb6Pyzu7BsUvG+drEjeLjdBcKakyXVjZbRh fIopnRRcWx1+aHPXj9816IiNUyn5Ky5Z8SgcdP116PyD5roSqoc+mnSYDQJ5vsKS+Z21 g6CPifOCA1eY4HlnNnW9uqey9LBd8+E5yT1Rg+vMruaP2SMOkyB69aFZTeW5p/xqYKQu WqrF1IA0q8kiom9WViOAqSKXtgoKwvIZ9AkBcBHEbIiAUBvEAc3qMC6WbeTRLtY0kzEo lzWw==
X-Received: by 10.194.121.10 with SMTP id lg10mr31348312wjb.71.1428326250611; Mon, 06 Apr 2015 06:17:30 -0700 (PDT)
Received: from [172.24.250.177] (dyn32-131.checkpoint.com. [194.29.32.131]) by mx.google.com with ESMTPSA id bx3sm6444428wjc.21.2015.04.06.06.17.28 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 06 Apr 2015 06:17:29 -0700 (PDT)
Content-Type: text/plain; charset=windows-1252
Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2070.6\))
From: Yoav Nir <ynir.ietf@gmail.com>
In-Reply-To: <CA+cU71=UE0FTe6L2zuVqejVGYL10yE8pWvdixTWbtHVsDvzhvg@mail.gmail.com>
Date: Mon, 6 Apr 2015 16:17:26 +0300
Content-Transfer-Encoding: quoted-printable
Message-Id: <075E6F22-6CA2-4030-A0FF-1E2C5B5CFA5F@gmail.com>
References: <CAOgPGoCW-znnh5VFobCFjZafxEOcwsaHZ_eByTwpCpmqfgX=6Q@mail.gmail.com> <CA+cU71=AZjGgisDyOyAeRsgh6PZDbiH2YTv3grn-d-4quunmNg@mail.gmail.com> <16A0B45C-5631-4270-9888-7E9FB90481DC@gmail.com> <CA+cU71=UE0FTe6L2zuVqejVGYL10yE8pWvdixTWbtHVsDvzhvg@mail.gmail.com>
To: Tom Ritter <tom@ritter.vg>
X-Mailer: Apple Mail (2.2070.6)
Archived-At: <http://mailarchive.ietf.org/arch/msg/tls/ayBo-Is5QznfTvxLXKRCKX0fyV4>
Cc: "tls@ietf.org" <tls@ietf.org>
Subject: Re: [TLS] Consensus call on Implicit IV for AEAD
X-BeenThere: tls@ietf.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: "This is the mailing list for the Transport Layer Security working group of the IETF." <tls.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/tls>, <mailto:tls-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/tls/>
List-Post: <mailto:tls@ietf.org>
List-Help: <mailto:tls-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/tls>, <mailto:tls-request@ietf.org?subject=subscribe>
X-List-Received-Date: Mon, 06 Apr 2015 13:17:33 -0000

> On Apr 6, 2015, at 2:25 PM, Tom Ritter <tom@ritter.vg> wrote:
> 
> On 6 April 2015 at 03:41, Yoav Nir <ynir.ietf@gmail.com> wrote:
>> So either IVs (actually nonces) are compressible only for such ciphersuites that support using the record counter as nonce/IV (add a flag to the registry), or else we use some method such as AGL's for generating unpredictable IVs from predictable nonces.
> 
> 
> Thanks Yoav, ekr,
> 
> I obviously haven't followed all the arguments here (and from skimming
> Brian's reply) - but I prefer defining a construction that makes the
> IV given to the AEAD unpredictable and random. Doing that from a
> predictable nonce seems okay.

That depends. AES-GCM accepts a 64-bit IV. ChaCha20-Poly1305 is the same. If you feed it random bitstrings, you’re very likely to repeat a bitstring after a few billion records, and you have a good chance of repeating the IV even after many fewer records. So it’s much better to use a counter or 64-bit LFSR, even though they’re predictable. With a function that receives a 128-bit IV such as AES-CBC, randomization is fine. 

A good way for both is to encrypt a counter with a secret key (whether shared with the other side and then you can omit the IV or not and then you need to include it), but using a 64-bit cipher (DES?) to generate random-looking, non-repeating nonces for AES-GCM seems like a very weird idea.

So I’d rather have a nonce, and require whoever defines an AEAD based on CBC mode to either add an IV to the payload or define a way to calculate a non-predictable IV from that nonce.

Yoav