Re: [IPsec] Two questions about draft-ietf-ipsecme-chacha20-poly1305-00

Yaron Sheffer <yaronf.ietf@gmail.com> Fri, 03 April 2015 03:22 UTC

Return-Path: <yaronf.ietf@gmail.com>
X-Original-To: ipsec@ietfa.amsl.com
Delivered-To: ipsec@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 276421A0107 for <ipsec@ietfa.amsl.com>; Thu, 2 Apr 2015 20:22:41 -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 F8KU__B4d9lV for <ipsec@ietfa.amsl.com>; Thu, 2 Apr 2015 20:22:39 -0700 (PDT)
Received: from mail-wi0-x235.google.com (mail-wi0-x235.google.com [IPv6:2a00:1450:400c:c05::235]) (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 956441A00A7 for <ipsec@ietf.org>; Thu, 2 Apr 2015 20:22:34 -0700 (PDT)
Received: by wibgn9 with SMTP id gn9so126708961wib.1 for <ipsec@ietf.org>; Thu, 02 Apr 2015 20:22:33 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=PD5BKK+rnXS441B7YJKDlGJkDQV6q2dE9GywbFyVd48=; b=wbO/ew2qxUabMPJe1FmsON8x8ByHsVQViiokDPsgvx2w79PZ0AukHLPN0Xj3I+g+Do JVfehcPydoDbCPba0JHiqBawLX+/3xcmwviNswPLzJx2UNE/F1UM61Ah6sO12d9BcODo fd3t94FO2vnKVGRp3GAr+VBMpcdYcjj49urbafi0U+h80un2/h/L+OhGMZEl318/IU+t k5CT7MbQNAUk1wRrPFMiUnc5pu7DwFkEGjmLbJ/QcVPlS3zjOWWtHa+H6oMetGCHS0FY 7GIVgWxgALi1U+SxWZ4ofXdDAkUvcKEsO2L233R6PAy2lIdXu1us3J9/wMf6gbl/ZvSM 6Znw==
X-Received: by 10.180.101.225 with SMTP id fj1mr1593065wib.56.1428031353420; Thu, 02 Apr 2015 20:22:33 -0700 (PDT)
Received: from [10.0.0.4] (bzq-109-64-164-3.red.bezeqint.net. [109.64.164.3]) by mx.google.com with ESMTPSA id ad7sm914312wid.21.2015.04.02.20.22.30 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 02 Apr 2015 20:22:31 -0700 (PDT)
Message-ID: <551DE781.6070507@gmail.com>
Date: Fri, 03 Apr 2015 02:06:09 +0100
From: Yaron Sheffer <yaronf.ietf@gmail.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0
MIME-Version: 1.0
To: Yoav Nir <ynir.ietf@gmail.com>, "Scott Fluhrer (sfluhrer)" <sfluhrer@cisco.com>
References: <20150330133237.21486.80504.idtracker@ietfa.amsl.com> <6E938E70-324A-424E-9D20-7067BD278165@gmail.com> <A113ACFD9DF8B04F96395BDEACB340420D056856@xmb-rcd-x04.cisco.com> <C9FF479F-AF95-4C60-AA43-7A3C0B0DA5D3@gmail.com>
In-Reply-To: <C9FF479F-AF95-4C60-AA43-7A3C0B0DA5D3@gmail.com>
Content-Type: text/plain; charset="windows-1252"; format="flowed"
Content-Transfer-Encoding: 8bit
Archived-At: <http://mailarchive.ietf.org/arch/msg/ipsec/4cNLAgBs2WnMSn9A2mom6MKlLtY>
Cc: "ipsec@ietf.org" <ipsec@ietf.org>
Subject: Re: [IPsec] Two questions about draft-ietf-ipsecme-chacha20-poly1305-00
X-BeenThere: ipsec@ietf.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: Discussion of IPsec protocols <ipsec.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/ipsec>, <mailto:ipsec-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/ipsec/>
List-Post: <mailto:ipsec@ietf.org>
List-Help: <mailto:ipsec-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/ipsec>, <mailto:ipsec-request@ietf.org?subject=subscribe>
X-List-Received-Date: Fri, 03 Apr 2015 03:22:41 -0000

>> Here's the reason that we do use the 32-bit salt value for GCM - to prevent batching attacks.
>>
>> Consider the case that an attacker is able to collect packets from a billion (2^30) sessions; each such session contains a packet with the same IV (say, IV=0), and contains a packet with the same known plaintext (or, at least, plaintext that satisfies the same known linear equations).  Then, what an attacker can do is check a key to see if any of the IV=0 packets used that key, in constant time.  The reduces the effort for an attacker to find the n bit key for some session from 2^n to 2^{n-30}.  What the salt does is multiply the effort involved in this specific attack by a factor of 2^32 (because the attacker needs to guess the key and the salt); that way, the attacker needs to collect 4 billion sessions before this attack starts to have any advantage over a simpler attack that just attacks a single packet (which the salt doesn’t protect against).
>>
>> Now, of course, chacha20 has 256 bit keys; hence even if we decided not to apply the same protection, someone with a collection of a billion sessions might be able to use this to reduce the effort to 2^226.
>>
>> I'll let you decide whether this is a compelling argument or not…
>
> I think that for 256-bit keys it’s not that compelling. So the question is which is simpler: to do as AES-GCM does, or to set the salt to zero?
>

It seems to me like a "truth in advertising" kind of thing: if we use a 
256-bit cipher then people using it expect 256-bit strength, rather than 
2^226. So I would be happy if we can get the salt without having to pay 
in packet length.

Thanks,
	Yaron