Re: [TLS] I can has SHA-1 hashes for RFC 2409/3526 MODP groups?

Geoffrey Keating <geoffk@geoffk.org> Fri, 28 February 2014 21:22 UTC

Return-Path: <geoffk@geoffk.org>
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 90FF71A01F6 for <tls@ietfa.amsl.com>; Fri, 28 Feb 2014 13:22:57 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -0.003
X-Spam-Level:
X-Spam-Status: No, score=-0.003 tagged_above=-999 required=5 tests=[BAYES_20=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001] autolearn=ham
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 hXlSeq0t_xY0 for <tls@ietfa.amsl.com>; Fri, 28 Feb 2014 13:22:55 -0800 (PST)
Received: from dragaera.releasedominatrix.com (dragaera.releasedominatrix.com [216.129.105.14]) by ietfa.amsl.com (Postfix) with ESMTP id 69D8D1A028A for <tls@ietf.org>; Fri, 28 Feb 2014 13:22:55 -0800 (PST)
Received: by dragaera.releasedominatrix.com (Postfix, from userid 501) id 607CA33D22C; Fri, 28 Feb 2014 21:22:53 +0000 (UTC)
Sender: geoffk@localhost.localdomain
To: Peter Gutmann <pgut001@cs.auckland.ac.nz>
References: <9A043F3CF02CD34C8E74AC1594475C73723848D4@uxcn10-6.UoA.auckland.ac.nz>
From: Geoffrey Keating <geoffk@geoffk.org>
Date: Fri, 28 Feb 2014 13:22:53 -0800
In-Reply-To: <9A043F3CF02CD34C8E74AC1594475C73723848D4@uxcn10-6.UoA.auckland.ac.nz>
Message-ID: <m24n3jylsi.fsf@localhost.localdomain>
Lines: 30
User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.4
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Archived-At: http://mailarchive.ietf.org/arch/msg/tls/1E3oh8lEmQRfvCzvzYrRoHVWI-I
Cc: "ietf-ssh@NetBSD.org" <ietf-ssh@NetBSD.org>, "<tls@ietf.org>" <tls@ietf.org>
Subject: Re: [TLS] I can has SHA-1 hashes for RFC 2409/3526 MODP groups?
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: <http://www.ietf.org/mail-archive/web/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: Fri, 28 Feb 2014 21:22:57 -0000

Peter Gutmann <pgut001@cs.auckland.ac.nz> writes:

> I can has SHA-1 hashes for RFC 2409/3526 MODP groups?
> 
> The MODP groups for DH specified in RFC 2409 and 3526 seem to be widely used
> in things like SSH and SSL/TLS, however unlike the RFC 5114 groups there's no
> subgroup given and so no way to verify that the prime hasn't been corrupted in
> some way (the generator is easy, it's always 2).  OTOH the RFC 5114 groups
> have stupid generators so I don't know why anyone would use them.
> 
> In any case I'd like to have a means of verifying the validity of the data for
> the RFC 2409/3526 primes as stored in memory, but if I generate my own SHA-1
> hashes then there's the risk that I'm verifying flawed data.  Does anyone have
> SHA-1 hash values for the RFC 2409/3526 primes, i.e. the 1024/1536/2048/etc-
> bit values in the two RFCs?  The values I've got are:
> 
> RFC 2409, 1024-bit prime: c0 33 bd 43 51 fb a3 73 25 45 ea 2e 01 6d 52 b0 ...
> RFC 3526, 1536-bit prime: 49 ec ab a9 72 7a 1a f0 63 60 82 c4 67 48 5a 1a ...
> RFC 3526, 2048-bit prime: b9 5c 79 9a a5 dd 38 8c 6d f5 e7 23 98 cb 9d 7d ...
> RFC 3526, 3072-bit prime: 94 1a 04 77 38 fe 55 33 33 69 e2 b3 86 b6 d6 18 ...

I'd encourage you to do the derivation again: compute

2^2048 - 2^1984 - 1 + 2^64 * { [2^1918 pi] + 124476 }

and verify that it's prime.  I don't think any special security
measures were taken during the creation of RFC 3526, you'd think by
now someone would have noticed if the 'primes' weren't prime or didn't
match the claimed polynomial, but if everyone thinks someone else has
checked...