Re: [TLS] Last Call: <draft-kanno-tls-camellia-00.txt> (Additionx

Marsh Ray <marsh@extendedsubset.com> Tue, 08 March 2011 20:54 UTC

Return-Path: <marsh@extendedsubset.com>
X-Original-To: tls@core3.amsl.com
Delivered-To: tls@core3.amsl.com
Received: from localhost (localhost [127.0.0.1]) by core3.amsl.com (Postfix) with ESMTP id 492443A63D3 for <tls@core3.amsl.com>; Tue, 8 Mar 2011 12:54:57 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.299
X-Spam-Level:
X-Spam-Status: No, score=-2.299 tagged_above=-999 required=5 tests=[AWL=-0.300, BAYES_00=-2.599, J_CHICKENPOX_36=0.6]
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 kJNKI8H16L98 for <tls@core3.amsl.com>; Tue, 8 Mar 2011 12:54:56 -0800 (PST)
Received: from mho-01-ewr.mailhop.org (mho-01-ewr.mailhop.org [204.13.248.71]) by core3.amsl.com (Postfix) with ESMTP id 7CB253A635F for <tls@ietf.org>; Tue, 8 Mar 2011 12:54:56 -0800 (PST)
Received: from xs01.extendedsubset.com ([69.164.193.58]) by mho-01-ewr.mailhop.org with esmtpa (Exim 4.72) (envelope-from <marsh@extendedsubset.com>) id 1Px3du-000IkD-1n; Tue, 08 Mar 2011 20:36:30 +0000
Received: from [192.168.1.15] (localhost [127.0.0.1]) by xs01.extendedsubset.com (Postfix) with ESMTP id DE63E62E4; Tue, 8 Mar 2011 20:56:04 +0000 (UTC)
X-Mail-Handler: MailHop Outbound by DynDNS
X-Originating-IP: 69.164.193.58
X-Report-Abuse-To: abuse@dyndns.com (see http://www.dyndns.com/services/mailhop/outbound_abuse.html for abuse reporting information)
X-MHO-User: U2FsdGVkX18uvY2p/kG+3aQmq9BdbLdiQ/QsV2wM4ms=
Message-ID: <4D7697E2.2060506@extendedsubset.com>
Date: Tue, 08 Mar 2011 14:56:02 -0600
From: Marsh Ray <marsh@extendedsubset.com>
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.14) Gecko/20110223 Thunderbird/3.1.8
MIME-Version: 1.0
To: "Blumenthal, Uri - 0668 - MITLL" <uri@ll.mit.edu>
References: <20110308193520.9B3423A6814@core3.amsl.com>
In-Reply-To: <20110308193520.9B3423A6814@core3.amsl.com>
Content-Type: text/plain; charset="ISO-8859-1"; format="flowed"
Content-Transfer-Encoding: 7bit
Cc: "'tls@ietf.org'" <tls@ietf.org>
Subject: Re: [TLS] Last Call: <draft-kanno-tls-camellia-00.txt> (Additionx
X-BeenThere: tls@ietf.org
X-Mailman-Version: 2.1.9
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/listinfo/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: Tue, 08 Mar 2011 20:54:57 -0000

On 03/08/2011 01:36 PM, Blumenthal, Uri - 0668 - MITLL wrote:
> In general - since pseudorandom-ness of the output was NOT a design
> principle or criteria of hash functions (until SHA3) - truncating
> hash output is problematic from crypto point because you cannot
> reasonably assume that all the output bits have the "entropy" spread
> over them equally.

But if you can find a systematic way to generate patterns in the output, 
then you have a publication-worthy attack on the function. E.g. if you 
have a way to cause any specific bit position of the output of SHA-256 
to be a '0' 75% of the time, then you have reduced it to a 255.2-bit 
function. (Hilarity ensued when this turned out to be case with RC4).

The TLS doesn't use a raw hash function though. It doesn't even use a 
raw HMAC. It uses recursive application of an HMAC to generate an 
arbitrary amount of output, essentially making a stream cipher. This is 
probably the most conservative aspect of TLS's design, making me a big fan.

For TLS 1.2 it's:

     verify_data
        PRF(master_secret, finished_label, Hash(handshake_messages))
           [0..verify_data_length-1];

     PRF(secret, label, seed) = P_<hash>(secret, label + seed)

     P_hash(secret, seed) = HMAC_hash(secret, A(1) + seed) + ...

     A(0) = seed
     A(i) = HMAC_hash(secret, A(i-1))

Each HMAC represents two hash function invocations, each SHA-256 
represents 64 rounds.

So before they are used to generate the first block of output, the 
handshake_messages are hashed something like 5 times mixing in 
additional pseudorandom key material all but the first time.

Don't get me wrong, I think 96 bits is too short and is probably a 
holdover from the days when we (wisely) didn't trust our ability to 
design hash functions. But insufficient diffusion does not look like a 
problem.

- Marsh