Re: [Cfrg] Aside Re: [CFRG] erratum for hmac ...

David Jacobson <dmjacobson@sbcglobal.net> Fri, 10 February 2017 05:38 UTC

Return-Path: <dmjacobson@sbcglobal.net>
X-Original-To: cfrg@ietfa.amsl.com
Delivered-To: cfrg@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 6230D129FB1 for <cfrg@ietfa.amsl.com>; Thu, 9 Feb 2017 21:38:36 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.699
X-Spam-Level:
X-Spam-Status: No, score=-2.699 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-0.7] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=sbcglobal.net
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 0zSIlGAXeuF4 for <cfrg@ietfa.amsl.com>; Thu, 9 Feb 2017 21:38:35 -0800 (PST)
Received: from nm27-vm10.access.bullet.mail.bf1.yahoo.com (nm27-vm10.access.bullet.mail.bf1.yahoo.com [216.109.115.233]) (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 A6FB8129FB0 for <cfrg@ietf.org>; Thu, 9 Feb 2017 21:38:34 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sbcglobal.net; s=s2048; t=1486705113; bh=mmHjru3JM2KSSxOdCZUdeIsUNErdoDBlNbzIpUbBZQg=; h=Subject:To:References:Cc:From:Date:In-Reply-To:From:Subject; b=e6BurRQ0uCXW1NO3DqvaCA5nCyqKGragp21gyOwD8pbakDj5TvA+0A/sRIFtCPcfdq/qZsypI859+Gm6obHI6Dpy6AKnUNAgIKU+HYVIMTa4Kq/lz9P4n45OY12oMe/xOw+orNfZW7pmRGIiKtXNVcvuPnmre2hzB63e2ju6/c8YLmm0ElNxErH12tEh7vOl9Dzc+n0IDuuGaM5OhbLLkVvB9wqJnDosLNW4Nb7186Kyu+hsmx88yqsmJC7SvOZWj5CcOZs369D8Ko2X2N+Tx5XicfCkk8d+gKKereioZYp4csRag7W1WZlwIFJ0e19SxbJyqv4LqKF9aAPi7gCcDQ==
Received: from [66.196.81.157] by nm27.access.bullet.mail.bf1.yahoo.com with NNFMP; 10 Feb 2017 05:38:33 -0000
Received: from [98.138.104.99] by tm3.access.bullet.mail.bf1.yahoo.com with NNFMP; 10 Feb 2017 05:38:33 -0000
Received: from [127.0.0.1] by smtp119.sbc.mail.ne1.yahoo.com with NNFMP; 10 Feb 2017 05:38:33 -0000
X-Yahoo-Newman-Id: 707821.72567.bm@smtp119.sbc.mail.ne1.yahoo.com
X-Yahoo-Newman-Property: ymail-3
X-YMail-OSG: LYsX.aIVM1mR255esveyN4EphA5ddEgt5IPGcSvc.Df1VlE BuWKRtAma72MYBod4FDzpMKagMtgkIy3Gs3u_WgU7ahtdtJoceiZbobunRvX GjLqok8_DP7wj9wk5zR9OVbA4EHcrFZL_YE5aerhJgv8G6Ui5xvKoLdmHl_s A6JEZXAzmqWfyU3I540zoGlGw64vL4WM6MBeiqlz3ug5qLc8NXBpozwpyyfR JC8ibN77SKE0IZMVRsusL_fLyvzuEmAoNBocNjLh7qdwVPdG0hkF_zPVLpBz mXAsqZXaZeAO16C6Y11wLUd1e_Gr5lUivy_2ijFakj.uFHrho4g5A0a.oeyi 4_fMGQDOv059_yTEc9M.o.Yrl0V7Exv1jfIGLZ.u.uXlzrqldA15s9bgUFeI psrkUizEeYplFzjx1Y3B.4FwBr_o2WmGPhcu5fBqhSkeaBbngGH6toxeI5Qy axIJtAjbO12taNVyGN3A2EVMeCrPJxvFUVnGrvMxWlmlnpQZy06l8nJRPIYm 2XKDW09CPPJO1QvcHS5uiK0LkV4s6b.44d.x6GlWJel073P4nH8tJLs3i79g nn1FbpSKtxg--
X-Yahoo-SMTP: nOrmCa6swBAE50FabWnlVFUpgFVJ9Gbi__8U5mpvhtQq7tTV1g--
To: "Dang, Quynh (Fed)" <quynh.dang@nist.gov>, Randal Atkinson <randal.atkinson.ctr@nrl.navy.mil>, Michael StJohns <msj@nthpermutation.com>, "Paterson, Kenny" <Kenny.Paterson@rhul.ac.uk>
References: <F2C52E74-6FF0-4F72-BFD0-56D39031B4D9@nrl.navy.mil> <CY4PR09MB1464F9936D5C07DF16D29403F3420@CY4PR09MB1464.namprd09.prod.outlook.com> <59d04ca7-aed8-e0e1-bf06-fdd44ccba697@sbcglobal.net>
From: David Jacobson <dmjacobson@sbcglobal.net>
Message-ID: <9a95bf47-9fea-6a38-5bdf-d88f10b36323@sbcglobal.net>
Date: Thu, 09 Feb 2017 21:38:31 -0800
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:45.0) Gecko/20100101 Thunderbird/45.7.1
MIME-Version: 1.0
In-Reply-To: <59d04ca7-aed8-e0e1-bf06-fdd44ccba697@sbcglobal.net>
Content-Type: multipart/alternative; boundary="------------93BDA7C57AD9161DF4494782"
Archived-At: <https://mailarchive.ietf.org/arch/msg/cfrg/SF4Xw5XNrFsPTpP7vyDXhSJ37NM>
Cc: "cfrg@ietf.org" <cfrg@ietf.org>
Subject: Re: [Cfrg] Aside Re: [CFRG] erratum for hmac ...
X-BeenThere: cfrg@irtf.org
X-Mailman-Version: 2.1.17
Precedence: list
List-Id: Crypto Forum Research Group <cfrg.irtf.org>
List-Unsubscribe: <https://www.irtf.org/mailman/options/cfrg>, <mailto:cfrg-request@irtf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/cfrg/>
List-Post: <mailto:cfrg@irtf.org>
List-Help: <mailto:cfrg-request@irtf.org?subject=help>
List-Subscribe: <https://www.irtf.org/mailman/listinfo/cfrg>, <mailto:cfrg-request@irtf.org?subject=subscribe>
X-List-Received-Date: Fri, 10 Feb 2017 05:38:36 -0000

