Re: [lamps] Side-channel attack on multi-level trees and key generation of LMS.

"Dang, Quynh (Fed)" <quynh.dang@nist.gov> Tue, 26 March 2019 16:03 UTC

Return-Path: <quynh.dang@nist.gov>
X-Original-To: spasm@ietfa.amsl.com
Delivered-To: spasm@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 1988E1203AC for <spasm@ietfa.amsl.com>; Tue, 26 Mar 2019 09:03:05 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -0.011
X-Spam-Level:
X-Spam-Status: No, score=-0.011 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=0.001, HTTPS_HTTP_MISMATCH=1.989, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=nist.gov
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 EURYmKP6YXdb for <spasm@ietfa.amsl.com>; Tue, 26 Mar 2019 09:03:00 -0700 (PDT)
Received: from GCC01-CY1-obe.outbound.protection.outlook.com (mail-cy1gcc01on0723.outbound.protection.outlook.com [IPv6:2a01:111:f400:fd00::723]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 2AEE112038E for <spasm@ietf.org>; Tue, 26 Mar 2019 09:03:00 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nist.gov; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=DHv8ihe/uQb4Lt/9Vc+l+MHeU3eGUCrcSV+/riesSek=; b=GnK0fJ6O7UNiwMUmCjeMDpPRJh1RnXuSfXF+5oDqzkNZ1aRjxLFXyil6rknPLS1nbpLWntkz9TnPg5oQRKmDfLLBW9zRTfgQnyOlSuLMiHEt6YlZlHfiM4uFYISVRF5i9dxmusPxD70+AE0lzGbpIsCOk83HEIhBOuXO1nvwov0=
Received: from BN8PR09MB3604.namprd09.prod.outlook.com (20.179.76.14) by BN8PR09MB3602.namprd09.prod.outlook.com (20.179.76.12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1730.18; Tue, 26 Mar 2019 16:02:58 +0000
Received: from BN8PR09MB3604.namprd09.prod.outlook.com ([fe80::1ce2:52b0:6c95:b3c0]) by BN8PR09MB3604.namprd09.prod.outlook.com ([fe80::1ce2:52b0:6c95:b3c0%5]) with mapi id 15.20.1730.019; Tue, 26 Mar 2019 16:02:58 +0000
From: "Dang, Quynh (Fed)" <quynh.dang@nist.gov>
To: Tim Hollebeek <tim.hollebeek@digicert.com>, Jim Schaad <ietf@augustcellars.com>, "'Scott Fluhrer (sfluhrer)'" <sfluhrer@cisco.com>, 'SPASM' <spasm@ietf.org>
Thread-Topic: [lamps] Side-channel attack on multi-level trees and key generation of LMS.
Thread-Index: AQHU49VOWMyEHh07WU6WCYCL4KDmBaYd5ZWAgAAKTzaAABUyAIAAAZekgAADHoCAAARvgIAAA5Hm
Date: Tue, 26 Mar 2019 16:02:58 +0000
Message-ID: <BN8PR09MB3604A77E47718900BC83A13DF35F0@BN8PR09MB3604.namprd09.prod.outlook.com>
References: <BN6PR14MB1106140408FFB08553DEAE98835F0@BN6PR14MB1106.namprd14.prod.outlook.com>, <D6AB5830-C69A-44CA-BD63-9B64F92C032E@vigilsec.com> <BN8PR09MB3604C9C7C8609430A58FD99EF35F0@BN8PR09MB3604.namprd09.prod.outlook.com>, <afb437b0d9e14a8097947a25d8422286@XCH-RTP-006.cisco.com> <BN8PR09MB3604324EF9D5BF4E9061F1B4F35F0@BN8PR09MB3604.namprd09.prod.outlook.com>, <048d01d4e3e6$625b4980$2711dc80$@augustcellars.com> <BN8PR09MB36040F0DFA1A6C8D4D80B8F0F35F0@BN8PR09MB3604.namprd09.prod.outlook.com> <04a801d4e3e8$bd2f79b0$378e6d10$@augustcellars.com>, <BN6PR14MB1106477F25C11AD9031EF075835F0@BN6PR14MB1106.namprd14.prod.outlook.com>
In-Reply-To: <BN6PR14MB1106477F25C11AD9031EF075835F0@BN6PR14MB1106.namprd14.prod.outlook.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
authentication-results: spf=none (sender IP is ) smtp.mailfrom=quynh.dang@nist.gov;
x-originating-ip: [2001:67c:370:128:b877:3682:3cc7:357]
x-ms-publictraffictype: Email
x-ms-office365-filtering-correlation-id: 448a0405-396e-41f2-3f2c-08d6b204842d
x-ms-office365-filtering-ht: Tenant
x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600127)(711020)(4605104)(4618075)(2017052603328)(7153060)(7193020); SRVR:BN8PR09MB3602;
x-ms-traffictypediagnostic: BN8PR09MB3602:
x-ms-exchange-purlcount: 1
x-microsoft-antispam-prvs: <BN8PR09MB360211E5B4F0ED571AA222EFF35F0@BN8PR09MB3602.namprd09.prod.outlook.com>
x-forefront-prvs: 09888BC01D
x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(346002)(376002)(366004)(39860400002)(396003)(136003)(189003)(199004)(53754006)(9686003)(53936002)(14454004)(476003)(46003)(236005)(446003)(6606003)(11346002)(19627235002)(256004)(105586002)(6246003)(14444005)(6116002)(19627405001)(71190400001)(486006)(86362001)(2906002)(71200400001)(6436002)(106356001)(99286004)(229853002)(93886005)(110136005)(8936002)(33656002)(316002)(55016002)(6306002)(54896002)(6506007)(25786009)(7696005)(76176011)(102836004)(97736004)(5660300002)(81156014)(186003)(68736007)(8676002)(52536014)(81166006)(478600001)(966005)(7736002)(74316002)(606006)(53546011); DIR:OUT; SFP:1102; SCL:1; SRVR:BN8PR09MB3602; H:BN8PR09MB3604.namprd09.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1;
received-spf: None (protection.outlook.com: nist.gov does not designate permitted sender hosts)
x-ms-exchange-senderadcheck: 1
x-microsoft-antispam-message-info: s48JiGUMI5/P/TqknoHDW68m7FwHgAjUqbKPhDwBI1MVgQVoS2VgutuevgRsAve+CfFtZSDZJwxAAr35F8yeq7wRp98GuYFlVgvoy+WzMjed+d/2UD3Cglhsw6E8B0wUZdIC2pqkNPJDBgTONBLw3QhygSuEr18eqC9rgKrXfkcKaWcxjZ+vl+Shrh3qwe9wtuTdO0cQtRrM5Bp+0rVCpbClOKHD3d1GTRtqT0X2CVt01NfakypvELA/Exzl+8q1Hozl98fze+jMHzZPM5uqJi1WmOsb/Nohr6OueU2c0Liu1jfigEkGdoNF+/FefVqDYF/wA36zrN6ptuyJdAkPsHYsuq4ur/wUuINpLSrSyaSl2JRIqSnW0r0FoUQU2Pdrvygu4RpEV4xKg3W8yfmmDTcKlj+U6y0ltSaN0EPv9a8=
Content-Type: multipart/alternative; boundary="_000_BN8PR09MB3604A77E47718900BC83A13DF35F0BN8PR09MB3604namp_"
MIME-Version: 1.0
X-OriginatorOrg: nist.gov
X-MS-Exchange-CrossTenant-Network-Message-Id: 448a0405-396e-41f2-3f2c-08d6b204842d
X-MS-Exchange-CrossTenant-originalarrivaltime: 26 Mar 2019 16:02:58.6214 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 2ab5d82f-d8fa-4797-a93e-054655c61dec
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN8PR09MB3602
Archived-At: <https://mailarchive.ietf.org/arch/msg/spasm/uy_PiUrTGRn8hL_gWz3mJ7JrWK0>
Subject: Re: [lamps] Side-channel attack on multi-level trees and key generation of LMS.
X-BeenThere: spasm@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: "This is a venue for discussion of doing Some Pkix And SMime \(spasm\) work." <spasm.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/spasm>, <mailto:spasm-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/spasm/>
List-Post: <mailto:spasm@ietf.org>
List-Help: <mailto:spasm-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/spasm>, <mailto:spasm-request@ietf.org?subject=subscribe>
X-List-Received-Date: Tue, 26 Mar 2019 16:03:05 -0000

A HSM holds the LMS private key (the full LMS private key) of a small signing leaf tree is the same with the HSM holds the equivalent number of OTS private keys from a 1-level tree.



So, the situation is the same for both cases.


Quynh.

________________________________
From: Tim Hollebeek <tim.hollebeek@digicert.com>
Sent: Tuesday, March 26, 2019 11:45:33 AM
To: Jim Schaad; Dang, Quynh (Fed); 'Scott Fluhrer (sfluhrer)'; 'SPASM'
Subject: RE: [lamps] Side-channel attack on multi-level trees and key generation of LMS.


(chair hat off)



There are implementations that try to only hold the expanded private key in HSM memory and never outside the HSM.  So there are space concerns as well as CPU time concerns that may limit total tree size.  Remember that for some use-cases, it is desirable to be able to use relatively small and underpowered HSMs, especially for relatively rare operations like code-signing.



And as I mentioned this afternoon, “only two hours” already pushes the boundaries of what is feasible as part of a key generation ceremony.



I can appreciate the desire to use single-level trees in some use cases, but there are other practical use cases where multi-level trees have some very desirable characteristics.  In fact, single-level trees may be completely infeasible.



This is already a concern with some of the implementations we have played with today.  Undoubtably even more use cases will come up in the future.



The flexibility that multi-level trees allow is very important.  We just need to make sure that we provide the appropriate advice to make sure that they are being used in a secure way.



-Tim



From: Spasm <spasm-bounces@ietf.org> On Behalf Of Jim Schaad
Sent: Tuesday, March 26, 2019 4:30 PM
To: 'Dang, Quynh (Fed)' <quynh.dang@nist.gov>; 'Scott Fluhrer (sfluhrer)' <sfluhrer@cisco.com>; 'SPASM' <spasm@ietf.org>
Subject: Re: [lamps] Side-channel attack on multi-level trees and key generation of LMS.







From: Dang, Quynh (Fed) <quynh.dang@nist.gov<mailto:quynh.dang@nist.gov>>
Sent: Tuesday, March 26, 2019 4:21 PM
To: Jim Schaad <ietf@augustcellars.com<mailto:ietf@augustcellars.com>>; 'Scott Fluhrer (sfluhrer)' <sfluhrer@cisco.com<mailto:sfluhrer@cisco.com>>; 'SPASM' <spasm@ietf.org<mailto:spasm@ietf.org>>
Subject: Re: [lamps] Side-channel attack on multi-level trees and key generation of LMS.







________________________________

From: Jim Schaad <ietf@augustcellars.com<mailto:ietf@augustcellars.com>>
Sent: Tuesday, March 26, 2019 11:12 AM
To: Dang, Quynh (Fed); 'Scott Fluhrer (sfluhrer)'; 'SPASM'
Subject: RE: [lamps] Side-channel attack on multi-level trees and key generation of LMS.



There is one other factor to compare in terms of how big the tree is.  For a very large tree, if you do not have the resources to keep the entire private key set (or a large subset of it) then you get into the situation where you regenerate the entire private key tree for each and every signature.



Quynh: You generate a OTS private key whenever you need it from a SEED: this is the same with multi-level tree.

Jim: You also need to generate the path from the leaf to the root.  Since this path changes for every message you sign, you also need to do some regeneration of the path if you don’t keep all (or a large set) of the leaf OTS public keys.

Quynh.



This is part of the trade off between small key size and fast signature generation/usage of time.



Jim





From: Spasm <spasm-bounces@ietf.org<mailto:spasm-bounces@ietf.org>> On Behalf Of Dang, Quynh (Fed)
Sent: Tuesday, March 26, 2019 3:04 PM
To: Scott Fluhrer (sfluhrer) <sfluhrer@cisco.com<mailto:sfluhrer@cisco.com>>; SPASM <spasm@ietf.org<mailto:spasm@ietf.org>>
Subject: Re: [lamps] Side-channel attack on multi-level trees and key generation of LMS.



The only downside of 1 level tree is its key generation time comparing to multi-level trees. In situations ( such as a code signing application) where 1, 2 or 3 etc... hours of a key generation time is not a problem, then using a big 1 level tree seems better than using a multi-level tree.



Therefore,  some bigger height numbers for 1-level tree may be desired.



Quynh.

________________________________

From: Scott Fluhrer (sfluhrer) <sfluhrer@cisco.com<mailto:sfluhrer@cisco.com>>
Sent: Tuesday, March 26, 2019 9:20:05 AM
To: Dang, Quynh (Fed); SPASM
Subject: RE: [lamps] Side-channel attack on multi-level trees and key generation of LMS.



Irom: Spasm <spasm-bounces@ietf.org<mailto:spasm-bounces@ietf.org>> On Behalf Of Dang, Quynh (Fed)
Sent: Tuesday, March 26, 2019 9:11 AM
To: SPASM <spasm@ietf.org<mailto:spasm@ietf.org>>
Subject: [lamps] Side-channel attack on multi-level trees and key generation of LMS.



Hi all,



Here is the attack I mentioned at the meeting today: https://eprint.iacr..org/2018/674/20180713:140821<https://gcc01.safelinks.protection.outlook.com/?url=https%3A%2F%2Feprint.iacr.org%2F2018%2F674%2F20180713%3A140821&data=02%7C01%7Cquynh.dang%40nist.gov%7C8d6a1d790ec0480aafe408d6b1fd9160%7C2ab5d82fd8fa4797a93e054655c61dec%7C1%7C0%7C636892099954210337&sdata=2VcGnAW6UEsdbDbU5wcB5tBSI4gL7H3%2F1xVeXzIW39w%3D&reserved=0>.



This is a fault attack (that is, you try to make the signer miscompute something, and then use the miscomputed signature); a signer implementation could implement protections against this (of course, those protections are not free).



I just looked at the LMS's draft, the single tree with height 25 ( 2^25 signatures)  takes only 1.5 hours.



Clarification on this:

  *   The test used 15 cores (and so it used a total of circa 1 core-day)
  *   This was done with a W=8 parameter set.  This makes the signature shorter (1936 bytes in this case), however it does increase the key generation time; a W=4 parameter set would approximately double the signature size, while decreasing the key generation time by circa a factor of 8.





Regards,

Quynh.