[Ndn-interest] Adding HMAC to available NDN signature types

Adeola Bannis abannis at ucla.edu
Mon Sep 22 12:34:13 PDT 2014


So far, I haven't heard anything I object to. Could someone with strong
feelings about KeyDigest use rewrite the spec? Are there any other areas we
want to rewrite (the definition of HMAC)?

Otherwise, it sounds like this is something we would implement soon.

-Adeola

On Mon, Sep 22, 2014 at 10:02 AM, Thompson, Jeff <jefft0 at remap.ucla.edu>
wrote:

>  Hash output length vs. block size…
>
>  Marc is right. The HmacWithSha256 algorithm hashes the key when it is
> longer than the block size (64 bytes), not the hash output length (32
> bytes).  So we would prohibit keys longer than 64 bytes (not 32 bytes).
>
>  Also, most applications will use a crypto library's HMAC function which
> should automatically hash the key if it is longer than the block size. It
> could be confusing to put this in the spec since the application writer may
> unnecessarily has the key when the crypto library will do it anyway, and
> more efficiently.
>
>  - Jeff T
>
>   From: <Thompson>, Jeff Thompson <jefft0 at remap.ucla.edu>
> Date: Monday, September 22, 2014 9:53 AM
> To: Yingdi Yu <yingdi at cs.ucla.edu>, Adeola Bannis <abannis at ucla.edu>
> Cc: "ndn-interest at lists.cs.ucla.edu" <Ndn-interest at lists.cs.ucla.edu>
> Subject: Re: [Ndn-interest] Adding HMAC to available NDN signature types
>
>    On Fri, Sep 19, 2014 at 11:18 PM, Yingdi Yu <yingdi at cs.ucla.edu> wrote:
>   > However, when key is longer than the hash output, putting key digest
> into key locator directly expose the secret to other.
>
>  Oh crap, you're right!  Thanks for pointing that out.  I agree that we
> should prohibit KeyDigest in the case that the key is longer than 32
> bytes.  I would reword the reason slightly: "When the key is longer than 32
> bytes, the HmacWithSha256 algorithm uses the SHA-256 digest of the key,
> which would be the same as the KeyDigest, effectively exposing the secret."
>
>  - Jeff T
>
>   From: Yingdi Yu <yingdi at cs.ucla.edu>
> Date: Sunday, September 21, 2014 12:00 AM
> To: Adeola Bannis <abannis at ucla.edu>
> Cc: "ndn-interest at lists.cs.ucla.edu" <Ndn-interest at lists.cs.ucla.edu>
> Subject: Re: [Ndn-interest] Adding HMAC to available NDN signature types
>
>   On Sep 20, 2014, at 11:18 AM, Adeola Bannis <abannis at ucla.edu> wrote:
>
>
>  On Fri, Sep 19, 2014 at 11:18 PM, Yingdi Yu <yingdi at cs.ucla.edu> wrote:
>
>>
>>   @Adeola, you probably want to forbid KeyDigest in KeyLocator for this
>> HMAC signature. Because if key size is longer than hash output, the key
>> digest is used instead. If we allow KeyDigest in KeyLocator, then some
>> careless programmers may leak the secret.
>>
>
>  Well, a careless programmer could put a passphrase, or something used to
> derive the key, into a KeyLocator KeyName as well. We can go ahead and make
> the restriction, but there are other ways a programmer could shoot herself
> in the foot here.
>
>
> I did not mean that "careless" as you describe. I mean those who do not
> know the details of HMAC.
>
>  The problem is that when key is shorter than hash output, it is safe to
> put key digest in the key locator. However, when key is longer than the
> hash output, putting key digest into key locator directly expose the secret
> to other, i.e., attackers can directly use the key digest to construct any
> legitimate HMAC. Therefore you either explicitly specify what should be
> used when KeyDigest is used as the KeyLocator, or you can disable the usage
> of KeyDigest in KeyLocator.
>
>  Yingdi
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.lists.cs.ucla.edu/pipermail/ndn-interest/attachments/20140922/49546a15/attachment.html>


More information about the Ndn-interest mailing list