Re: [Curdle] Looking for comments on draft-ietf-curdle-ssh-kex-sha2

Ron Frederick <ronf@timeheart.net> Tue, 18 August 2020 05:42 UTC

Return-Path: <ronf@timeheart.net>
X-Original-To: curdle@ietfa.amsl.com
Delivered-To: curdle@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id CF5073A178C for <curdle@ietfa.amsl.com>; Mon, 17 Aug 2020 22:42:46 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.098
X-Spam-Level:
X-Spam-Status: No, score=-2.098 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, HTML_MESSAGE=0.001, SPF_HELO_NONE=0.001, 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=timeheart.net
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 eNCFN-rg685i for <curdle@ietfa.amsl.com>; Mon, 17 Aug 2020 22:42:44 -0700 (PDT)
Received: from mail-pj1-x102a.google.com (mail-pj1-x102a.google.com [IPv6:2607:f8b0:4864:20::102a]) (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 4AED43A178B for <curdle@ietf.org>; Mon, 17 Aug 2020 22:42:44 -0700 (PDT)
Received: by mail-pj1-x102a.google.com with SMTP id t6so8742367pjr.0 for <curdle@ietf.org>; Mon, 17 Aug 2020 22:42:44 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=timeheart.net; s=mail; h=from:message-id:mime-version:subject:date:in-reply-to:cc:to :references; bh=XWuAsa4mkuO2T8+TZOjKDdvccNoxz5eIERRj3TMUylA=; b=UnGsCK1+ghMHK3RzHFmvnQhbb6mQkMfxqygM6IkUpGbNFFObABwoOxMQRBUo2xZe6l at4xbsCWqpgDO9XvA5GwYq7ZC4KV0aWRghy1aXcP8XecSYwYvl8DuDuEjm4LX6gIEAwx /5IPDlThuqufsEC2PTRQauNltP290nzC9HL0s=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:message-id:mime-version:subject:date :in-reply-to:cc:to:references; bh=XWuAsa4mkuO2T8+TZOjKDdvccNoxz5eIERRj3TMUylA=; b=E2etAdhr5z3zv4zBWztpcz9skaTzvkDRMktS+pdG8n1//239ehhHM7SlTRRElJjun+ o3gGiHrCw5orrlVOsYY0hEE3u3LjdWzqksdnu4+fsj7g6jggaD003Q9au6v+GyNw4C/a gozWjT49WkiKdjLJE4m/eUlLvWgFZ0JUcvPUmpyou89Nu9jWAlkLWuOh8Xx7o3mzzvoI 2Yo8wiyjWSl5UxpyCFSMu0GEtPLlk/TLuffZoZjvojjGquA06HQAGBdiEjKbL6tzv4wY y1F0EDqfb4JK9p6HPFnfw4Iu/B7Q5EXOdqtg/mN8UiSRmw0v/t4u7OZdXS++sGCDGWM1 KWWA==
X-Gm-Message-State: AOAM531xa5eh+zoJuGpNoaFc+D9QEBJqtzOQZMqe6mqRBVjAi8+nhdIC RBC8vo1qmaDPXHCCzuYEcBi8dw==
X-Google-Smtp-Source: ABdhPJwC4alhEEXVLOjsr1CEUkwis+Mnn6LJXRfBmedxHtJtqXJbrWrwchjRoGs9Amu3yV92iGwVWg==
X-Received: by 2002:a17:90b:803:: with SMTP id bk3mr15476155pjb.57.1597729363400; Mon, 17 Aug 2020 22:42:43 -0700 (PDT)
Received: from ?IPv6:2603:3024:18fa:4000:18ef:20ad:6833:584c? ([2603:3024:18fa:4000:18ef:20ad:6833:584c]) by smtp.gmail.com with ESMTPSA id m29sm20138352pgc.55.2020.08.17.22.42.41 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 17 Aug 2020 22:42:42 -0700 (PDT)
From: Ron Frederick <ronf@timeheart.net>
Message-Id: <346A7E8A-0060-471E-A547-055CAB147FC5@timeheart.net>
Content-Type: multipart/alternative; boundary="Apple-Mail=_387632F6-A618-4251-A950-2FA5C4E1715A"
Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.14\))
Date: Mon, 17 Aug 2020 22:42:40 -0700
In-Reply-To: <80066.1597703675@eng-mail01.juniper.net>
Cc: curdle@ietf.org
To: "Mark D. Baushke" <mdb@juniper.net>
References: <25423.1596646626@eng-mail01.juniper.net> <D290968F-2733-40CB-918A-452AD74951B6@timeheart.net> <80066.1597703675@eng-mail01.juniper.net>
X-Mailer: Apple Mail (2.3445.104.14)
Archived-At: <https://mailarchive.ietf.org/arch/msg/curdle/xS3nQxJDdJkkFRlJGR2-TTaT9Zw>
Subject: Re: [Curdle] Looking for comments on draft-ietf-curdle-ssh-kex-sha2
X-BeenThere: curdle@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: "List for discussion of potential new security area wg." <curdle.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/curdle>, <mailto:curdle-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/curdle/>
List-Post: <mailto:curdle@ietf.org>
List-Help: <mailto:curdle-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/curdle>, <mailto:curdle-request@ietf.org?subject=subscribe>
X-List-Received-Date: Tue, 18 Aug 2020 05:42:47 -0000

