Re: [TLS] ChaCha and IVs

Nikos Mavrogiannopoulos <nmav@redhat.com> Wed, 05 March 2014 07:19 UTC

Return-Path: <nmav@redhat.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 E1F041A0304 for <tls@ietfa.amsl.com>; Tue, 4 Mar 2014 23:19:33 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -7.449
X-Spam-Level:
X-Spam-Status: No, score=-7.449 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_HI=-5, RP_MATCHES_RCVD=-0.547, SPF_HELO_PASS=-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 sp5T1qcqmGPx for <tls@ietfa.amsl.com>; Tue, 4 Mar 2014 23:19:32 -0800 (PST)
Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by ietfa.amsl.com (Postfix) with ESMTP id 13C601A033C for <tls@ietf.org>; Tue, 4 Mar 2014 23:19:30 -0800 (PST)
Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s257JMr5001543 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 5 Mar 2014 02:19:23 -0500
Received: from [10.34.2.127] (dhcp-2-127.brq.redhat.com [10.34.2.127]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s257JKVv012311 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Wed, 5 Mar 2014 02:19:22 -0500
Message-ID: <1394003960.20861.27.camel@dhcp-2-127.brq.redhat.com>
From: Nikos Mavrogiannopoulos <nmav@redhat.com>
To: Stephen Kent <kent@bbn.com>
Date: Wed, 05 Mar 2014 08:19:20 +0100
In-Reply-To: <53161825.7060409@bbn.com>
References: <53160513.20703@bbn.com> <1393955839.20861.20.camel@dhcp-2-127.brq.redhat.com> <53161825.7060409@bbn.com>
Content-Type: text/plain; charset="UTF-8"
Mime-Version: 1.0
Content-Transfer-Encoding: 7bit
X-Scanned-By: MIMEDefang 2.68 on 10.5.11.25
Archived-At: http://mailarchive.ietf.org/arch/msg/tls/vE0-pbuKTaDMc7s0w8N0KZmFSFo
Cc: tls@ietf.org
Subject: Re: [TLS] ChaCha and IVs
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: Wed, 05 Mar 2014 07:19:34 -0000

On Tue, 2014-03-04 at 13:15 -0500, Stephen Kent wrote:

> >>  From a security assurance perspective, an IV based on a
> >> protocol-supplied value expands the scope of what has to
> >> be analyzed (to ensure uniqueness)
> > In TLS the record sequence numbers are unique by definition, thus any
> > analysis is simplified.
> Security evaluation for a crypto alg does not include a protocol like ESP or
> (D)TLS; if focuses only on the alg implementation. Thus a TLS "guarantee"
> of uniqueness is not relevant. Anyone who has had a product evaluated will
> tell you that the goal is always to minimize the amount of code that is 
> subject
> to review. If one were to use a TLS (or ESP) sequence number for an IV, 
> all of
> the protocol code would be part of the evaluation, and that would make the
> evaluation prolonged and very costly.

I believe this was answered elsewhere in this thread.

> > * It reduces the exchanged data (by 12 or 8 bytes - depending on the
> > explicit nonce size). This is particularly important in DTLS where the
> > typical record size is less than 1400 bytes.
> The typical packet size in the ESP context is at least that small.
> > * It ensures that the nonce is unique even until 2^64-1 records are
> > exchanged (which is the termination limit for TLS sessions).
> this guarantee is only as good as the assurance of the TLS code than manages
> the sequence numbers, which is not likely to be secure as the alg 
> implementation.

One cannot design protocols with the assumption that they will be
violated. However, even if you are implying that implementations will
continue to exchange data even after 2^64-1 records are exchanged, then
the counter nonce approach will fail precisely at the 2^64 exchanged
record. The random nonce approach will fail much earlier.

regards,
Nikos