Re: [Cfrg] new authenticated encryption draft

David McGrew <mcgrew@cisco.com> Wed, 06 September 2006 21:17 UTC

Received: from [127.0.0.1] (helo=stiedprmman1.va.neustar.com) by megatron.ietf.org with esmtp (Exim 4.43) id 1GL4mP-0007dp-JZ; Wed, 06 Sep 2006 17:17:54 -0400
Received: from [10.91.34.44] (helo=ietf-mx.ietf.org) by megatron.ietf.org with esmtp (Exim 4.43) id 1GL4mO-0007dk-7x for cfrg@ietf.org; Wed, 06 Sep 2006 17:17:52 -0400
Received: from sj-iport-6.cisco.com ([171.71.176.117]) by ietf-mx.ietf.org with esmtp (Exim 4.43) id 1GL4mM-0005eL-Ku for cfrg@ietf.org; Wed, 06 Sep 2006 17:17:52 -0400
Received: from sj-dkim-2.cisco.com ([171.71.179.186]) by sj-iport-6.cisco.com with ESMTP; 06 Sep 2006 14:17:50 -0700
Received: from sj-core-1.cisco.com (sj-core-1.cisco.com [171.71.177.237]) by sj-dkim-2.cisco.com (8.12.11.20060308/8.12.11) with ESMTP id k86LHo8F028595; Wed, 6 Sep 2006 14:17:50 -0700
Received: from xbh-sjc-231.amer.cisco.com (xbh-sjc-231.cisco.com [128.107.191.100]) by sj-core-1.cisco.com (8.12.10/8.12.6) with ESMTP id k86LHoQX001155; Wed, 6 Sep 2006 14:17:50 -0700 (PDT)
Received: from xfe-sjc-211.amer.cisco.com ([171.70.151.174]) by xbh-sjc-231.amer.cisco.com with Microsoft SMTPSVC(6.0.3790.211); Wed, 6 Sep 2006 14:17:49 -0700
Received: from [192.168.1.100] ([10.32.254.211]) by xfe-sjc-211.amer.cisco.com with Microsoft SMTPSVC(6.0.3790.1830); Wed, 6 Sep 2006 14:17:49 -0700
In-Reply-To: <f207274d0609011652m3bb76587xdd6cd9e1d3140e63@mail.gmail.com>
References: <74A5A0C3-8E6E-47B4-A67B-C51ED97B2897@mindspring.com> <da7b3ce30608201147u12c0c2f6s61694713e59cfa4a@mail.gmail.com> <p06230910c10e98a55c4c@10.30.1.9> <f207274d0608221905t2797ca6ew2a769dd5d9e3d410@mail.gmail.com> <3D640F53-58F3-4AE4-AEFC-145BBD9BC9A0@cisco.com> <f207274d0609011652m3bb76587xdd6cd9e1d3140e63@mail.gmail.com>
Mime-Version: 1.0 (Apple Message framework v752.2)
Content-Type: text/plain; charset="US-ASCII"; delsp="yes"; format="flowed"
Message-Id: <7BA4156B-14B4-4BB1-BEAD-2237F5B3834D@cisco.com>
Content-Transfer-Encoding: 7bit
From: David McGrew <mcgrew@cisco.com>
Subject: Re: [Cfrg] new authenticated encryption draft
Date: Wed, 06 Sep 2006 14:17:47 -0700
To: John Wilkinson <wilkjohn@gmail.com>
X-Mailer: Apple Mail (2.752.2)
X-OriginalArrivalTime: 06 Sep 2006 21:17:49.0423 (UTC) FILETIME=[E7E4C7F0:01C6D1F9]
DKIM-Signature: a=rsa-sha1; q=dns; l=6966; t=1157577470; x=1158441470; c=relaxed/simple; s=sjdkim2002; h=Content-Type:From:Subject:Content-Transfer-Encoding:MIME-Version; d=cisco.com; i=mcgrew@cisco.com; z=From:David=20McGrew=20<mcgrew@cisco.com> |Subject:Re=3A=20[Cfrg]=20new=20authenticated=20encryption=20draft; X=v=3Dcisco.com=3B=20h=3DbEwS0oJgdOC6R0v1cvsFzhF5aNU=3D; b=ek+dBV/OFcvwQwAl4jHkMWafABLc8vb5pZCCb71JMVqJz8byDYSPuYYBI0J2CPklCOtvwsr1 C0wkfHHz0XMhnSYjolJEd49ttW8rVcLmh+NplAd0DzZV9Ea4Pm6wLZ0I;
Authentication-Results: sj-dkim-2.cisco.com; header.From=mcgrew@cisco.com; dkim=pass ( sig from cisco.com verified; );
X-Spam-Score: 0.0 (/)
X-Scan-Signature: 21bf7a2f1643ae0bf20c1e010766eb78
Cc: cfrg@ietf.org
X-BeenThere: cfrg@ietf.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: Crypto Forum Research Group <cfrg.ietf.org>
List-Unsubscribe: <https://www1.ietf.org/mailman/listinfo/cfrg>, <mailto:cfrg-request@ietf.org?subject=unsubscribe>
List-Post: <mailto:cfrg@ietf.org>
List-Help: <mailto:cfrg-request@ietf.org?subject=help>
List-Subscribe: <https://www1.ietf.org/mailman/listinfo/cfrg>, <mailto:cfrg-request@ietf.org?subject=subscribe>
Errors-To: cfrg-bounces@ietf.org

