Re: [Cfrg] ECDH subgroup attack question

Richard Barnes <rlb@ipv.sx> Tue, 28 January 2020 22:20 UTC

Return-Path: <rlb@ipv.sx>
X-Original-To: cfrg@ietfa.amsl.com
Delivered-To: cfrg@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id C3BBD1200EF for <cfrg@ietfa.amsl.com>; Tue, 28 Jan 2020 14:20:39 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.897
X-Spam-Level:
X-Spam-Status: No, score=-1.897 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_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=ipv-sx.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 1cL20l0_Iqip for <cfrg@ietfa.amsl.com>; Tue, 28 Jan 2020 14:20:37 -0800 (PST)
Received: from mail-qk1-x731.google.com (mail-qk1-x731.google.com [IPv6:2607:f8b0:4864:20::731]) (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 92A6D12004D for <cfrg@irtf.org>; Tue, 28 Jan 2020 14:20:37 -0800 (PST)
Received: by mail-qk1-x731.google.com with SMTP id q15so8657147qki.2 for <cfrg@irtf.org>; Tue, 28 Jan 2020 14:20:37 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipv-sx.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=yevc0hsZCblsPAdKQHaqCmFquLo3mKmpttWaLc7+A18=; b=lASvGTu8umriHwPvDs40Lb9/+6z0aOpYKFY0F69gjE8CNa+iDu91+DWdTe3GrwUpGS vCouKOJG7PP1So/AMRwCYTU5S5oomCi5b0uTrlF5vvvR7pZbAxMyw4x++XI4sJUgAMKA clfadkH0T1oaksDi/uOYuIN0UUzbAUK1RgI4v6QwQt1o/f4owpC6GL/YNEnOzvLRwV78 XwIytzUaAx9R+m2CTQUqd6V9W6ltN3JpZ6rcuQUdvAmRy7wLqGa9uGG7STMbyV2I64eK md7q8yys0F/UYjOUsDD15Vj+lonzsTV3zWwNNH4v1Ep84ditngBehUZrktzKj7P8a8pK F0Gw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=yevc0hsZCblsPAdKQHaqCmFquLo3mKmpttWaLc7+A18=; b=PDbhr+ENg4M6XogL2XB9Nhh5bhfFMIbRWJpsQh9eXBI+JlvIXUS8Eq3MktzveVlcXP zP1ntehjZUaZ+hkQM/N1wQ9whlOUZQSYyknqY+VDj7z4NTHo3oLBtbLI5WNWqfjvZ67k GFWKuI9T0Vaym8EK7XYqaguMqH8fmujDIjDL95/pzL0bs/RHWC9viRUcHaBI5QpO/pxi cNp5G9ha33IebLjIkBaDadKH0hXBtFN7dKh2qbWm/7CoLOJ/S84VHS1ilcSzvqf4EHW5 LinrK6qbLHghWVZ4Y0XlPi5RZ8/L04KnfTABSJRUbvXoXTEpTm0d6pL/XZX0skmpEhW7 yuww==
X-Gm-Message-State: APjAAAV62+GeYabBhE0sHw0b80g9ZqmYObT4/Vt8009G+UQCHBWremIG jovdb+dxoVeQEITzZUaqZ8Zbh1olbCjTGx8t40zKpA==
X-Google-Smtp-Source: APXvYqz6omCTp0mbPRkePPi5RRhnCKqZAlRuRLLMOJVR+Uqw5UGeiLEDb9zOj6//epuIjJ4ICHTXDy3fJrAktWVL764=
X-Received: by 2002:a37:e308:: with SMTP id y8mr24782644qki.347.1580250036423; Tue, 28 Jan 2020 14:20:36 -0800 (PST)
MIME-Version: 1.0
References: <93a5af6f-e40b-a3aa-ef1e-17ac1feb9ace@htt-consult.com>
In-Reply-To: <93a5af6f-e40b-a3aa-ef1e-17ac1feb9ace@htt-consult.com>
From: Richard Barnes <rlb@ipv.sx>
Date: Tue, 28 Jan 2020 17:20:12 -0500
Message-ID: <CAL02cgRkbcrcgvNzueqQeGEFxMX_pO=JuEuys5txZYqcff3kxw@mail.gmail.com>
To: Robert Moskowitz <rgm-sec@htt-consult.com>
Cc: IRTF CFRG <cfrg@irtf.org>
Content-Type: multipart/alternative; boundary="00000000000013ddf1059d3aa224"
Archived-At: <https://mailarchive.ietf.org/arch/msg/cfrg/R_SvdsGDHuYd5qqx3cU-DE3WywM>
Subject: Re: [Cfrg] ECDH subgroup attack question
X-BeenThere: cfrg@irtf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: Crypto Forum Research Group <cfrg.irtf.org>
List-Unsubscribe: <https://www.irtf.org/mailman/options/cfrg>, <mailto:cfrg-request@irtf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/cfrg/>
List-Post: <mailto:cfrg@irtf.org>
List-Help: <mailto:cfrg-request@irtf.org?subject=help>
List-Subscribe: <https://www.irtf.org/mailman/listinfo/cfrg>, <mailto:cfrg-request@irtf.org?subject=subscribe>
X-List-Received-Date: Tue, 28 Jan 2020 22:20:40 -0000

On Tue, Jan 28, 2020 at 4:46 PM Robert Moskowitz <rgm-sec@htt-consult.com>
wrote:

> In TLS 1.3, RFC 8446 sec 4.2.8.1 the testing range for Y is:
>
> 1 < Y < p-1
>
> In RFC 2785 sec 3.1, that references 2631, the range for Y is:
>
> "within the interval [2, p-1]"
>
> TLS 1.3 is more liberal, it seems to me, than 2785.
>

No, TLS 1.3 is more conservative, since it rules out p-1 (i.e., it allows
[2, p-2]).  This is more safe because p-1 generates the subgroup of order
two {p-1, 1}.

--Richard


>
> What is 'right' / 'safe'.
>
> Further 2785 has a second check:
>
> Compute y^q mod p. If the result == 1, the key is valid.
>
> Is this test still advised?
>
> thank you
>
>
>
> _______________________________________________
> Cfrg mailing list
> Cfrg@irtf.org
> https://www.irtf.org/mailman/listinfo/cfrg
>