linux-crypto.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephan Mueller <smueller@chronox.de>
To: noloader@gmail.com
Cc: keyrings@vger.kernel.org, linux-crypto@vger.kernel.org
Subject: Re: [PATCH] DH support: add KDF handling support
Date: Thu, 14 Jul 2016 16:19:20 +0200	[thread overview]
Message-ID: <9415711.Ky7HB7mCX4@tauon.atsec.com> (raw)
In-Reply-To: <CAH8yC8=GUqm5w069_42SWpjTwcuQxvmCtrAfzX9BnoyW_PEYwA@mail.gmail.com>

Am Donnerstag, 14. Juli 2016, 04:00:57 schrieb Jeffrey Walton:

Hi Jeffrey,

> > Note, as shared secrets potentially post-processed by a KDF usually are
> > again used as key or data encryption keys, they need to be
> > truncated/expanded to a specific length anyway. A KDF inherently provides
> > the truncation support to any arbitrary length. Thus, I would think that
> > the caller needs to provide that length but does not need to truncate the
> > output itself.
> 
> As far as I know, there's no reduction in proof that a truncated hash
> is as secure as the non-truncated one. One of the reasons to provide
> the output length as a security parameter is to help avoid truncation
> and related hash output attacks.
> 
> Also see Kelsey's work on the subject;
> http://www.google.com/search?q=nist+kelsey+truncated+hash.

I understand that point. However, a KDF is not just a simple hash or 
truncation thereof. Furthermore, Kelsey is part of the NIST team that also 
developed SP800-108 (the KDF definition). Furthermore, the authors of 
SP800-56A (in particular Allen Roginsky who I met personally a number of 
times) work closely with Kelsey too.

So, I would not think that applying the standard KDF operation which is 
intended to "right-size" the DH output is nothing we should worry about.

I would rather worry about the size of the private key in the DH operation. 
The private key should be as small as cryptographically possible (e.g. 224 or 
256 bits) instead of half of the DH public key minus one (what TLS does) due 
to the reduced number of Sopie-Germain primes that are available in the latter 
case.

Ciao
Stephan

  reply	other threads:[~2016-07-14 14:19 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-12  9:06 [RFC PATCH] KEYS: add SP800-56A KDF support for DH Stephan Mueller
2016-07-12  9:06 ` [PATCH v3 0/4] crypto: Key Derivation Function (SP800-108) Stephan Mueller
2016-07-12  9:07   ` [PATCH v3 1/4] crypto: add template handling for RNGs Stephan Mueller
2016-07-18  7:14     ` Herbert Xu
2016-07-18  7:18       ` Stephan Mueller
2016-07-18 15:23       ` Sandy Harris
2016-07-18 15:37         ` Stephan Mueller
2016-07-12  9:07   ` [PATCH v3 2/4] crypto: kdf - add known answer tests Stephan Mueller
2016-07-12  9:07   ` [PATCH v3 3/4] crypto: kdf - SP800-108 Key Derivation Function Stephan Mueller
2016-07-12  9:08   ` [PATCH v3 4/4] crypto: kdf - enable compilation Stephan Mueller
2016-07-12  9:08 ` [PATCH] DH support: add KDF handling support Stephan Mueller
2016-07-13 23:17   ` Mat Martineau
2016-07-14  6:54     ` Stephan Mueller
2016-07-14  8:00       ` Jeffrey Walton
2016-07-14 14:19         ` Stephan Mueller [this message]
2016-07-14 23:47       ` Mat Martineau
2016-07-27  7:55         ` David Howells
2016-07-27  9:11           ` Stephan Mueller
2016-07-15  0:45 ` [RFC PATCH] KEYS: add SP800-56A KDF support for DH Mat Martineau
2016-07-15 16:38   ` Stephan Mueller
2016-07-15 18:45     ` Mat Martineau

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9415711.Ky7HB7mCX4@tauon.atsec.com \
    --to=smueller@chronox.de \
    --cc=keyrings@vger.kernel.org \
    --cc=linux-crypto@vger.kernel.org \
    --cc=noloader@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).