RE: Packet number encryption

Praveen Balasubramanian <pravb@microsoft.com> Sat, 10 February 2018 18:22 UTC

Return-Path: <pravb@microsoft.com>
X-Original-To: quic@ietfa.amsl.com
Delivered-To: quic@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id E478512946D for <quic@ietfa.amsl.com>; Sat, 10 Feb 2018 10:22:46 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.019
X-Spam-Level:
X-Spam-Status: No, score=-2.019 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_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, 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=microsoft.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 MtQsac-v6398 for <quic@ietfa.amsl.com>; Sat, 10 Feb 2018 10:22:44 -0800 (PST)
Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on0093.outbound.protection.outlook.com [104.47.36.93]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id B07E812426E for <quic@ietf.org>; Sat, 10 Feb 2018 10:22:44 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=GP8n7j9ICg6T1B4m9CXCDUhC0D1eAg7LrvZexzR9ejY=; b=OQFPSqPFDnqouOG/jhkwwoSgxKEV7gwLY0e5g36lxRk7+a2+wg8TnQKoT1Oag3M3SGskICvNFch0U+KqlaJel2MeFHwEnc7F0gGPeQagnzhvmmuT5qS2gM2SCfVN0MZgvxZqBObOtLvu3uLyO6hf1V/FsmO3PF+y5NX8sCbJLWg=
Received: from CY4PR21MB0133.namprd21.prod.outlook.com (10.173.189.15) by CY4PR21MB0278.namprd21.prod.outlook.com (10.173.193.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.506.3; Sat, 10 Feb 2018 18:22:42 +0000
Received: from CY4PR21MB0133.namprd21.prod.outlook.com ([fe80::f4bd:bebf:7ea5:7dc5]) by CY4PR21MB0133.namprd21.prod.outlook.com ([fe80::f4bd:bebf:7ea5:7dc5%6]) with mapi id 15.20.0506.011; Sat, 10 Feb 2018 18:22:42 +0000
From: Praveen Balasubramanian <pravb@microsoft.com>
To: "Salz, Rich" <rsalz@akamai.com>
CC: "quic@ietf.org" <quic@ietf.org>
Subject: RE: Packet number encryption
Thread-Topic: Packet number encryption
Thread-Index: AQHTmW31V+0GAWpR/E2VqOCVLx9SYqOMgUQAgABeoYCAAAgUAIAAd3KAgAA8YgCAACPEAIAAAiYAgAOBloCAALfdgIAACBkAgAEGGACAANx9AIAAn5KAgAB7w4CAADUigIAADBeAgADUsaCAAGk3gIAAEEgAgACizACAADhiAIAAHkiAgAADUYCAACdFAIAAVRYAgAAUZQCAAA5oAIAAD4fQgABGjACAAAGHQIAACNQAgAAAqaCAAAeBgIAAC4qAgACi02CAAe6PgIAACzgAgAARh3CAAEwGwIAAjJeAgAA5dnCAAAb3gIAAF6YAgABLbACAAAD8AA==
Date: Sat, 10 Feb 2018 18:22:42 +0000
Message-ID: <CY4PR21MB0133C5FB4961311E4C1523B5B6F10@CY4PR21MB0133.namprd21.prod.outlook.com>
References: <CABkgnnVyo3MmWtVULiV=FJTnR528qfY8-OmKGWAs0bCvri-a_g@mail.gmail.com> <CAGD1bZauKbucs_5n7RQbK8H2HiyfiqpGVEcKreGA6umhMBSFgg@mail.gmail.com> <CABcZeBPNrc-9vANSH02r++p53s6gN4pVB8DMd80nUxOhKTp3dA@mail.gmail.com> <CAKcm_gMvHSBhpUvsQCCkV2_o+d_wchF3R3L6H8mp6nKNaaRmSw@mail.gmail.com> <CY4PR21MB0133CCAA6807469BA983D00BB6FC0@CY4PR21MB0133.namprd21.prod.outlook.com> <CABkgnnW4xr_YzpsvCxaJJgcQdBTuX=Yv735_sdd4VoMfji8mbA@mail.gmail.com> <CY4PR21MB0133C759D4A08A4988B641B2B6FC0@CY4PR21MB0133.namprd21.prod.outlook.com> <bdf88936-8edc-d56e-ee59-c9d597058edd@huitema.net> <CY4PR21MB01337C8A700E58B49D90B712B6FC0@CY4PR21MB0133.namprd21.prod.outlook.com> <119b3276-5799-1cc3-8982-7479171bbf27@huitema.net> <CAOYVs2pi8-NVuS+crNMfjsP-n5upK3=5tPeQ8OSGpOvL6RTrjA@mail.gmail.com> <CY4PR21MB0133A1117B2733BBCF049C5FB6FC0@CY4PR21MB0133.namprd21.prod.outlook.com> <MWHPR08MB24327A7BB5AE1AE70FE5CDB1DAF30@MWHPR08MB2432.namprd08.prod.outlook.com> <533a0a2e-3a87-b55f-84ce-c52bc03cd81c@huitema.net> <MWHPR21MB0144C68102972A668611E1FCB6F20@MWHPR21MB0144.namprd21.prod.outlook.com> <CY4PR21MB01332141C3563ABBA240C566B6F20@CY4PR21MB0133.namprd21.prod.outlook.com> <CABcZeBNeTT79nd+d7h-KFPpFYxpr5wt1KgwPY=M0_UQpCkKq1w@mail.gmail.com> <CY4PR21MB01337A5E81D8A8A1D7518D97B6F20@CY4PR21MB0133.namprd21.prod.outlook.com> <D3800B30-E1F5-4955-8F85-6FEF36AD2E23@akamai.com> <CY4PR21MB0133427E65B3587C7577A454B6F20@CY4PR21MB0133.namprd21.prod.outlook.com> <E002EFE4-5288-45B2-BAF4-D9CE0A9DBCC5@akamai.com>
In-Reply-To: <E002EFE4-5288-45B2-BAF4-D9CE0A9DBCC5@akamai.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-originating-ip: [2001:4898:80e8:5::712]
x-ms-publictraffictype: Email
x-microsoft-exchange-diagnostics: 1; CY4PR21MB0278; 7:ykhC9aUp06AkvPHtfHcLg7q5fG17cs+nl9Ov/J7WVn4HlHzIetVkddIpbihAeuMlL5yItyOJwMFAEw3jM1XnIAUVgRRzdZWj6n3WDFH+jzOpVRJfGiZNgPCP+7537m6kmCC+kJt6vXwMgbEVNE74XylFrcP9Y3rjiHLN647+xx4HumNrbDfm10TRpUN6epDyVyDqVRyO6mUKhX0SYNYQtXnlbmOKS9NVIXOBSsZUiuyvjbahUjoC8OQwzSLLOkvn
x-ms-exchange-antispam-srfa-diagnostics: SSOS;
x-ms-office365-filtering-ht: Tenant
x-ms-office365-filtering-correlation-id: 3e10b9b2-c3c6-4086-5973-08d570b3468e
x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(4534165)(4627221)(201703031133081)(201702281549075)(48565401081)(5600026)(4604075)(3008032)(2017052603307)(7193020); SRVR:CY4PR21MB0278;
x-ms-traffictypediagnostic: CY4PR21MB0278:
x-microsoft-antispam-prvs: <CY4PR21MB02784C70BEAC03CED863F11BB6F10@CY4PR21MB0278.namprd21.prod.outlook.com>
x-exchange-antispam-report-test: UriScan:(28532068793085)(89211679590171)(21748063052155);
x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(61425038)(6040501)(2401047)(5005006)(8121501046)(3002001)(93006095)(93001095)(3231101)(2400082)(944501161)(10201501046)(6055026)(61426038)(61427038)(6041288)(20161123564045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123560045)(6072148)(201708071742011); SRVR:CY4PR21MB0278; BCL:0; PCL:0; RULEID:; SRVR:CY4PR21MB0278;
x-forefront-prvs: 057906460E
x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(366004)(346002)(39860400002)(396003)(39380400002)(376002)(199004)(189003)(25786009)(10290500003)(6116002)(6916009)(790700001)(8990500004)(7736002)(8936002)(4326008)(97736004)(22452003)(2950100002)(5660300001)(86362001)(33656002)(106356001)(7116003)(316002)(186003)(7696005)(2900100001)(478600001)(3280700002)(229853002)(81166006)(6246003)(59450400001)(55016002)(6306002)(99286004)(81156014)(74316002)(5250100002)(76176011)(53936002)(14454004)(3480700004)(8676002)(54896002)(68736007)(93886005)(6506007)(53546011)(9686003)(10090500001)(6346003)(86612001)(3660700001)(2906002)(102836004)(6436002)(105586002); DIR:OUT; SFP:1102; SCL:1; SRVR:CY4PR21MB0278; H:CY4PR21MB0133.namprd21.prod.outlook.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en;
received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts)
authentication-results: spf=none (sender IP is ) smtp.mailfrom=pravb@microsoft.com;
x-microsoft-antispam-message-info: H0T4/zScaMxJ9bbS2ojjuhtSCNMRTJDsQun7yVoLThoTFCWYhgkfLa4M2nrrJ4BfvcX6wRSU4AeVrrJ+fcvc+g==
spamdiagnosticoutput: 1:99
spamdiagnosticmetadata: NSPM
Content-Type: multipart/alternative; boundary="_000_CY4PR21MB0133C5FB4961311E4C1523B5B6F10CY4PR21MB0133namp_"
MIME-Version: 1.0
X-OriginatorOrg: microsoft.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 3e10b9b2-c3c6-4086-5973-08d570b3468e
X-MS-Exchange-CrossTenant-originalarrivaltime: 10 Feb 2018 18:22:42.6265 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47
X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR21MB0278
Archived-At: <https://mailarchive.ietf.org/arch/msg/quic/XUtro-7iPJYn9Ij_YXTjGU11J2M>
X-BeenThere: quic@ietf.org
X-Mailman-Version: 2.1.22
Precedence: list
List-Id: Main mailing list of the IETF QUIC working group <quic.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/quic>, <mailto:quic-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/quic/>
List-Post: <mailto:quic@ietf.org>
List-Help: <mailto:quic-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/quic>, <mailto:quic-request@ietf.org?subject=subscribe>
X-List-Received-Date: Sat, 10 Feb 2018 18:22:47 -0000