Oops.  I made a mistake.  It is the key that is being hashed not the 
message.

But I still don't see where it helps.  An attacker does not choose the key.

Now there was this discussion about related keys they could generate the 
same output.  But if we fix the key to some protocol-specific value, 
then there is no easy way to get related keys that give the same 
output.  You would need to find a sort of double-collision where the 
hash internal state after the first block is the same for keyA ^ IPAD 
and keyB ^ IPAD and the internal state after the first block is the same 
for keyA ^ OPAD and keyB ^ OPAD.  This seems much harder than just 
finding a collision.

    --David

On 2/9/17 9:27 PM, David Jacobson wrote:
> See interleaved comment.
>
> On 2/8/17 5:31 AM, Dang, Quynh (Fed) wrote:
>>
>> Randal, Michael and many others,
>>
>>
>> Thank you for your suggestions.
>>
>>
>> Kenny,
>>
>>
>> Thank you for your discussion email.
>>
>>
>> We are thinking about what would be the best option for HMAC.  Some 
>> technical possibilities are below.
>>
>>
>> 1) Don't change the HMAC spec.
>>
>>
>> Ask a HMAC key always to have a fixed length such as HMAC-SHA256 
>> having 256-bit key. Which means that all protocols using HMAC-SHA256 
>> use 256-bit keys.
>>
>> If each protocol uses a different key length, then the issue 
>> would still exist across protocols. I don't know if this is a 
>> practical security problem, but it seems like a problem that should 
>> be avoided.
>>
>> Should ask HMAC keys to be processed/produced by a hash function or 
>> another PRF always.
>
> I don't see the need or even desirability for this, assuming you ask 
> each protocol to use a fixed (for that protocol) key length. (That was 
> the line above.)
>
> For an attacker to find two messages with the same HMAC, not knowing 
> the key, he would have to find a collision in the first stage, not 
> knowing the first block.  And if you add an extra hash, you are only 
> making it easier.  He has to get a collision in the pre-hash, where he 
> knows everything.
>
>    --David Jacobson
>>
>> This option does not break interoperability of  the current HMAC 
>> implementations.
>>
>> 2) Change the HMAC Spec.
>>
>> a) Always hash the key regardless of its length, then perform step 3 
>> in FIPS 198.
>> b) Use a hash-based KDF (not HKDF) to produce B bits from the key, 
>> then go to step 4 in the FIPS. (bad for performance).
>> c) Require key < B, then do multi-rate padding 10* to make the key B 
>> bits, then go to step 4 in the FIPS. (good for performance).
>>
>> We recommend the use of KMAC in SP 800-185. KMAC's security is solid 
>> and proven, and it has great performance. Code to implement KMAC can 
>> be reused to implement many other Keccak-derived symmetric-key crypto 
>> functions.
>>
>> Regards,
>> Quynh.
>> ------------------------------------------------------------------------
>> *From:* Randal Atkinson <randal.atkinson.ctr@nrl.navy.mil>
>> *Sent:* Tuesday, February 7, 2017 12:34 PM
>> *To:* Dang, Quynh (Fed)
>> *Cc:* Randal Atkinson
>> *Subject:* Aside Re: [CFRG] erratum for hmac ...
>>
>> One option available to NIST would be for NIST to open comments
>> on updating FIPS 198-1, even if opening comments on that now/soon
>> would be earlier than NIST ordinarily would do so.
>>
>> Given how long it takes to move from an approved FIPS revision
>> to widespread US Government deployment, if data exists from
>> Kenny P and/or others that merits an update, then starting sooner
>> would not be a bad thing for the USG.
>>
>> Cheers,
>>
>> Ran Atkinson
>>
>> --------------------------------
>> Randal Atkinson, PhD
>> Cheltenham Research for NRL 5520
>> randal.atkinson.ctr@nrl.navy.mil
>>
>>
>>
>> _______________________________________________
>> Cfrg mailing list
>> Cfrg@irtf.org
>> https://www.irtf.org/mailman/listinfo/cfrg
>
>