Re: [quicwg/base-drafts] Consider simplifying Packet Number Encryption (#1575)

David Schinazi <notifications@github.com> Mon, 24 September 2018 22:19 UTC

Return-Path: <bounces+848413-a050-quic-issues=ietf.org@sgmail.github.com>
X-Original-To: quic-issues@ietfa.amsl.com
Delivered-To: quic-issues@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 73DB0131127 for <quic-issues@ietfa.amsl.com>; Mon, 24 Sep 2018 15:19:57 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -3.01
X-Spam-Level:
X-Spam-Status: No, score=-3.01 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, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001, T_DKIMWL_WL_HIGH=-0.01] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=github.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 tyCaz5pDcKi5 for <quic-issues@ietfa.amsl.com>; Mon, 24 Sep 2018 15:19:55 -0700 (PDT)
Received: from o7.sgmail.github.com (o7.sgmail.github.com [167.89.101.198]) (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 7DCC1130E60 for <quic-issues@ietf.org>; Mon, 24 Sep 2018 15:19:55 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=github.com; h=from:reply-to:to:cc:in-reply-to:references:subject:mime-version:content-type:content-transfer-encoding:list-id:list-archive:list-post:list-unsubscribe; s=s20150108; bh=2IzGHj+0Yn7E2YPZSYfOl1Z0K7w=; b=P2STLmv5oSXG/Siv yLyrBoHeuUA0Yh6a7kFEfi+nLcPZa+aenKnzymehfDe4tsIxNliNCgF9KOve+wzc TKQB9VAvU6G1KO8QwgSTzHjQsf+PGg7A6+90ToXj5vB7LZy83kQ/giR5YdD9L9sU VI5XSJ1UF3bHdnMSwdwke9HW+Yk=
Received: by filter0011p1iad2.sendgrid.net with SMTP id filter0011p1iad2-14159-5BA9630A-A 2018-09-24 22:19:54.077519446 +0000 UTC m=+1555045.533141739
Received: from github-lowworker-e8fa9ff.cp1-iad.github.net (unknown [192.30.252.43]) by ismtpd0001p1iad2.sendgrid.net (SG) with ESMTP id twM3hUUpQgmlN7Wpz2Gtsw for <quic-issues@ietf.org>; Mon, 24 Sep 2018 22:19:53.819 +0000 (UTC)
Received: from github.com (localhost [127.0.0.1]) by github-lowworker-e8fa9ff.cp1-iad.github.net (Postfix) with ESMTP id 05C53420318 for <quic-issues@ietf.org>; Mon, 24 Sep 2018 15:19:54 -0700 (PDT)
Date: Mon, 24 Sep 2018 22:19:54 +0000
From: David Schinazi <notifications@github.com>
Reply-To: quicwg/base-drafts <reply+0166e4abd586da0335a44c1883d7524a7b998c4d62b96f4e92cf0000000117c1250992a169ce14620d9d@reply.github.com>
To: quicwg/base-drafts <base-drafts@noreply.github.com>
Cc: Subscribed <subscribed@noreply.github.com>
Message-ID: <quicwg/base-drafts/issues/1575/424144509@github.com>
In-Reply-To: <quicwg/base-drafts/issues/1575@github.com>
References: <quicwg/base-drafts/issues/1575@github.com>
Subject: Re: [quicwg/base-drafts] Consider simplifying Packet Number Encryption (#1575)
Mime-Version: 1.0
Content-Type: multipart/alternative; boundary="--==_mimepart_5ba9630a1396_54c93ff95fed45c02262a9"; charset="UTF-8"
Content-Transfer-Encoding: 7bit
Precedence: list
X-GitHub-Sender: DavidSchinazi
X-GitHub-Recipient: quic-issues
X-GitHub-Reason: subscribed
X-Auto-Response-Suppress: All
X-GitHub-Recipient-Address: quic-issues@ietf.org
X-SG-EID: l64QuQ2uJCcEyUykJbxN122A6QRmEpucztpreh3Pak0HhRYwsaykQP7xqTMJhLO+qzO/dGDZCxxxnm y3yrzIhApo4KRPgZSYWDszFoze6rI2F2qnEhADN9o4an5NditVMDOjNEHG9El+bFyuZIzPkXRi5DPv TfG6H+JLbDb3Ds+3OXn369IwdDtsI73pVlfRJtJ2peQwXmfQW6+MEnsiwqqCraEMpnL5PTMCGUqZlM Y=
Archived-At: <https://mailarchive.ietf.org/arch/msg/quic-issues/wkmPcjGBqDjdFWeVXjaxk_OUGeI>
X-BeenThere: quic-issues@ietf.org
X-Mailman-Version: 2.1.29
List-Id: Notification list for GitHub issues related to the QUIC WG <quic-issues.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/quic-issues>, <mailto:quic-issues-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/quic-issues/>
List-Post: <mailto:quic-issues@ietf.org>
List-Help: <mailto:quic-issues-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/quic-issues>, <mailto:quic-issues-request@ietf.org?subject=subscribe>
X-List-Received-Date: Mon, 24 Sep 2018 22:19:58 -0000

I had a conversation with @ekr about this yesterday, and I'm wondering if the following proposal might get us the best of both worlds:
1) Require that QUIC packets MUST verify `length(packet number) + length(payload) >= 4`, by padding the payload if needed.
2) Always have PNE encrypt 4 bytes from the start of the packet number, and use the following 16 bytes as nonce.

In practice the padding overhead here is very low as it only impacts a small number of frame types when sent without an ACK frame. (Worse case scenario is a lonely PING frame with packet number below 63, and that case suffers 2 bytes of padding out of a 20+8+1+1+1=31 byte IPv4 packet)

It also has the nice property of obfuscating the packet-number length, as an observer can no longer tell when the packet number is below 63.

In terms of implementation, this is simplest for decryption, and the padding can be added right before encrypting the payload as that code needs to have access to the packet number as nonce anyway.

What are people's thoughts on this?

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/quicwg/base-drafts/issues/1575#issuecomment-424144509