Hi John,

On Sep 1, 2006, at 4:52 PM, John Wilkinson wrote:

> David (McGrew),
>
> I understand and accept your rationale for placing "IV" generation
> under the control of the AEAD algorithm. It was clear to me from the
> first draft, though your revised language is even more explicit. I
> think it's a good idea for precisely the reasons you state. However,
> two things I do not agree with are:
>
> 1) Requiring that the IV be an *output* of the encryption algorithm,
> rather than a value only used internally to the algorithm. What is the
> purpose of making it an output? Is it not simpler to require the input
> of a nonce to the encryption algorithm, and the input of the same
> nonce to the decryption algorithm? I see no need to make the internal
> workings of the algorithm (including the IV) visible to the user. GCM,
> to pick an example you are undoubtedly familiar with, does not return
> the IV to the user, so why require it here?

it's returned so that the user can send the IV along with the  
ciphertext and tag.  When it is the encryption algorithm rather than  
the user that's generating the IV, the user needs to be told that value.

>
> 2) Requiring that the "IV contribution" be included "verbatim" in the
> (preferably internal) IV of the algorithm. I would remove this
> language entirely. It is unclear what "verbatim" means in this
> context, and I think the requirement is counterproductive.

Yeah, others have told me that "verbatim" is confusing too.  What I'd  
meant was that the IV contribution must appear as part of the IV,  
e.g. as the prefix or as the suffix, or as some other contiguous sub- 
sequence of bits.

> As long as
> the user supplies a nonce, and the algorithm creates from that nonce
> an internal IV, the form of that IV shouldn't be restricted. Again,
> GCM does not use the user-supplied "IV contribution" (nonce) directly
> (verbatim?) when the nonce is other than 96-bits long, so why should
> you be more restrictive here?

I think that crypto modules should trade off some flexibility for  
some usability.  The idea is that an AEAD module as defined in the  
spec is harder to misue, and easier to test and to validate, than a  
module that implements a set of block cipher modes or other lower  
level primitives.

I'll rewrite the draft and try to make the situation w.r.t. the IV  
and IV Contribution more clear, over the next week or so.  I'll value  
your thoughts on the new text.

David

