Re: [dispatch] Updating DKIM for stronger crypto

Eric Rescorla <ekr@rtfm.com> Mon, 06 February 2017 23:40 UTC

Return-Path: <ekr@rtfm.com>
X-Original-To: dispatch@ietfa.amsl.com
Delivered-To: dispatch@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id A40211296F2 for <dispatch@ietfa.amsl.com>; Mon, 6 Feb 2017 15:40:26 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.599
X-Spam-Level:
X-Spam-Status: No, score=-2.599 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-0.7] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=rtfm-com.20150623.gappssmtp.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 280vZj8Fm9QB for <dispatch@ietfa.amsl.com>; Mon, 6 Feb 2017 15:40:25 -0800 (PST)
Received: from mail-yw0-x234.google.com (mail-yw0-x234.google.com [IPv6:2607:f8b0:4002:c05::234]) (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 0577D1296F0 for <dispatch@ietf.org>; Mon, 6 Feb 2017 15:40:25 -0800 (PST)
Received: by mail-yw0-x234.google.com with SMTP id v200so57771553ywc.3 for <dispatch@ietf.org>; Mon, 06 Feb 2017 15:40:24 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rtfm-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=a7N2wMx8GKb4i6yWIkJhucbDn/MMekub921S95y9B/s=; b=JLoBqLwpYA3H2cZL7EmN2feCQdaCrcGU4qjWoyk4L2ym12R5PiA7spo7s3KkAfPAVH VjZE9cxKwNLkrij8hPGdKY9Oqjcy2QI45kvT8w2LYBqb17wMjPrijZKIbB29ZeFJ6hvD EBKzob8ve0oCWWRZ+/kqK6eg1DAi62oQbw/OPpNYt031LuLNsTkl3ksU/0j+6Vz7Jnak 0bSPc9PgI7sL5ntZtyQTkNRa/PrQH6qc12DZwORHid6PwAJBfw1FxykiH9kCgQD58BWN IOOkeetO9hC7ztCiNsJ1RPt7rPS/YoIPoTkXDaTyjD9Io/JcsGa6+qLCseLRev8DBMMk ZwRw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=a7N2wMx8GKb4i6yWIkJhucbDn/MMekub921S95y9B/s=; b=t0fuBnHl7nXaAsujLINN+2MSxWbQ1JdQlwXxx2ZbibLYauAwVrO3Ey/5G07l1sswZc xqO50UMt5v3chwn2rvhIkbjQ2VJ8iMROq5fpesYgT/d1gGcIRtESfafnMx9aNOL6bSBF BnN5pd744zU0mJ0eqTg8iVUAIISM0sfygaYU2OV1fn/DE1uJDXDmgAn3k8/7rl6sj7nL +avIqsPV2+o1M5NhBbGCd7trEFACpUeRxgkz4DkOs2vUVxjKwv52ghRbs7Dik7rFLFAl GUIR5xMc5hpPbjDJdqbvJ5Q0O0pvLXyC/VvEBxUi4I0qCeTCvPQFEYngP1FnMiztO6UG eiLA==
X-Gm-Message-State: AMke39m1rwhv0pf79FqzoZJlntevimiJwkjDTKhz3/ScQGapFUz3U5+mp33gNUnt9mOrbzIINNhuV+TliogGag==
X-Received: by 10.129.162.151 with SMTP id z145mr8826582ywg.337.1486424424321; Mon, 06 Feb 2017 15:40:24 -0800 (PST)
MIME-Version: 1.0
Received: by 10.13.204.80 with HTTP; Mon, 6 Feb 2017 15:39:43 -0800 (PST)
In-Reply-To: <20170206020826.1108.qmail@ary.lan>
References: <20170206020826.1108.qmail@ary.lan>
From: Eric Rescorla <ekr@rtfm.com>
Date: Mon, 06 Feb 2017 15:39:43 -0800
Message-ID: <CABcZeBMgPZQhvtve85L=nC9X9WxWaRYYMSm98qbV2Fgv71GjAw@mail.gmail.com>
To: John Levine <johnl@taugh.com>
Content-Type: multipart/alternative; boundary="94eb2c11555ecc45a00547e5274b"
Archived-At: <https://mailarchive.ietf.org/arch/msg/dispatch/k8m6k7kSWMl2tPh_X7FxFkQmHwQ>
Cc: DISPATCH <dispatch@ietf.org>
Subject: Re: [dispatch] Updating DKIM for stronger crypto
X-BeenThere: dispatch@ietf.org
X-Mailman-Version: 2.1.17
Precedence: list
List-Id: DISPATCH Working Group Mail List <dispatch.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/dispatch>, <mailto:dispatch-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/dispatch/>
List-Post: <mailto:dispatch@ietf.org>
List-Help: <mailto:dispatch-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/dispatch>, <mailto:dispatch-request@ietf.org?subject=subscribe>
X-List-Received-Date: Mon, 06 Feb 2017 23:40:26 -0000

On Sun, Feb 5, 2017 at 6:08 PM, John Levine <johnl@taugh.com> wrote:
>
> Needless to say, 512 bits is now way too weak, and 1K is iffy, so it
> would be a good idea to update the advice.


Well, I certainly agree that at some point it would be good to get to larger
than 1024-bit RSA keys, we're fairly far from the point where it's cheap
to factor a 1024-bit RSA key (absent a quantum computer, in which case
we've got bigger problems), and given that the impact of a complete break
here is you get to forge mail, I'm not sure how urgent this is.


The obvious change would be a one sentence update to the DMARC spec
> saying to sign with at least 2K keys and verifiers must handle at
> least 4K keys.  The code changes to DKIM signers and verifiers would
> be trivial, and it is my impression that most verifiers handle larger
> keys now, since they just pass them to OpenSSL or the like.
>
> Unfortunately, we have a stupid but significant problem.  DKIM keys
> are published in DNS TXT records, the strings in TXT records are
> limited to 256 characters, and keys longer than 1K bits don't fit
> in 256 characters.  No problem you might think, since the DKIM spec
> says that verifiers catenate multiple strings together, so you just
> break the key into two or three strings.
>
> A lot of people manage their DNS using web based crudware at their
> registrar or DNS provider, and most of the crudware only handles TXT
> records with one string.  You don't have to tell me how broken that
> is, but the cruddy state of DNS provisioning has been a problem for
> many years, and nothing we say is going to fix it in any finite amount
> of time.
>
> I note RFCs 7748 and 8032 which remind us that ed25519 has excellent
> performance with much smaller keys.  So I would like to publish a
> small update to the DKIM spec to add ed25519 as a signature algorithm,
> require that ed25519 signatures use at least 256 bits, and provide
> some advice for migration, e.g., publish both keys in separate TXT
> records and sign with both algorithms for a while.  256-bit keys fit
> in a single TXT string with ease.
>
> Does this seem reasonable?
>

Well, sort of.

It seems like this message suggests that the decision to store the key in
the TXT record is perhaps not the optimal design. If you were storing a
digest (as DANE does) then you could use arbitrary sized RSA keys without
running into the 256-character limit. This would also have the advantage
that if you ever needed to move to some post-quantum algorithm with big
keys (e.g., digest signatures), you would be in a somewhat better position.

With that said, moving to elliptic curve is a good idea and Ed25519 seems
like a reasonable choice. Note that the requirement that "ed25519 signatures
use at least 256 bits" is incoherent. Ed25519 denotes a specific elliptic
curve
of size 255 bits.

-Ekr


>
> R's,
> John
>
>
>
> _______________________________________________
> dispatch mailing list
> dispatch@ietf.org
> https://www.ietf.org/mailman/listinfo/dispatch
>