]> CyberLeo.Net >> Repos - FreeBSD/stable/9.git/blob - crypto/openssh/moduli.5
MFH (r237568, r255422, r255460, r255766, r255767, r255774, r255829,
[FreeBSD/stable/9.git] / crypto / openssh / moduli.5
1 .\"     $OpenBSD: moduli.5,v 1.17 2012/09/26 17:34:38 jmc Exp $
2 .\"     $FreeBSD$
3 .\"
4 .\" Copyright (c) 2008 Damien Miller <djm@mindrot.org>
5 .\"
6 .\" Permission to use, copy, modify, and distribute this software for any
7 .\" purpose with or without fee is hereby granted, provided that the above
8 .\" copyright notice and this permission notice appear in all copies.
9 .\"
10 .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11 .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12 .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13 .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14 .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15 .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16 .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 .Dd September 26, 2012
18 .Dt MODULI 5
19 .Os
20 .Sh NAME
21 .Nm moduli
22 .Nd Diffie-Hellman moduli
23 .Sh DESCRIPTION
24 The
25 .Pa /etc/moduli
26 file contains prime numbers and generators for use by
27 .Xr sshd 8
28 in the Diffie-Hellman Group Exchange key exchange method.
29 .Pp
30 New moduli may be generated with
31 .Xr ssh-keygen 1
32 using a two-step process.
33 An initial
34 .Em candidate generation
35 pass, using
36 .Ic ssh-keygen -G ,
37 calculates numbers that are likely to be useful.
38 A second
39 .Em primality testing
40 pass, using
41 .Ic ssh-keygen -T ,
42 provides a high degree of assurance that the numbers are prime and are
43 safe for use in Diffie-Hellman operations by
44 .Xr sshd 8 .
45 This
46 .Nm
47 format is used as the output from each pass.
48 .Pp
49 The file consists of newline-separated records, one per modulus,
50 containing seven space-separated fields.
51 These fields are as follows:
52 .Bl -tag -width Description -offset indent
53 .It timestamp
54 The time that the modulus was last processed as YYYYMMDDHHMMSS.
55 .It type
56 Decimal number specifying the internal structure of the prime modulus.
57 Supported types are:
58 .Pp
59 .Bl -tag -width 0x00 -compact
60 .It 0
61 Unknown, not tested.
62 .It 2
63 "Safe" prime; (p-1)/2 is also prime.
64 .It 4
65 Sophie Germain; 2p+1 is also prime.
66 .El
67 .Pp
68 Moduli candidates initially produced by
69 .Xr ssh-keygen 1
70 are Sophie Germain primes (type 4).
71 Further primality testing with
72 .Xr ssh-keygen 1
73 produces safe prime moduli (type 2) that are ready for use in
74 .Xr sshd 8 .
75 Other types are not used by OpenSSH.
76 .It tests
77 Decimal number indicating the type of primality tests that the number
78 has been subjected to represented as a bitmask of the following values:
79 .Pp
80 .Bl -tag -width 0x00 -compact
81 .It 0x00
82 Not tested.
83 .It 0x01
84 Composite number \(en not prime.
85 .It 0x02
86 Sieve of Eratosthenes.
87 .It 0x04
88 Probabilistic Miller-Rabin primality tests.
89 .El
90 .Pp
91 The
92 .Xr ssh-keygen 1
93 moduli candidate generation uses the Sieve of Eratosthenes (flag 0x02).
94 Subsequent
95 .Xr ssh-keygen 1
96 primality tests are Miller-Rabin tests (flag 0x04).
97 .It trials
98 Decimal number indicating the number of primality trials
99 that have been performed on the modulus.
100 .It size
101 Decimal number indicating the size of the prime in bits.
102 .It generator
103 The recommended generator for use with this modulus (hexadecimal).
104 .It modulus
105 The modulus itself in hexadecimal.
106 .El
107 .Pp
108 When performing Diffie-Hellman Group Exchange,
109 .Xr sshd 8
110 first estimates the size of the modulus required to produce enough
111 Diffie-Hellman output to sufficiently key the selected symmetric cipher.
112 .Xr sshd 8
113 then randomly selects a modulus from
114 .Fa /etc/moduli
115 that best meets the size requirement.
116 .Sh SEE ALSO
117 .Xr ssh-keygen 1 ,
118 .Xr sshd 8
119 .Sh STANDARDS
120 .Rs
121 .%A M. Friedl
122 .%A N. Provos
123 .%A W. Simpson
124 .%D March 2006
125 .%R RFC 4419
126 .%T Diffie-Hellman Group Exchange for the Secure Shell (SSH) Transport Layer Protocol
127 .%D 2006
128 .Re