>
> -John
>
> On 8/28/06, David McGrew <mcgrew@cisco.com> wrote:
>> Hi John,
>>
>> On Aug 22, 2006, at 7:05 PM, John Wilkinson wrote:
>> >
>> > David, while I've only briefly skimmed your draft, Hal and Gregg's
>> > comments make me wonder about the way you're treating IVs in your
>> > specification.
>>
>> I've heard from others that the motivation for why IVs are handled in
>> the document is not clear.  Thanks for your comments; I clearly have
>> more explaining to do :-)
>>
>> > Why do you feel that IVs must be an _output_ of the
>> > encryption algorithm, rather than a purely internal value?
>>
>> There is a rationale given in Section 2, but I'll try to amplify it -
>> here's a rewrite of that part.  Please let me know what you think.
>>
>> <new>
>> Rationale.  Proper IV generation is a crucial for security, and the
>> requirements on how IVs are generated are different for different
>> algorithms.  By making the IV an output of the AEAD algorithm rather
>> than an input, the IV is put under the control of that algorithm.
>> This use of the 'information hiding' design principle frees the user
>> from needing to understand the particulars of IV generation, thus
>> making the interface easier to use correctly.  Also, because IV
>> generation is a security-critical operation, it makes sense to
>> include it with the algorithm, which will typically be implemented in
>> a crypto module.  Including IV generation in this module makes it
>> more self-contained and easier to test and to validate.
>>
>> Several security issues have arisen due to improper use of block
>> cipher modes of operation.  Several standards have suggested
>> incorrect uses of cipher block chaining (CBC) encryption (e.g. using
>> a previous ciphertext block as an IV, which allows an adversary to
>> predict the IV).  Modes that require distinct IVs, such as counter
>> mode, are especially sensitive to misuse of IVs, which can void the
>> security services that they provide.  Giving the AEAD algorithm the
>> responsibility for generating its own IV helps to avoid these
>> security issues.
>> </new>
>>
>> > Further,
>> > what, exactly, do you mean by the requirement that "A deterministic
>> > AEAD encryption algorithm MUST accept an additional input, and that
>> > value [the IV contribution] MUST be included _verbatim_ [emphasis
>> > added] in the IV."
>>
>> Several crypto algorithms, including CCM and GCM as used in ESP, form
>> their IVs by prepending a value that is fixed (for the lifetime of
>> the key) to a sequence number that increments once per packet.  The
>> IV contribution is needed in order to support these algorithms, and
>> it is needed in order to allow CTR-based modes (like CCM, GCM, and
>> EAX) to be useable in a situation in which there are multiple devices
>> doing encryption with a single key.  The IV contribution provides a
>> place within which each encryptor can put a distinct value, to ensure
>> that the IVs are distinct over all uses of that key.
>>
>> >
>> > It seems to me that it would be a better abstraction of the AEAD
>> > mechanism if the IV is used purely internally to the algorithm, so
>> > that the only input required is a nonce, and that the same nonce is
>> > used for encryption and decryption.
>>
>> Here we've gotten stuck on the terminological thicket.  What you're
>> calling a nonce is what the draft calls an IV.  I should add
>> definitions I guess.
>>
>> > Furthermore, the requirement that
>> > the "IV contribution" must be used "verbatim" in the IV could be  
>> read
>> > to exclude, for example, Bellare, Rogaway, and Wagner's EAX  
>> mode. EAX
>> > uses a user-supplied nonce, which may be of any length, and  
>> computes a
>> > MAC on this nonce to generate the initial counter for counter-mode
>> > encryption.
>> >
>>
>> The GCM mode of operation has the same property (it will accept an IV
>> of any length, though it is optimized to handle 96-bit IVs).
>> However, there does not seem to be any significant use for this
>> facility in practice, so I decided to use a simpler and more
>> consistent interface for the AEAD algorithms.  EAX could certainly be
>> added, but obviously we'd need to mandate a particular IV format.
>>
>> David
>>
>
> _______________________________________________
> Cfrg mailing list
> Cfrg@ietf.org
> https://www1.ietf.org/mailman/listinfo/cfrg

_______________________________________________
Cfrg mailing list
Cfrg@ietf.org
https://www1.ietf.org/mailman/listinfo/cfrg