Re: [kitten] WGLC on draft-ietf-kitten-aes-cts-hmac-sha2-06

Michael Jenkins <m.jenkins.364706@gmail.com> Thu, 09 April 2015 22:22 UTC

Return-Path: <m.jenkins.364706@gmail.com>
X-Original-To: kitten@ietfa.amsl.com
Delivered-To: kitten@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 2A8511B346F for <kitten@ietfa.amsl.com>; Thu, 9 Apr 2015 15:22:00 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.749
X-Spam-Level:
X-Spam-Status: No, score=-1.749 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, SPF_PASS=-0.001] autolearn=no
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 YZJFv3l90w2o for <kitten@ietfa.amsl.com>; Thu, 9 Apr 2015 15:21:56 -0700 (PDT)
Received: from mail-qk0-x230.google.com (mail-qk0-x230.google.com [IPv6:2607:f8b0:400d:c09::230]) (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 754D91B3470 for <kitten@ietf.org>; Thu, 9 Apr 2015 15:21:56 -0700 (PDT)
Received: by qkx62 with SMTP id 62so1982180qkx.0 for <kitten@ietf.org>; Thu, 09 Apr 2015 15:21:55 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=I5T6cOHNLPkSEXVgpeOtnSHTszMitWV06wI+vbK+Xdo=; b=qIa8WlJzy+JlCGXBKVCYH+zH16j+O+OtzfyrvbkfCbdJ/Ce5zdpFq0d+OnUSvYGcuX 9JL9JazPzAajvJQf52mujiYSkilBWgF7HHAX+okcrNanwi2OYq+7IRqWfN+ywla5wREr gphVOQmt0wpZ+a+5Y7GIr0SfPcMdao6naDNhcVWRhhTFqv+0LdrntzhlXzedZyB7KbTe NnbGDshuHPhA4CepkBMkqxK3kK0Ar0UDFt1cXuY1tGK1YYjKdBYStcwIlMyqzQqghkeE prxoCDXcC0KBemm2AvevWywb8tc3vVsL4tCltmCQPootpyXVK0pSxRAVo//PK22l+cyp xUzg==
MIME-Version: 1.0
X-Received: by 10.229.214.199 with SMTP id hb7mr40598182qcb.12.1428618115727; Thu, 09 Apr 2015 15:21:55 -0700 (PDT)
Received: by 10.229.231.71 with HTTP; Thu, 9 Apr 2015 15:21:55 -0700 (PDT)
In-Reply-To: <5525B044.8070509@mit.edu>
References: <alpine.GSO.1.10.1503301227280.22210@multics.mit.edu> <551D6C35.4080108@mit.edu> <alpine.GSO.1.10.1504081626110.22210@multics.mit.edu> <5525B044.8070509@mit.edu>
Date: Thu, 9 Apr 2015 18:21:55 -0400
Message-ID: <CAC2=hnfbLoRAQLwDQhL7pVYMS8kqfc1rAA6Ha1np1h1WnhT5aw@mail.gmail.com>
From: Michael Jenkins <m.jenkins.364706@gmail.com>
To: Greg Hudson <ghudson@mit.edu>
Content-Type: multipart/alternative; boundary=001a1132f7ea4ec82f0513521388
Archived-At: <http://mailarchive.ietf.org/arch/msg/kitten/i8Hb-uaa9G5J_siQ2KsKX1L-NhU>
Cc: kitten@ietf.org, "mjjenki@tycho.ncsc.mil" <mjjenki@tycho.ncsc.mil>
Subject: Re: [kitten] WGLC on draft-ietf-kitten-aes-cts-hmac-sha2-06
X-BeenThere: kitten@ietf.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: Common Authentication Technologies - Next Generation <kitten.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/kitten>, <mailto:kitten-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/kitten/>
List-Post: <mailto:kitten@ietf.org>
List-Help: <mailto:kitten-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/kitten>, <mailto:kitten-request@ietf.org?subject=subscribe>
X-List-Received-Date: Thu, 09 Apr 2015 22:22:00 -0000

Hi, sorry for the silence. I've been on travel and I wanted to make sure I
got one of the original authors to help respond. So, we should be able to
address all of Greg's concerns shortly. In the meantime, I can comment
generally if simplistically on two things:

Bit string lengths and bits-o'-security: When this draft was originally
introduced to kitten, it was stated that it was to support
draft-burgin-kerberos-suiteb <
http://www.ietf.org/mail-archive/web/kitten/current/msg03802.html>gt;. So
there's an implicit presumption that one is working in one of two modes,
192-bit or 128-bit security, and consequently using either SHA-384 or
SHA-256, respectively.

In general, though, it's designed to make sense - you can't use SHA-256 to
get a 192 bit key because a SHA-256 output has at most 128 bits of security
no matter how you slice it. I am not an expert in attacks on hashes nor on
hash-function construction (boy howdy!), so I'm not going to argue about
whether this particular application is susceptible to this-or-that attack -
ultimately the answer is "because Suite B". I'm not saying that as a
hammer; I'm saying that's how the thing was pitched and accepted as a
work-item back at version -02.

Test vectors: I can nearly guarantee (see inheritance disclaimer above)
that the Ke for the encryption test vector sets beyond the first 128-bit
one came straight out of /dev/random, no doubt based on the fact that it
was easier to do so than to figure out how to get access to Kelley's
abandoned workfiles after he left for greener pastures (go him!). I can
regenerate them taking a more soup-to-nuts approach.

Mike J

On Wed, Apr 8, 2015 at 6:48 PM, Greg Hudson <ghudson@mit.edu> wrote:

> On 04/08/2015 05:26 PM, Benjamin Kaduk wrote:
> > I did not go on a full trawl through the archives, but
> > http://www.ietf.org/mail-archive/web/kitten/current/msg05307.html
> implies
> > that NIST is generating a document covering "what you get from what you
> > used" indicating that SHA-256 only gives you 128 bits, under some set of
> > assumptions.
>
> I do not understand what assumptions would yield a security level of 128
> bits from SHA-256 truncated to 192 bits, and a security level of 192
> bits from SHA-384 truncated to 192 bits.  If there is a concern about
> birthday attacks on the integrity tag, then we can't get away with
> truncating at all; we would need to send a 256-bit tag for the 128-bit
> security level, and a 384-bit tag for the 192-bit security level.
>
> I wonder if NIST finished its document in the interim.
>
> >> * Why use a 192-bit HMAC key for Ki and Kc but not for Kp?
>
> This was probably a dumb question, and really devolves into "why use a
> 256-bit PRF output length?"  For the 192-bit security level, Ki and Kc
> are used to generate a 192-bit tag, but Kp is used to generate a 256-bit
> PRF.
>
> [Regarding truncation of the PRF output:]
> > I think there is some desire to always truncate SHA-2 results in half,
> > though, for the reasons mentioned above.
>
> I would like to better understand these reasons.
>
> > So random-to-key() only applies for generating base keys, and the
> > derivation of Kc/Ki/Ke/Kp should just be k-truncate(...)?
>
> Yes.  RFC 3961 defines random-to-key() as producing a protocol key.  It
> is probably a conceptual error that RFC 3961 section 5.1 uses
> random-to-key() as the last step of its key derivation function.  That
> error would be especially confusing in the new context, where derived
> HMAC keys can have different lengths than protocol keys.
>
> > Or is the argument rather that since we are not using the simplified
> > profile, we just don't need random-to-key() at all because we are
> defining
> > things manually and can make use of the fact that it is the identity
> > function for these enctypes?
>
> No, we need a random-to-key(); it is part the RFC 3961 definition of an
> encryption algorithm profile.  By contrast, key derivation is not part
> of this definition; it's just an internal feature of every
> non-single-DES encryption type so far.
>
> >> sloppy because it depends on context; instead of taking a length
> >> parameter, it uses an implicit length based on what operation the
> >> invoker is performing.  In a similar vein, section 3 talks about what
> >> the input constant is for each derivation use; this is not the case for
> >> RFC 3961 or RFC 6803 and seems out of place.
>
> > So you want to rely just on the (type of the) key being derived and not
> > mention the last octet of the constant?  I think that would be a valid
> way
> > to specify things, but want to confirm the nature of your comment.
>
> My suggestion is to:
>
> * Give the key derivation function KDF-HMAC-SHA2() an explicit length
> parameter, and remove the discussion of what its value is for each use.
>  Provide a length argument in each use of KDF-HMAC-SHA2() elsewhere in
> the document.  This argument will probably need to be given
> symbolically, as it varies between the 128-bit and 192-bit security levels.
>
> * Remove the discussion of what the constant values are from section 3.
>
> >> I have several concerns about the presentation of the test vectors:
> >>
> >> * The PRF test vectors do not list a base key; instead it lists a Kp
> >> value.  This requires tests to exercise only a component of the PRF
> >> implementation, which may be inconvenient.  The base keys are present in
> >> the key derivation test vectors, but this is not immediately clear.
>
> > We could add text so the PRF test vectors say "Kp value (repeated from
> > above):"; would that help?
>
> I think it would be better to explicitly list the base key.  If it
> happens to be the same as the base key from a previous test vector,
> that's not really important.
>
> >> * The encryption test vectors do not list base keys and key usages;
> >> instead they only list "AES key" and "HMAC key" values which are
> >> presumably Kc and Ki.  For the first 128-bit test vector, the base key
> >> and usage is recoverable from the key derivation test vectors, but that
> >> does not appear to be the case for any of the other encryption test
> >> vectors.  Because of this, I only verified the first encryption test
> vector.
>
> > Hmm.  I don't really want to propose removing test vectors to replace
> them
> > with new ones, but could we add some additional test vectors which do
> > possess the desired properties?  (I.e., that the Kc and Ki are listed in
> a
> > previous test vector from base key and usage, or that they are test
> > vectors starting from base key.)
>
> I don't think there's anything precious about the currently listed test
> vectors.  If the draft authors possess the base keys they used for the
> encryption test vectors, they can provide them; otherwise they can
> generate new test vectors and we can discard the old ones.  Including
> encryption test vectors with missing base keys just seems frustrating to
> an implementor.
>
> _______________________________________________
> Kitten mailing list
> Kitten@ietf.org
> https://www.ietf.org/mailman/listinfo/kitten
>



-- 
Mike Jenkins
mjjenki@tycho.ncsc.mil - if you want me to read it only at my desk
m.jenkins.364706@gmail.com - to read everywhere else
443-634-3951