On Aug 17, 2020, at 3:34 PM, Mark D. Baushke <mdb@juniper.net> wrote:
> Ron Frederick <ronf@timeheart.net> writes:
>> - I noticed you dropped diffie-hellman-group14-sha256 back from MUST
>>  to SHOULD, leaving no algorithms listed as MUST. I’d still like to
>>  see at least one algorithm be listed as MUST, and think this is
>>  probably the safest candidate for that.
> 
> How long is a 2048-bit prime, even with such a large q-ordered subgroup
> likely to remain viable?
> 
> 1024-bits for:
> 
>  a) IFC RSA, 
>  b) FFC DSA, and 
>  c) FFC DH,
>  d) as well as FFC DH group5 (1536-bits)
> 
> are all considered too weak now.
> 
> 3DES with 112-bits of security is being phased out as of January 1, 2024.
> 
> When should we expect to see 2048-bit RSA, which also nominally has only
> 112-bits of security as does 2048-bit DSA become retired?

I’m no expert when it comes to key strength, but I would expect a 2048-bit RSA key to last at least as long as 3DES, since both are considered to have 112 bits of security. The applies to DH keys as well. According to Wikipedia, RSA claimed back in 2003 that 2048-bit keys should be good until 2030, and even now the largest RSA key known to be cracked was a key with 829 bits. So, it seems like we’ve got another 5-10 years probably before we’d have to worry about phasing these keys out.


> To me, it looks like the better bet would be the 3072-bit MODP prime of
> group15, but I do not see it being adopted by most implementations.

As I noted below, I can definitely get behind this as a SHOULD, and perhaps that could position it to become a MUST later when it comes time to retire 2048-bit keys.


> I might suggest Curve25519, as it is pretty fast and has many
> implementations.

I’m definitely a big fan of curve25519/Ed25519, and indeed curve25519-sha256 is the most preferred key exchange algorithm in AsyncSSH right now. However, when it comes to choosing which algorithm to make a MUST, I figured that going with one of the plain DH algorithms might be less of a burden on implementers, as it’s much easier to change the key size than it would be to add ECC support to an implementation that doesn’t yet have it.


> That said, there are many who have been doing research which seems to
> show that ECC is easier to break with Quantum Crypto systems than FFC
> and are NOT interested in implementating ANY ECC algorithms.
> 
> I believe I have seen some text from implementers who have said they
> would NOT adopt ECC for their SSH implementations.

That’s interesting - I hadn’t read that. I was aware of concerns about potential compromises in the nistp curves, but not specifically about Quantum attacks against ECC.


> - I’m also thinking diffie-hellman-group15-sha512 might be a good
>>  candidate for a SHOULD rather than a MAY, but I’m not sure we have
>>  consensus on that.
> 
> Yup, I have not seen any consensus on this issue as yet.
> 
> Perhaps we should opt to make diffie-hellman-group-exchange-sha256 a
> MUST? This allows implementors to put in whatever MODP groups they wish
> as long as q = (p-1)/2 ... so, a maximized q-ordered subgroup... though
> I o worry a bit about the way that the generator g is created perhaps
> not providing that g^q mod p == 1 is a will formed subgroup. When it is
> not a well-formed subgroup, then it will be leaking the first bit of the
> key value.

That’s an interesting thought. Are there “best practices” which could be followed in generating/validating  these values that could avoid such a weakness?

For now, my implementation of the “group-exchange” algorithms has been to only let them select from a table of previously generated groups (basically the same group14-18 values that can be named directly). I haven’t looked into what it would take to construct new MODP groups.


