Debian Codegraph @

rfc2539.html

raw
1 <pre>Network Working Group D. Eastlake
2 Request for Comments: 2539 IBM
3 Category: Standards Track March 1999
4
5
6 <span class="h1">Storage of Diffie-Hellman Keys in the Domain Name System (DNS)</span>
7
8 Status of this Memo
9
10 This document specifies an Internet standards track protocol for the
11 Internet community, and requests discussion and suggestions for
12 improvements. Please refer to the current edition of the "Internet
13 Official Protocol Standards" (STD 1) for the standardization state
14 and status of this protocol. Distribution of this memo is unlimited.
15
16 Copyright Notice
17
18 Copyright (C) The Internet Society (1999). All Rights Reserved.
19
20 Abstract
21
22 A standard method for storing Diffie-Hellman keys in the Domain Name
23 System is described which utilizes DNS KEY resource records.
24
25 Acknowledgements
26
27 Part of the format for Diffie-Hellman keys and the description
28 thereof was taken from a work in progress by:
29
30 Ashar Aziz &lt;[email protected]&gt;
31 Tom Markson &lt;[email protected]&gt;
32 Hemma Prafullchandra &lt;[email protected]&gt;
33
34 In addition, the following person provided useful comments that have
35 been incorporated:
36
37 Ran Atkinson &lt;[email protected]&gt;
38 Thomas Narten &lt;[email protected]&gt;
39
40
41
42
43
44
45
46
47
48
49
50
51
52 <span class="grey">Eastlake Standards Track [Page 1]</span></pre>
53 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-2" ></span>
54 <span class="grey"><a href="./rfc2539">RFC 2539</a> Diffie-Hellman Keys in the DNS March 1999</span>
55
56
57 Table of Contents
58
59 Abstract...................................................<a href="#page-1">1</a>
60 Acknowledgements...........................................<a href="#page-1">1</a>
61 <a href="#section-1">1</a>. Introduction............................................<a href="#page-2">2</a>
62 <a href="#section-1.1">1.1</a> About This Document....................................<a href="#page-2">2</a>
63 <a href="#section-1.2">1.2</a> About Diffie-Hellman...................................<a href="#page-2">2</a>
64 <a href="#section-2">2</a>. Diffie-Hellman KEY Resource Records.....................<a href="#page-3">3</a>
65 <a href="#section-3">3</a>. Performance Considerations..............................<a href="#page-4">4</a>
66 <a href="#section-4">4</a>. IANA Considerations.....................................<a href="#page-4">4</a>
67 <a href="#section-5">5</a>. Security Considerations.................................<a href="#page-4">4</a>
68 References.................................................<a href="#page-5">5</a>
69 Author's Address...........................................<a href="#page-5">5</a>
70 <a href="#appendix-A">Appendix A</a>: Well known prime/generator pairs...............<a href="#page-6">6</a>
71 <a href="#appendix-A.1">A.1</a>. Well-Known Group 1: A 768 bit prime..................<a href="#page-6">6</a>
72 <a href="#appendix-A.2">A.2</a>. Well-Known Group 2: A 1024 bit prime.................<a href="#page-6">6</a>
73 Full Copyright Notice......................................<a href="#page-7">7</a>
74
75 <span class="h2"><a class="selflink" id="section-1" href="#section-1">1</a>. Introduction</span>
76
77 The Domain Name System (DNS) is the current global hierarchical
78 replicated distributed database system for Internet addressing, mail
79 proxy, and similar information. The DNS has been extended to include
80 digital signatures and cryptographic keys as described in [<a href="./rfc2535">RFC 2535</a>].
81 Thus the DNS can now be used for secure key distribution.
82
83 <span class="h3"><a class="selflink" id="section-1.1" href="#section-1.1">1.1</a> About This Document</span>
84
85 This document describes how to store Diffie-Hellman keys in the DNS.
86 Familiarity with the Diffie-Hellman key exchange algorithm is assumed
87 [<a href="#ref-Schneier" title="&quot;Applied Cryptography: Protocols, Algorithms, and Source Code in C&quot;">Schneier</a>].
88
89 <span class="h3"><a class="selflink" id="section-1.2" href="#section-1.2">1.2</a> About Diffie-Hellman</span>
90
91 Diffie-Hellman requires two parties to interact to derive keying
92 information which can then be used for authentication. Since DNS SIG
93 RRs are primarily used as stored authenticators of zone information
94 for many different resolvers, no Diffie-Hellman algorithm SIG RR is
95 defined. For example, assume that two parties have local secrets "i"
96 and "j". Assume they each respectively calculate X and Y as follows:
97
98 X = g**i ( mod p ) Y = g**j ( mod p )
99
100 They exchange these quantities and then each calculates a Z as
101 follows:
102
103 Zi = Y**i ( mod p ) Zj = X**j ( mod p )
104
105
106
107
108 <span class="grey">Eastlake Standards Track [Page 2]</span></pre>
109 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-3" ></span>
110 <span class="grey"><a href="./rfc2539">RFC 2539</a> Diffie-Hellman Keys in the DNS March 1999</span>
111
112
113 shared secret between the two parties that an adversary who does not
114 know i or j will not be able to learn from the exchanged messages
115 (unless the adversary can derive i or j by performing a discrete
116 logarithm mod p which is hard for strong p and g).
117
118 The private key for each party is their secret i (or j). The public
119 key is the pair p and g, which must be the same for the parties, and
120 their individual X (or Y).
121
122 <span class="h2"><a class="selflink" id="section-2" href="#section-2">2</a>. Diffie-Hellman KEY Resource Records</span>
123
124 Diffie-Hellman keys are stored in the DNS as KEY RRs using algorithm
125 number 2. The structure of the RDATA portion of this RR is as shown
126 below. The first 4 octets, including the flags, protocol, and
127 algorithm fields are common to all KEY RRs as described in [RFC
128 2535]. The remainder, from prime length through public value is the
129 "public key" part of the KEY RR. The period of key validity is not in
130 the KEY RR but is indicated by the SIG RR(s) which signs and
131 authenticates the KEY RR(s) at that domain name.
132
133 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 3 3
134 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
135 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
136 | KEY flags | protocol | algorithm=2 |
137 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
138 | prime length (or flag) | prime (p) (or special) /
139 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
140 / prime (p) (variable length) | generator length |
141 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
142 | generator (g) (variable length) |
143 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
144 | public value length | public value (variable length)/
145 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
146 / public value (g^i mod p) (variable length) |
147 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
148
149 Prime length is length of the Diffie-Hellman prime (p) in bytes if it
150 is 16 or greater. Prime contains the binary representation of the
151 Diffie-Hellman prime with most significant byte first (i.e., in
152 network order). If "prime length" field is 1 or 2, then the "prime"
153 field is actually an unsigned index into a table of 65,536
154 prime/generator pairs and the generator length SHOULD be zero. See
155 Appedix A for defined table entries and <a href="#section-4">Section 4</a> for information on
156 allocating additional table entries. The meaning of a zero or 3
157 through 15 value for "prime length" is reserved.
158
159
160
161
162
163
164 <span class="grey">Eastlake Standards Track [Page 3]</span></pre>
165 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-4" ></span>
166 <span class="grey"><a href="./rfc2539">RFC 2539</a> Diffie-Hellman Keys in the DNS March 1999</span>
167
168
169 Generator length is the length of the generator (g) in bytes.
170 Generator is the binary representation of generator with most
171 significant byte first. PublicValueLen is the Length of the Public
172 Value (g**i (mod p)) in bytes. PublicValue is the binary
173 representation of the DH public value with most significant byte
174 first.
175
176 The corresponding algorithm=2 SIG resource record is not used so no
177 format for it is defined.
178
179 <span class="h2"><a class="selflink" id="section-3" href="#section-3">3</a>. Performance Considerations</span>
180
181 Current DNS implementations are optimized for small transfers,
182 typically less than 512 bytes including overhead. While larger
183 transfers will perform correctly and work is underway to make larger
184 transfers more efficient, it is still advisable to make reasonable
185 efforts to minimize the size of KEY RR sets stored within the DNS
186 consistent with adequate security. Keep in mind that in a secure
187 zone, an authenticating SIG RR will also be returned.
188
189 <span class="h2"><a class="selflink" id="section-4" href="#section-4">4</a>. IANA Considerations</span>
190
191 Assignment of meaning to Prime Lengths of 0 and 3 through 15 requires
192 an IETF consensus.
193
194 Well known prime/generator pairs number 0x0000 through 0x07FF can
195 only be assigned by an IETF standards action and this Proposed
196 Standard assigns 0x0001 through 0x0002. Pairs number 0s0800 through
197 0xBFFF can be assigned based on RFC documentation. Pairs number
198 0xC000 through 0xFFFF are available for private use and are not
199 centrally coordinated. Use of such private pairs outside of a closed
200 environment may result in conflicts.
201
202 <span class="h2"><a class="selflink" id="section-5" href="#section-5">5</a>. Security Considerations</span>
203
204 Many of the general security consideration in [<a href="./rfc2535">RFC 2535</a>] apply. Keys
205 retrieved from the DNS should not be trusted unless (1) they have
206 been securely obtained from a secure resolver or independently
207 verified by the user and (2) this secure resolver and secure
208 obtainment or independent verification conform to security policies
209 acceptable to the user. As with all cryptographic algorithms,
210 evaluating the necessary strength of the key is important and
211 dependent on local policy.
212
213 In addition, the usual Diffie-Hellman key strength considerations
214 apply. (p-1)/2 should also be prime, g should be primitive mod p, p
215 should be "large", etc. [<a href="#ref-Schneier" title="&quot;Applied Cryptography: Protocols, Algorithms, and Source Code in C&quot;">Schneier</a>]
216
217
218
219
220 <span class="grey">Eastlake Standards Track [Page 4]</span></pre>
221 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-5" ></span>
222 <span class="grey"><a href="./rfc2539">RFC 2539</a> Diffie-Hellman Keys in the DNS March 1999</span>
223
224
225 References
226
227 [<a id="ref-RFC 1034">RFC 1034</a>] Mockapetris, P., "Domain Names - Concepts and
228 Facilities", STD 13, <a href="./rfc1034">RFC 1034</a>, November 1987.
229
230 [<a id="ref-RFC 1035">RFC 1035</a>] Mockapetris, P., "Domain Names - Implementation and
231 Specification", STD 13, <a href="./rfc1035">RFC 1035</a>, November 1987.
232
233 [<a id="ref-RFC 2535">RFC 2535</a>] Eastlake, D., "Domain Name System Security Extensions",
234 <a href="./rfc2535">RFC 2535</a>, March 1999.
235
236 [<a id="ref-Schneier">Schneier</a>] Bruce Schneier, "Applied Cryptography: Protocols,
237 Algorithms, and Source Code in C", 1996, John Wiley and
238 Sons
239
240 Author's Address
241
242 Donald E. Eastlake 3rd
243 IBM
244 65 Shindegan Hill Road, RR #1
245 Carmel, NY 10512
246
247 Phone: +1-914-276-2668(h)
248 +1-914-784-7913(w)
249 Fax: +1-914-784-3833(w)
250 EMail: [email protected]
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276 <span class="grey">Eastlake Standards Track [Page 5]</span></pre>
277 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-6" ></span>
278 <span class="grey"><a href="./rfc2539">RFC 2539</a> Diffie-Hellman Keys in the DNS March 1999</span>
279
280
281 Appendix A: Well known prime/generator pairs
282
283 These numbers are copied from the IPSEC effort where the derivation
284 of these values is more fully explained and additional information is
285 available. Richard Schroeppel performed all the mathematical and
286 computational work for this appendix.
287
288 <span class="h3"><a class="selflink" id="appendix-A.1" href="#appendix-A.1">A.1</a>. Well-Known Group 1: A 768 bit prime</span>
289
290 The prime is 2^768 - 2^704 - 1 + 2^64 * { [2^638 pi] + 149686 }. Its
291 decimal value is
292 155251809230070893513091813125848175563133404943451431320235
293 119490296623994910210725866945387659164244291000768028886422
294 915080371891804634263272761303128298374438082089019628850917
295 0691316593175367469551763119843371637221007210577919
296
297 Prime modulus: Length (32 bit words): 24, Data (hex):
298 FFFFFFFF FFFFFFFF C90FDAA2 2168C234 C4C6628B 80DC1CD1
299 29024E08 8A67CC74 020BBEA6 3B139B22 514A0879 8E3404DD
300 EF9519B3 CD3A431B 302B0A6D F25F1437 4FE1356D 6D51C245
301 E485B576 625E7EC6 F44C42E9 A63A3620 FFFFFFFF FFFFFFFF
302
303 Generator: Length (32 bit words): 1, Data (hex): 2
304
305 <span class="h3"><a class="selflink" id="appendix-A.2" href="#appendix-A.2">A.2</a>. Well-Known Group 2: A 1024 bit prime</span>
306
307 The prime is 2^1024 - 2^960 - 1 + 2^64 * { [2^894 pi] + 129093 }.
308 Its decimal value is
309 179769313486231590770839156793787453197860296048756011706444
310 423684197180216158519368947833795864925541502180565485980503
311 646440548199239100050792877003355816639229553136239076508735
312 759914822574862575007425302077447712589550957937778424442426
313 617334727629299387668709205606050270810842907692932019128194
314 467627007
315
316 Prime modulus: Length (32 bit words): 32, Data (hex):
317 FFFFFFFF FFFFFFFF C90FDAA2 2168C234 C4C6628B 80DC1CD1
318 29024E08 8A67CC74 020BBEA6 3B139B22 514A0879 8E3404DD
319 EF9519B3 CD3A431B 302B0A6D F25F1437 4FE1356D 6D51C245
320 E485B576 625E7EC6 F44C42E9 A637ED6B 0BFF5CB6 F406B7ED
321 EE386BFB 5A899FA5 AE9F2411 7C4B1FE6 49286651 ECE65381
322 FFFFFFFF FFFFFFFF
323
324 Generator: Length (32 bit words): 1, Data (hex): 2
325
326
327
328
329
330
331
332 <span class="grey">Eastlake Standards Track [Page 6]</span></pre>
333 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-7" ></span>
334 <span class="grey"><a href="./rfc2539">RFC 2539</a> Diffie-Hellman Keys in the DNS March 1999</span>
335
336
337 Full Copyright Statement
338
339 Copyright (C) The Internet Society (1999). All Rights Reserved.
340
341 This document and translations of it may be copied and furnished to
342 others, and derivative works that comment on or otherwise explain it
343 or assist in its implementation may be prepared, copied, published
344 and distributed, in whole or in part, without restriction of any
345 kind, provided that the above copyright notice and this paragraph are
346 included on all such copies and derivative works. However, this
347 document itself may not be modified in any way, such as by removing
348 the copyright notice or references to the Internet Society or other
349 Internet organizations, except as needed for the purpose of
350 developing Internet standards in which case the procedures for
351 copyrights defined in the Internet Standards process must be
352 followed, or as required to translate it into languages other than
353 English.
354
355 The limited permissions granted above are perpetual and will not be
356 revoked by the Internet Society or its successors or assigns.
357
358 This document and the information contained herein is provided on an
359 "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING
360 TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING
361 BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION
362 HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF
363 MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388 Eastlake Standards Track [Page 7]
389 </pre>