>> a packet number *exactly* meets the requirements of an authenticated encrypted nonce. Not using it for that purpose is being wasteful for absolutely no good reason.
For better or worse we have chosen to tie the transport very tightly with TLS. This means extra work will be needed for unencrypted QUIC or QUIC over IPsec for example. Case in point transport parameters not being in the transport header but rather in the TLS header. In HTTPS over TCP, TLS will use its own sequence number for nonce and TCP will have its own sequence number. This is a clear separation of concerns. From what I can tell, since QUIC uses its own packet framing and the PN doesn’t repeat we have tried to optimize this by overloading it with the nonce.

That said nothing prevents an implementation from using the packet number as the nonce. By separating concerns one can pick whatever one wants for the nonce, the receiver doesn’t care about the nonce value other than for decryption i.e. no impact on transport logic. We can use a VLE field or other methods to reduce the extra space needed for the PN.

>> and then encrypting the nonce
You don’t have to but you can . The only functional requirement for the nonce is non-repeatability. Encryption is only being considered for ossification and unlinkability concerns. For connections that don’t care about unlinkability (no migration, no multi path) the overhead is not worth it. Ossification can be avoided by a random initial value and jumps in between since this is a form of greasing.

>> Do you have a non-authenticated crypto mechanism we should consider?
I am not a crypto expert. I don’t know what future crypto will look like. Making the nonce field optional or larger size when needed (but not variable for given connection) allows the transport protocol to be more future proof. Forcing the PN to be the nonce makes things more inflexible. I care much less about the nonce getting ossified compared to the PN.

From: Salz, Rich [mailto:rsalz@akamai.com]
Sent: Friday, February 9, 2018 3:37 PM
To: Praveen Balasubramanian <pravb@microsoft.com>
Cc: quic@ietf.org
Subject: Re: Packet number encryption

> Clear separation of concerns results if we don’t overload the packet number as the nonce. Connection migration and multi-path are optional features and we pay no extra compute cost for most connections that are not impacted by unlnkability. Nonce field becomes optional for crypto that doesn’t need it and can grow to larger size as needed for bulk transfers to prevent frequent key rollovers (say in datacenter scenarios).

David already replied pretty definitively, but for those not on his level …

It seems highly unlikely that we will want to use non-authenticated crypto – ie., AEAD or similar.  TLS 1.3 is all and only authenticated encryption.  The difference in cost is a few extra bytes of encryption, as opposed to bigger packets for plaintext and then encrypting the nonce, right?  That difference should be hard to notice.

If we assume it’s all authenticated crypto, and therefore we need a nonce, then separation of concerns becomes a non-issue. In fact, as David pointed out, a packet number *exactly* meets the requirements of an authenticated encrypted nonce. Not using it for that purpose is being wasteful for absolutely no good reason.

Do you have a non-authenticated crypto mechanism we should consider?