> - I agree with the downgrade of diffie-hellman-group16-sha512 from
>>  SHOULD to MAY.
> 
> Okay.
> 
>> - Regarding possible ECDSA algorithms, I implemented the secp256k1
>>  curve as ecdh-sha21.3.132.0.10 in AsyncSSH after seeing it was
> 
> I think you mean ecdh-sha2-1.3.132.0.10 here?

Whoops, yes. Looks like my cost/paste swallowed the preceding dash.

>>  implemented by Bitvise. I don’t know if it is worth mentioning here
>>  explicitly, but it’s one real-world example of an ecdh-sha2-*
>>  algorithm not explicitly given a name in RFC 5656. The ‘endsa-sha2’
>>  algorithm with this curve is also supported.
> 
> The reserved name is for ecdh-sha2-* ... so ecdh-sha2-secp256k1 or
> ecdh-sha2-1.3.132.0.10 or ecdh-sha2-oid-1.3.132.0.10 would be better...
> depending on what Bitvise uses.

They use ecdh-sha2-1.3.132.0.10 and so do I, following the guidance in RFC 5656 section 6.3 which states:

   This section specifies identifiers encoding named elliptic curve
   domain parameters.  These identifiers are used in this document to
   identify the curve used in the SSH ECC public key format, the ECDSA
   signature blob, and the ECDH method name.

   For the REQUIRED elliptic curves nistp256, nistp384, and nistp521,
   the elliptic curve domain parameter identifiers are the strings
   "nistp256", "nistp384", and "nistp521".

   For all other elliptic curves, including all other NIST curves and
   all other RECOMMENDED curves, the elliptic curve domain parameter
   identifier is the ASCII period-separated decimal representation of
   the Abstract Syntax Notation One (ASN.1) [ASN1] Object Identifier
   (OID) of the named curve domain parameters that are associated with
   the server's ECC host keys.  This identifier is defined provided that
   the concatenation of the public key format identifier and the
   elliptic curve domain parameter identifier (or the method name and
   the elliptic curve domain parameter identifier) does not exceed the
   maximum specified by the SSH protocol architecture [RFC4251], namely
   64 characters; otherwise, the identifier for that curve is undefined,
   and the curve is not supported by this specification.

   A list of the REQUIRED and RECOMMENDED curves and their OIDs can be
   found in Section 10.

   Note that implementations MUST use the string identifiers for the
   three REQUIRED NIST curves, even when an OID exists for that curve.


So, with the exception of the REQUIRED curves, it looks like it would violate the RFC to use names even when they exist (e.g. ecdh-sha2-secp256k1). So, until there is a new SSH-specific RFC which updates RFC 5656, I think only OIDs should be used.


> I think you might as well use the name, the Koblitz curve names are
> present in RFC 4492.
> 
>    b'1.3.132.0.10': (ec.SECP256K1, SHA256),
>    b'1.3.132.0.34': (ec.secp384r1, SHA384),
>    b'1.3.132.0.35': (ec.secp521r1, SHA512),
> 
> For that matter, as long as you are going to use vanity curve for Bitcoin;
> 
> Why not use the RFC 7027 ECC Brainpool curves too?
> 
>    b'1.3.36.3.3.2.8.1.1.7':  (ec.brainpoolP256r1, SHA256),
>    b'1.3.36.3.3.2.8.1.1.11': (ec.brainpoolP384r1, SHA384),
>    b'1.3.36.3.3.2.8.1.1.13': (ec.brainpoolP512r1, SHA512),
> 
> That said, given that they are named in RFC 7027, using their names may
> be better too.
> 
> Does anyone else want me to add either the Koblitz or Brainpool names or
> OIDs to this IETF draft?

My rule on adding new curves (and algorithms in general) is that I want at least one other independent implementation of that support that I can do interoperability testing against before I’ll consider adding something. For now, I’m not aware of any SSH implementations that support any other curves, but if anyone knows of any, I’d love a pointer to them.

As for adding new named curves to this draft, I would recommend you focus only on implementations currently out there and not introduce anything new. I like the fact that this draft focuses on being a catalog of existing algorithms in actual use, and recommendations for which ones should be prioritized. If someone wanted to recommend new curves, I think that should probably be its own separate draft, and it can then decide whether to recommend using the OID format required by RFC 5656 or updating it to introduce additional non-OID algorithm names.
-- 
Ron Frederick
ronf@timeheart.net