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