Re: [TLS] Dumb thoughts for hardware backed keys for AEAD

Bill Cox <waywardgeek@google.com> Tue, 01 December 2015 05:21 UTC

Return-Path: <waywardgeek@google.com>
X-Original-To: tls@ietfa.amsl.com
Delivered-To: tls@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 68F9A1B38EB for <tls@ietfa.amsl.com>; Mon, 30 Nov 2015 21:21:08 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.388
X-Spam-Level:
X-Spam-Status: No, score=-1.388 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FM_FORGED_GMAIL=0.622, HTML_MESSAGE=0.001, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01] autolearn=no
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 o6m36gXOmURb for <tls@ietfa.amsl.com>; Mon, 30 Nov 2015 21:21:07 -0800 (PST)
Received: from mail-ig0-x230.google.com (mail-ig0-x230.google.com [IPv6:2607:f8b0:4001:c05::230]) (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 3BDD91B38EA for <TLS@ietf.org>; Mon, 30 Nov 2015 21:21:07 -0800 (PST)
Received: by igcto18 with SMTP id to18so88358125igc.0 for <TLS@ietf.org>; Mon, 30 Nov 2015 21:21:06 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=Y4Iz7daIjG8GpNMBew/uTWeb3mfwxnYbQ8JGBJ+sKUw=; b=RqexB4Pgfwg1rXKpUUWQXKc8CUKxzSi1f8tl0ufX8Fc6k1BSzsiNS6wK9KqiKhwBxX tWZz5PYfmkb4hpxB9KeYXZwRsolEAH8SMWmFkUpmO/doEgh/nWpUB/7NHUXYsmvjMz3h QYXBE+aneWtlB7wxrY1BjRWDYjfq6NUhDGuPckL0WAmwlVuWjhMyqc/SJjUHve3uKEfU MqZ+LS0y2zujms6Nsm3EhMpfepmTF+YCbp+qDlxrC54xVShCQ4QmeVYbV/Ws2yNo2Aes zlKAZmP0esYlWtH8aYrSe3Lz1Vot3Zkb62UYwvqZZjLpqKApi7aFeU+jqaIV9O7BdjG0 VosQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=Y4Iz7daIjG8GpNMBew/uTWeb3mfwxnYbQ8JGBJ+sKUw=; b=mD51SaNH4sPzZXEylDiXSxtSpym8JUiXZJenyDf66aLRqq4k9Dnhaz5kbVDaZO+Mqf /N7goq/LErLvB+hFPjeiAXP+gspDVeCHYkuEUG4EssF/8pg9OCX9kAj+svLy2Q+YOsy3 +jLlzjKCaFdTrw9Zj9ke6hr2IAPVb7VjhKJHpCPuvkckxX8NfJRDwHt7bHOMao1irgY9 1LLU8M7X0Mh3L0SdicqfJHSChSZBq4okwmyOjRTVsvxSdpEa5SCWPX+S3qHz5T9pln5t lmnHxjHDofNhJy4uWfJVIQF29/r+zwPaE/I9Ia+yo/DpEX8BLeLcO8+5wr26FvP8hmM7 xjJw==
X-Gm-Message-State: ALoCoQmVdZ7V/ToZl8CBGrCLEV0u6t0wfAKkzdDGcfG7vBIoIQgtyTtrPkp5tq+mF1Ar1sCHJwrV
MIME-Version: 1.0
X-Received: by 10.50.150.106 with SMTP id uh10mr25514451igb.85.1448947266533; Mon, 30 Nov 2015 21:21:06 -0800 (PST)
Received: by 10.107.173.15 with HTTP; Mon, 30 Nov 2015 21:21:06 -0800 (PST)
In-Reply-To: <CABcZeBNewywbuuOC4WncnaWqNPi1_+ojTiCxt6qe7ffXcb8x_A@mail.gmail.com>
References: <CAH9QtQG7738NcAaTHaiaS_zuGhyX3dONp2xkZaB3=JWtaUaz=A@mail.gmail.com> <CABcZeBOAaGvuF7+8y9M0P=Mh5+BWp-UdouEC2Tu1H+v7_kju4Q@mail.gmail.com> <CAH9QtQHx=Rc6Ce5XOcmRDpA+dJgvdQirZfSfQdvJ=9pDbHqGVA@mail.gmail.com> <CABcZeBNewywbuuOC4WncnaWqNPi1_+ojTiCxt6qe7ffXcb8x_A@mail.gmail.com>
Date: Mon, 30 Nov 2015 21:21:06 -0800
Message-ID: <CAH9QtQEi2pMRiZR6fKVZB4yk=3jWEmreN1u8cB0Hvu4Of1NmAA@mail.gmail.com>
From: Bill Cox <waywardgeek@google.com>
To: Eric Rescorla <ekr@rtfm.com>
Content-Type: multipart/alternative; boundary="001a11c3b1da1f14c60525cf537c"
Archived-At: <http://mailarchive.ietf.org/arch/msg/tls/lgRU7yMDKhB97qHWVnIu2yklJRg>
Cc: "tls@ietf.org" <TLS@ietf.org>
Subject: Re: [TLS] Dumb thoughts for hardware backed keys for AEAD
X-BeenThere: tls@ietf.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: "This is the mailing list for the Transport Layer Security working group of the IETF." <tls.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/tls>, <mailto:tls-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/tls/>
List-Post: <mailto:tls@ietf.org>
List-Help: <mailto:tls-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/tls>, <mailto:tls-request@ietf.org?subject=subscribe>
X-List-Received-Date: Tue, 01 Dec 2015 05:21:08 -0000

On Mon, Nov 30, 2015 at 7:53 PM, Eric Rescorla <ekr@rtfm.com> wrote:

> Ah, I see what you mean. Thanks for explaining.
>
> So, if I understand correctly, your threat model is that you want to
> prevent an attacker who obtains the traffic keys from injecting
> new traffic during the plausible lifetime of the connection
> (once close_notify has been exchanged, the traffic keys are
> useless).
>

Yes.


> Whether this is possible or not with a given AEAD transform seems
> to depend on the transform.
>

Agreed.


> FWIW, in the specific case of HMAC,
> because the key \xor pad fills an entire digest block, you might imagine
> storing the state of the outer compression function after the first block
> in the hardware module. I am not aware of any analysis that shows
> that this is safe and it very likely is not as strong as having the
> entire HMAC key in the module, but it might (or might not) be better
> than nothing.
>

I think it would not be hard to prove for HMAC/HKDF that this scheme has
similar defensive properties compared to the usual flow, with reasonable
assumptions about key generation.

However, the extra complexity in every TLS 1.3 implementation bothers me.
I worry that separating the read/write keys may not be worth it.  Did we
gain enough security to warrant the complexity?

Bill