Initial import from FreeBSD RELENG_4:
[dragonfly.git] / usr.sbin / ntp / doc / ntp.keys.5
1 .\"
2 .\" $FreeBSD: src/usr.sbin/ntp/doc/ntp.keys.5,v 1.1.2.4 2002/12/29 16:35:42 schweikh Exp $
3 .\"
4 .Dd January 13, 2000
5 .Dt NTP.KEYS 5
6 .Os
7 .Sh NAME
8 .Nm ntp.keys
9 .Nd NTP daemon key file format
10 .Sh SYNOPSIS
11 .Nm /etc/ntp.keys
12 .Sh DESCRIPTION
13 Following is a description of the format of NTP key files.
14 For a description of the use of these files, see the
15 .Qq Authentication Support
16 section of the
17 .Xr ntp.conf 5
18 page.
19 .Pp
20 In the case of DES, the keys are 56 bits long with,
21 depending on type, a parity check on each byte.
22 In the case of MD5, the keys are 64 bits (8 bytes).
23 .Xr ntpd 8
24 reads its keys from a file specified using the
25 .Fl k
26 command line option or the
27 .Ic keys
28 statement in the configuration file.
29 While key number 0 is fixed by the NTP standard
30 (as 56 zero bits)
31 and may not be changed,
32 one or more of the keys numbered 1 through 15
33 may be arbitrarily set in the keys file.
34 .Pp
35 The key file uses the same comment conventions
36 as the configuration file.
37 Key entries use a fixed format of the form
38 .Pp
39 .D1 Ar keyno type key
40 .Pp
41 where
42 .Ar keyno
43 is a positive integer,
44 .Ar type
45 is a single character which defines the key format,
46 and
47 .Ar key
48 is the key itself.
49 .Pp
50 The
51 .Ar key
52 may be given in one of four different formats,
53 controlled by the
54 .Ar type
55 character.
56 The four key types, and corresponding formats,
57 are listed following.
58 .Bl -tag -width X
59 .It Li S
60 The key is a 64-bit hexadecimal number in the format
61 specified in the DES specification;
62 that is, the high order seven bits of each octet are used
63 to form the 56-bit key
64 while the low order bit of each octet is given a value
65 such that odd parity is maintained for the octet.
66 Leading zeroes must be specified
67 (i.e., the key must be exactly 16 hex digits long)
68 and odd parity must be maintained.
69 Hence a zero key, in standard format, would be given as
70 .Ql 0101010101010101 .
71 .It Li N
72 The key is a 64-bit hexadecimal number in the format
73 specified in the NTP standard.
74 This is the same as the DES format,
75 except the bits in each octet have been rotated one bit right
76 so that the parity bit is now the high order bit of the octet.
77 Leading zeroes must be specified and odd parity must be maintained.
78 A zero key in NTP format would be specified as
79 .Ql 8080808080808080 .
80 .It Li A
81 The key is a 1-to-8 character ASCII string.
82 A key is formed from this by using the low order 7 bits
83 of each ASCII character in the string,
84 with zeroes added on the right
85 when necessary to form a full width 56-bit key,
86 in the same way that encryption keys are formed from
87 .Ux
88 passwords.
89 .It Li M
90 The key is a 1-to-8 character ASCII string,
91 using the MD5 authentication scheme.
92 Note that both the keys and the authentication schemes (DES or MD5)
93 must be identical between a set of peers sharing the same key number.
94 .El
95 .Pp
96 Note that the keys used by the
97 .Xr ntpq 8
98 and
99 .Xr ntpdc 8
100 programs are checked against passwords
101 requested by the programs and entered by hand,
102 so it is generally appropriate to specify these keys in ASCII format.
103 .Sh FILES
104 .Bl -tag -width /etc/ntp.drift -compact
105 .It Pa /etc/ntp.keys
106 the default name of the configuration file
107 .El
108 .Sh SEE ALSO
109 .Xr ntp.conf 5 ,
110 .Xr ntpd 8 ,
111 .Xr ntpdate 8 ,
112 .Xr ntpdc 8
113 .Sh BUGS
114 .Xr ntpd 8
115 has gotten rather fat.
116 While not huge, it has gotten larger than might
117 be desirable for an elevated-priority daemon running on a workstation,
118 particularly since many of the fancy features which consume the space
119 were designed more with a busy primary server, rather than a high
120 stratum workstation, in mind.