Subject: RE: Resending: Is it secure to truncate ZZ to derive shared keys

From: "Liqiang(Larry) Zhu" <[email-masked]>
Date: Mon, 27 Sep 2004 16:25:14 -0700

I like the idea of bitstring2key(), if we have that, all we need is:

k = bitstring2key(k_dh | n_c | n_k);

In other words, why do we need PRF at all?

> There's a problem with kcrypto; string2key() works for UTF-8 inputs
only
> and we have no equivalent for bit/octet strings, nor do we have a 
> bitstring2UTF8().

I do not understand what the problem you are trying to solve. Right now
all I want is to get over with PKINIT.

Larry

-----Original Message-----
From: Nicolas Williams [mailto:[email-masked]] 
Sent: Monday, September 27, 2004 4:01 PM
To: Liqiang(Larry) Zhu
Cc: [email-masked]; Sam Hartman
Subject: Re: Resending: Is it secure to truncate ZZ to derive shared
keys

Ok, so hash k_dh using, what, SHA-256?  And truncate to 128 bits for
AES-128?  What about [future] enctypes that have keys longer than 256
bits?

k = random2key(PRF(bitstring2key(k_dh), k_dh | n_c | n_s))

So we need an bitstring2key() operation and kcrypto doesn't define one.

There's a problem with kcrypto; string2key() works for UTF-8 inputs only
and we have no equivalent for bit/octet strings, nor do we have a
bitstring2UTF8().

Nico
--

---

From: Nicolas Williams <[email-masked]>
Date: Mon, 27 Sep 2004 18:28:06 -0500

> In other words, why do we need PRF at all?

We need something to build bitstring2key() on.  PBKDF2() is a
possibility -- which uses a PRF, BTW.

We could define randomstring2key+() like so:

    randomstring2key+(string, salt) =
	    random2key(PBKDF2(string, salt, 1, key_size))

I.e., a simplified string2key().

And PKINIT could then use this to derive a key like so:

    k = randomstring2key+(k_dh, n_c | n_s)

> all I want is to get over with PKINIT.

I don't necessarily mean that kcrypto should be recalled to add such a
thing.  I mean that "gee, it's too bad kcrypto defines string2key() for
passwords but not equivalent for random, variable length shared secrets,
like DH keys.

Nico
--