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