Re: [Cfrg] ECDH subgroup attack question

Andrey Jivsov <crypto@brainhub.org> Tue, 28 January 2020 22:19 UTC

Return-Path: <andrey@brainhub.org>
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 15E7A120018 for <cfrg@ietfa.amsl.com>; Tue, 28 Jan 2020 14:19:03 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.9
X-Spam-Level:
X-Spam-Status: No, score=-1.9 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=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 dLtwIKOq6K3y for <cfrg@ietfa.amsl.com>; Tue, 28 Jan 2020 14:19:01 -0800 (PST)
Received: from mail-qk1-f169.google.com (mail-qk1-f169.google.com [209.85.222.169]) (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 0169F12004D for <cfrg@irtf.org>; Tue, 28 Jan 2020 14:19:00 -0800 (PST)
Received: by mail-qk1-f169.google.com with SMTP id t204so14264640qke.7 for <cfrg@irtf.org>; Tue, 28 Jan 2020 14:19:00 -0800 (PST)
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=7hID410qtQfDEgivisT7ftf1HvHXrRNkLQ6oJRgkxOg=; b=t1BMv/aOQHS0u+gmJFG8RaQk0orai/5NZZAd9qWZH1DyfXgqee8oJO8CFP6CREIP2Y f0/77PspRPumwwqwoJvnTsgQ1yrabdToVJgQl9bJo2xeTu+HifFqO4voqiTi4n2DLiUN +0VgKvQ5lunV+QHrk3xzHlZe46zOEP4oKEz78QE+G7fqa0PgJeZCm3720Nf59Ic93oIU bknLbPziDJItt42QaIkxHXoZPx9Uf32AAr/jCrO4Wwi9b0+duznhr1++1TY9Qs0YeeGU QeVLGXuDXKEZGMevXs2pSaJr/NRfffKqA1Or9KW+zDt2rxCgJ/Gnsapy5E6cISMenfB9 DMjw==
X-Gm-Message-State: APjAAAVgSMblQcnknpCS1RSsZdMcpwBhN5Y4rsoN29L+v2nLS0C4J1AU t+qBRE+8XL0FpHcXyVa2zqZxQ9lpnAWWe0pu/wZqHg==
X-Google-Smtp-Source: APXvYqxoyjP/c0LkAZYFFiiO3bfXv+4B94d/oBEUoecx8HnEdEHwGSMwpxNY24/Hbt1cJr7KBXoQ6Uy1M2D4M27x7rY=
X-Received: by 2002:a37:7b84:: with SMTP id w126mr24464896qkc.280.1580249939906; Tue, 28 Jan 2020 14:18:59 -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: Andrey Jivsov <crypto@brainhub.org>
Date: Tue, 28 Jan 2020 14:18:49 -0800
Message-ID: <CAKUk3bsVjovRkykeEm2gLgSYXv4d3eBCNi-9D8XqGYrk8VQ5LQ@mail.gmail.com>
To: Robert Moskowitz <rgm-sec@htt-consult.com>
Cc: IRTF CFRG <cfrg@irtf.org>
Content-Type: multipart/alternative; boundary="000000000000532d3e059d3a9c44"
Archived-At: <https://mailarchive.ietf.org/arch/msg/cfrg/P7yIn5cHybmODUn5G3jDghUfk7A>
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:19:03 -0000

RFC 2785 sec 3.1 should be read as consisting of two steps that you noted.
When Y = p-1, Y^q = p-1, where q is a large (odd) prime, and thus this
highest allowed value of Y in step 1 will be rejected in step 2.

Therefore, the range check portion is equivalent to TLS 1.3 range check. We
want to reject values Y= {1, -1 = p-1} as invalid public keys. These values
are elements of the small subgroup.

On Tue, Jan 28, 2020 at 1: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.
>
> 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
>