Re: [Lake] Discussion on IoT AEAD limits for AES_128_CCM_8

"Blomqvist, Peter" <Peter.Blomqvist@sony.com> Wed, 18 November 2020 08:29 UTC

Return-Path: <Peter.Blomqvist@sony.com>
X-Original-To: lake@ietfa.amsl.com
Delivered-To: lake@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id EA2A13A1671; Wed, 18 Nov 2020 00:29:11 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.601
X-Spam-Level:
X-Spam-Status: No, score=-1.601 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, PDS_BTC_ID=0.499, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=no autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=sony.com
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 tw0go7hwJI5p; Wed, 18 Nov 2020 00:29:10 -0800 (PST)
Received: from mx07-001d1705.pphosted.com (mx07-001d1705.pphosted.com [185.132.183.11]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 94D993A1670; Wed, 18 Nov 2020 00:29:08 -0800 (PST)
Received: from pps.filterd (m0209329.ppops.net [127.0.0.1]) by mx08-001d1705.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 0AI8NYet031745; Wed, 18 Nov 2020 08:29:06 GMT
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sony.com; h=from : to : subject : date : message-id : references : in-reply-to : content-type : content-transfer-encoding : mime-version; s=S1; bh=eFp8WLb6Q0x0jDC6gb0UeD5Ak3i0EL+WHqpLLld3eiw=; b=gIskjabgWEJTAqjjvpWQO8u8G0agblKxLrPUyE6FrnWeZTdZDQBuFXRFyfhw1H5zIVUn w4Bk/xbjwJd1ezp+OP2F2dMjN2N+G8AhkP600QMPKti+CN/9jZq5+1D4j/8Xx6YLQjf+ oCD8JKjhXYk5Z1UVm7dy7nW4X2PhEafkN1gDAEmbHg7g/BljF4Q+WWjHwG9L159T42/8 eG9gfHhQQBdSRgq0HxMai5msX9EOiupyZ9UWcCnqZIQrcFC2lleV02mWYtRlTilGdXLI MJ7laPiewC0GVpvXNY+kQn90G0Ela8thm0t8h6Ljdl1Mn3roZRCfe477jwbZEO2reQf4 2A==
Received: from eur04-he1-obe.outbound.protection.outlook.com (mail-he1eur04lp2054.outbound.protection.outlook.com [104.47.13.54]) by mx08-001d1705.pphosted.com with ESMTP id 34t5vxjg2t-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 18 Nov 2020 08:29:06 +0000
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bi9HSkokwiTDe1SURZy6tLicm+znFzTbVqArxDjsJfE/vQwboO4wljpty7ktKrMWMR+L87P5dyiYieMQc0hsDdL0BgaBynuQpp8HuW5oY29vrktWr/6V637DkwTSFUA65PRPZl3QraZ8CPQRslgxsVZs3m5zUTeQfyvWXqfSQmA6oa/00vpWkNtd7b7l2EBdYXJXnLYleqiyx7nwHJUyBH38PnOdo0G1Awpgu24gd7dthD3dKff2gFXQsg1+V9gnuVZosMaAbB9y7LwB1ayGISYwtAACo3qLiC5YEnfqeR+MHMf6j+1U9JnZkXgRSw0l5HFfX/46ud3V5Vo6AiaMRA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=eFp8WLb6Q0x0jDC6gb0UeD5Ak3i0EL+WHqpLLld3eiw=; b=NJyTPU1DHug/LQF+1Szq4d9WIRkh9y9BXvkFovEHAfVvMdJIXtI41F1/RFQzgQQNHq1j0kqLa28ssvVTDIF/OE/3CeZauNOrr8qUjBOBv5bd8eg5lqNSbtkRLfpey2qldoiFQBCstceA1kLFGkaT5ZX3ALFvgSEnskVUQc+mgqIfSQ8+ZCVYktlpHF924fWWG4YQ0pBROwFzwuVm/zH7mGVjLboHWuUlCuEStgpz7QeW+e/RrNwUzHaWxLyESkcf9e+nx6JUAcUZ14RqEIAsjB5E+QQOFnHWuOQghyJxWhALY0g7EemJ5TDJepKua8susvj5Ulj/ULJg0X33ZX1b0A==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=sony.com; dmarc=pass action=none header.from=sony.com; dkim=pass header.d=sony.com; arc=none
Received: from AM0P193MB0577.EURP193.PROD.OUTLOOK.COM (2603:10a6:20b:16a::11) by AM8P193MB1010.EURP193.PROD.OUTLOOK.COM (2603:10a6:20b:1e1::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3564.25; Wed, 18 Nov 2020 08:29:03 +0000
Received: from AM0P193MB0577.EURP193.PROD.OUTLOOK.COM ([fe80::b8b8:a597:f3cd:ba2f]) by AM0P193MB0577.EURP193.PROD.OUTLOOK.COM ([fe80::b8b8:a597:f3cd:ba2f%6]) with mapi id 15.20.3589.020; Wed, 18 Nov 2020 08:29:03 +0000
From: "Blomqvist, Peter" <Peter.Blomqvist@sony.com>
To: John Mattsson <john.mattsson=40ericsson.com@dmarc.ietf.org>, Martin Thomson <mt@lowentropy.net>, "lake@ietf.org" <lake@ietf.org>
Thread-Topic: [Lake] Discussion on IoT AEAD limits for AES_128_CCM_8
Thread-Index: AQHWvCuK4+D2UIrsPkK08fN+8+vQDanNEKiAgACDPAD///p04A==
Date: Wed, 18 Nov 2020 08:29:03 +0000
Message-ID: <AM0P193MB05771F4483FB88F8F4557E2B83E10@AM0P193MB0577.EURP193.PROD.OUTLOOK.COM>
References: <0EB305C3-1751-45AA-A240-C6A3135C09CC@ericsson.com> <e7ad2b16-c5b7-467e-9325-d7d9cccc9166@www.fastmail.com> <EB57AF37-7497-4DF7-9535-90C36FDACC43@ericsson.com>
In-Reply-To: <EB57AF37-7497-4DF7-9535-90C36FDACC43@ericsson.com>
Accept-Language: en-GB, en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
authentication-results: dmarc.ietf.org; dkim=none (message not signed) header.d=none;dmarc.ietf.org; dmarc=none action=none header.from=sony.com;
x-originating-ip: [157.68.5.1]
x-ms-publictraffictype: Email
x-ms-office365-filtering-ht: Tenant
x-ms-office365-filtering-correlation-id: cb520de8-5fb9-45d0-ca76-08d88b9c01ae
x-ms-traffictypediagnostic: AM8P193MB1010:
x-microsoft-antispam-prvs: <AM8P193MB1010DBA9823221E9F570A85883E10@AM8P193MB1010.EURP193.PROD.OUTLOOK.COM>
x-ms-oob-tlc-oobclassifiers: OLM:3513;
x-ms-exchange-senderadcheck: 1
x-microsoft-antispam: BCL:0;
x-microsoft-antispam-message-info: rckWU3OCqKTQhcdgXCgD0n085xY+Gr4JQIGLhphtSo6FwoBxyvaDy+ELoy0lJWU/OJjE+Pf7hMQEYAaYHEnqv14mSbpVjvMdmdrME/hS6KSGMyUqG1yvYtpC9J/2EQNdeN49VseKvrFEhRvfm7kiFNm5sQ9MN99RAIYASIv9SHMqsFMmYlME4+IeSWjkWDxh5HYbX51oE5J0+jcOA9rR+2oPNhVGfEhuCviToHq0KBOexalTZ0BHXOXfA1+A1bmPiOWzXVYXOv1vlewl2Vwtjnq1OQhYEdIoLGPM1VhEx8XsgDoDw5gFzMpaXsDPd0/F5Uy8PtHyGfv4XvfTxHVZDt5/v0Dwdkm4JyoEpxUMY4LpseSqDXJO3XM6hFxjo7JfPxhBbhRvweiFNX+8P2Ry5g==
x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM0P193MB0577.EURP193.PROD.OUTLOOK.COM; PTR:; CAT:NONE; SFS:(4636009)(366004)(136003)(376002)(346002)(39850400004)(396003)(186003)(26005)(86362001)(71200400001)(9686003)(478600001)(83380400001)(55016002)(5660300002)(33656002)(2906002)(52536014)(110136005)(53546011)(76116006)(316002)(6506007)(66476007)(66946007)(66446008)(66556008)(64756008)(966005)(8676002)(7696005)(8936002)(19627235002); DIR:OUT; SFP:1102;
x-ms-exchange-antispam-messagedata: 41Ji6hpUZyJScKEPbedVdWH1VbxQrvs5rf7kZNlx9uP//eRXutxcvwCIa7gCq1b0gl0vW6896U5IiPx346p7ppRuYTLttQdd4Mg/qjWA6Ag9FqttFzuCG03lIj5/qTg8EZZ2WXh0Ol6C2kKQHUZVRc1X0jyHLojzzum1iicri48oR50ORqAomXfjujFm7pUlob57PPPWnVnuGsJWvulaiR7Oi9v6PB3ZyVi5jUBOYKmViGG07p58ky/JfcDwpuPh6CVq6SG4jhF5kznOiPvvNcgkdvAPp2F02q1nhyo0a85s7lQBsD/RB/B1GfV3VaNx46BE+Eu5ogEwQQjaKEFA3DhFGcMXMUCPJED9eomLH1AcCjikV4r34Lairqda9PSPukI/TX6Dk7w38S8zhX7SFdijATANPvTiAY6dBElsDa2F1+9wums2PXKEja7ITvIvVxOCCCvEWVTjQFa2PUeciPQ7Y3ZY8x89ci3xMHlJB/3LwvGZHBhf8GeS5FHoeC3O/ylrcJPn7M9mFY3Whj/0hgUa3kS71EzN4zGMi3AZtVK9cXcgaSsKut3bPRHExLNIAtNFKGMwe8S6+caYRwX/20FK4chYquzPVEZgKNCPUssE9vWeWGUMBieQIckhNQZ3a3pjUV20OpUDard0GtTUCA==
x-ms-exchange-transport-forked: True
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
MIME-Version: 1.0
X-OriginatorOrg: sony.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: AM0P193MB0577.EURP193.PROD.OUTLOOK.COM
X-MS-Exchange-CrossTenant-Network-Message-Id: cb520de8-5fb9-45d0-ca76-08d88b9c01ae
X-MS-Exchange-CrossTenant-originalarrivaltime: 18 Nov 2020 08:29:03.1151 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 66c65d8a-9158-4521-a2d8-664963db48e4
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: hKe4OLmSCTG5HEf849ns+I5SlLMkVcitLt/6Z6kx9sZfgrDL4Aa15SgDC9cNbGyjh3GnB7t71RE6i4q8EkhK8OVC3xPG9RTpPAmDAXH49Zc=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM8P193MB1010
X-Sony-Outbound-GUID: u7GhwyaoERGQz_Ep3K1laZsSDAUVDu-o
X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.312, 18.0.737 definitions=2020-11-18_04:2020-11-17, 2020-11-18 signatures=0
X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 priorityscore=1501 suspectscore=0 mlxlogscore=999 mlxscore=0 phishscore=0 lowpriorityscore=0 malwarescore=0 adultscore=0 spamscore=0 clxscore=1011 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2011180056
Archived-At: <https://mailarchive.ietf.org/arch/msg/lake/A9480BMzvWR5CPph5RMePmX3U18>
Subject: Re: [Lake] Discussion on IoT AEAD limits for AES_128_CCM_8
X-BeenThere: lake@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: Lightweight Authenticated Key Exchange <lake.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/lake>, <mailto:lake-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/lake/>
List-Post: <mailto:lake@ietf.org>
List-Help: <mailto:lake-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/lake>, <mailto:lake-request@ietf.org?subject=subscribe>
X-List-Received-Date: Wed, 18 Nov 2020 08:29:12 -0000

Thanks Martin, John and Tero.

The TLS bounds on p seems very strict compared to the TAG length of AES_128_CCM_8.
With SHAKE-128 in mind an AEAD allowing more flexible tag lengths would be nice.
Until then tuning the re-keying frequency as suggested by John looks like a usable approach.

Best
Peter
 

-----Original Message-----
From: Lake <lake-bounces@ietf.org> On Behalf Of John Mattsson
Sent: den 18 november 2020 08:38
To: Martin Thomson <mt@lowentropy.net>; lake@ietf.org
Subject: Re: [Lake] Discussion on IoT AEAD limits for AES_128_CCM_8

Thanks Martin,

It is very good that you point out that it is always true that 

v <= p * 2^64

That simplifies analysis. I think most constrained IoT systems could live with slightly higher bounds on p. 

But I do not see why even 128 would be unacceptable. It is only a denial-of-service problem if the endpoint becomes unavailable or have to do a heavy key exchange/handshake.

When the counter of failed decryptions reaches v, the endpoint does not necessarily need to stop processing incoming messages, the important thing is that any successful forgeries are not forwarded to the higher layers and acted upon in any way. When the counter of failed decryption reaches v the endpoint can wait for a valid ciphertext, throw away the plaintext, and send an error message indicating that the other endpoint need to re-key. Re-keying can be done almost for free. So even with v = 128, an adversary would have to send 128 messages to force the endpoints to send 1 message each. 

Cheers,
John

-----Original Message-----
From: Lake <lake-bounces@ietf.org> on behalf of Martin Thomson <mt@lowentropy.net>
Date: Wednesday, 18 November 2020 at 01:48
To: "lake@ietf.org" <lake@ietf.org>
Subject: Re: [Lake] Discussion on IoT AEAD limits for AES_128_CCM_8

You might find this tool useful in evaluating this:

https://urldefense.proofpoint.com/v2/url?u=https-3A__protect2.fireeye.com_v1_url-3Fk-3D3eb60f28-2D612d37fa-2D3eb64fb3-2D866132fe445e-2D96ffc5c77ab20edd-26q-3D1-26e-3Db4763ea2-2D5ec7-2D4458-2Daa23-2D03e11fd005d5-26u-3Dhttps-253A-252F-252Fchris-2Dwood.github.io-252Finteractive-2Daead-2Dlimits-252F&d=DwIGaQ&c=fP4tf--1dS0biCFlB0saz0I0kjO5v7-GLPtvShAo4cc&r=ReOhyTHbHxF59rwa6NKLJmWnWtc32YE99Fj4rlHBZBM&m=A46AlixXRGEsUOZM85WuosdFcqMfKlPeK2LkNNz7N8c&s=BnsLLG77-rL_R-U01zyo2Kz2WC77eHWdcqOO2RUFoYw&e= 

Note that with the value of p that TLS uses (2^-57), this cipher performs very badly.  The number of forgery attempts you can tolerate is 128.  That's not 2^128, it's 128.  I don't think that is acceptable.  You might be able to increase your tolerance for attack (p) to get something more realistic.

On Tue, Nov 17, 2020, at 02:17, John Mattsson wrote:
> Hi,
> 
> As discussed during the meeting today, CFRG is working on an excellent 
> document specifying equations to calculate AEAD limits for the number 
> of encryption operations q and the number of forgery attempts v. TLS, 
> DTLS, and QUIC have adopted strict limits based on these equations.
> Having strict limits is not a problem if re-keying is easy.
> 
> https://urldefense.proofpoint.com/v2/url?u=https-3A__tools.ietf.org_ht
> ml_draft-2Dirtf-2Dcfrg-2Daead-2Dlimits&d=DwIGaQ&c=fP4tf--1dS0biCFlB0sa
> z0I0kjO5v7-GLPtvShAo4cc&r=ReOhyTHbHxF59rwa6NKLJmWnWtc32YE99Fj4rlHBZBM&
> m=A46AlixXRGEsUOZM85WuosdFcqMfKlPeK2LkNNz7N8c&s=OGFcV0z2XzTGaOjBgLdcEG
> h4pWz05Vi7K6AB2Sa4nkI&e=
> 
> Most constrained IoT systems today use some variant of AES-128 in CCM 
> mode with a 32- or 64-bit tag. IETF use of AES-128 in CCM mode 
> typically only use 64-bit tags.
> 
> The important equations for AEAD_AES_128_CCM_8 (AES-CCM-16-64-128,
> AES-CCM-64-64-128) are:
> 
> Confidentiality Limit:
> q <= sqrt((p * 2^126) / l^2)
> 
> Integrity Limit:
> v * 2^64 + (2l * (v + q))^2 <= p * 2^128
> 
> where:
> 
> q = Number of protected messages (AEAD encryption invocations)
> v = Number of attacker forgery attempts (failed AEAD decryption invocations)    
> p = Adversary attack probability
> l = input length (plaintext + additional data) in blocks
> 
> For AEAD_AES_128_CCM_8 the integrity limit is the most limiting. DTLS
> 1.3 sets the limits for CCM to q = 2^23 and v = 2^23.5 and states that
> AES_128_CCM_8 MUST NOT used in DTLS without additional safeguards 
> against forgery. This unfortunately severely limits the use case for 
> DTLS 1.3 in very constrained IoT.
> 
> The assumptions used DTLS 1.3 (still a draft) are:
> 
> p = 2^-57
> l = 2^10 (2^14 bytes)
> 
> It should be discussed which assumptions are relevant for IoT systems. 
> It was suggested during the meeting today that this discussion should 
> be held in a IoT focused security area WG like LAKE. There are a large 
> number of aspects that affect how the limits v and q should be assigned:
> 
> - The probability p can be set to basically any value, it decides the 
> security level. Some IoT systems might accept a higher forgery 
> probability that (D)TLS in general.
> 
> - To optimize the forgery probablity the attacker cannot send a chosen 
> message, the attacker has to settle for something that looks like a 
> random string. For use cases where the payload has a certain format, 
> this means that succesfull forgeries will likely be discarded on a 
> higher level in the stack.
> 
> - The forgery probability is for a single forgery. In some systems a 
> single forgery may not matter much and several forgeries might be 
> needed to do any harm.
> 
> - The input lengths are typically much much smaller for most 
> constrained IoT systems than the 16 KB packets assumed in the (D)TLS 
> calculations.
> 
> - If the attacker uses a high speed broadband connection, a lot of 
> forgeries can be sent quickly. On most constained IoT systems, the 
> bandwith is very limited and it would take takes a long time to send 
> forged message.
> 
> - Any denial-of-service resulting from low limits on v should be 
> compared to other denial-of-service attacks on the system. If there 
> are even easier ways to reduce the availability of a system, a low 
> limit on v does not matter.
> 
> Looking forward to hear the IETF IoT communities comments on the above.
> 
> Cheers,
> John
> 
> --
> Lake mailing list
> Lake@ietf.org
> https://urldefense.proofpoint.com/v2/url?u=https-3A__www.ietf.org_mail
> man_listinfo_lake&d=DwIGaQ&c=fP4tf--1dS0biCFlB0saz0I0kjO5v7-GLPtvShAo4
> cc&r=ReOhyTHbHxF59rwa6NKLJmWnWtc32YE99Fj4rlHBZBM&m=A46AlixXRGEsUOZM85W
> uosdFcqMfKlPeK2LkNNz7N8c&s=K3y4u6XppyQptH-3iBBNp1SntQRbeoK7evd7EE3J7Vw
> &e=
>

--
Lake mailing list
Lake@ietf.org
https://urldefense.proofpoint.com/v2/url?u=https-3A__www.ietf.org_mailman_listinfo_lake&d=DwIGaQ&c=fP4tf--1dS0biCFlB0saz0I0kjO5v7-GLPtvShAo4cc&r=ReOhyTHbHxF59rwa6NKLJmWnWtc32YE99Fj4rlHBZBM&m=A46AlixXRGEsUOZM85WuosdFcqMfKlPeK2LkNNz7N8c&s=K3y4u6XppyQptH-3iBBNp1SntQRbeoK7evd7EE3J7Vw&e= 

--
Lake mailing list
Lake@ietf.org
https://urldefense.proofpoint.com/v2/url?u=https-3A__www.ietf.org_mailman_listinfo_lake&d=DwIGaQ&c=fP4tf--1dS0biCFlB0saz0I0kjO5v7-GLPtvShAo4cc&r=ReOhyTHbHxF59rwa6NKLJmWnWtc32YE99Fj4rlHBZBM&m=A46AlixXRGEsUOZM85WuosdFcqMfKlPeK2LkNNz7N8c&s=K3y4u6XppyQptH-3iBBNp1SntQRbeoK7evd7EE3J7Vw&e=