Debian Codegraph @

rfc1852.html

raw
1 <pre>Network Working Group P. Metzger
2 Request for Comments: 1852 Piermont
3 Category: Experimental W. Simpson
4 Daydreamer
5 September 1995
6
7
8 <span class="h1">IP Authentication using Keyed SHA</span>
9
10
11
12 Status of this Memo
13
14 This document defines an Experimental Protocol for the Internet
15 community. This does not specify an Internet standard of any kind.
16 Discussion and suggestions for improvement are requested.
17 Distribution of this memo is unlimited.
18
19
20 Abstract
21
22 This document describes the use of keyed SHA with the IP
23 Authentication Header.
24
25
26 Table of Contents
27
28 <a href="#section-1">1</a>. Introduction .......................................... <a href="#page-2">2</a>
29 <a href="#section-1.1">1.1</a> Keys ............................................ <a href="#page-2">2</a>
30 <a href="#section-1.2">1.2</a> Data Size ....................................... <a href="#page-2">2</a>
31 <a href="#section-1.3">1.3</a> Performance ..................................... <a href="#page-2">2</a>
32
33 <a href="#section-2">2</a>. Calculation ........................................... <a href="#page-3">3</a>
34
35 SECURITY CONSIDERATIONS ...................................... <a href="#page-4">4</a>
36 ACKNOWLEDGEMENTS ............................................. <a href="#page-4">4</a>
37 REFERENCES ................................................... <a href="#page-5">5</a>
38 AUTHOR'S ADDRESS ............................................. <a href="#page-6">6</a>
39
40
41
42
43
44
45
46
47
48
49
50
51
52 <span class="grey">Metzger &amp; Simpson Experimental [Page 1]</span></pre>
53 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-2" ></span>
54 <span class="grey"><a href="./rfc1852">RFC 1852</a> AH SHA September 1995</span>
55
56
57 <span class="h2"><a class="selflink" id="section-1" href="#section-1">1</a>. Introduction</span>
58
59 The Authentication Header (AH) [<a href="./rfc1826">RFC-1826</a>] provides integrity and
60 authentication for IP datagrams. This specification describes the AH
61 use of keys with the Secure Hash Algorithm (SHA) [<a href="#ref-FIPS-180-1">FIPS-180-1</a>].
62
63 It should be noted that this document specifies a newer version of
64 the SHA than that described in [<a href="#ref-FIPS-180">FIPS-180</a>], which was flawed. The
65 older version is not interoperable with the newer version.
66
67 This document assumes that the reader is familiar with the related
68 document "Security Architecture for the Internet Protocol" [RFC-
69 1825], which defines the overall security plan for IP, and provides
70 important background for this specification.
71
72
73
74 <span class="h3"><a class="selflink" id="section-1.1" href="#section-1.1">1.1</a>. Keys</span>
75
76 The secret authentication key shared between the communicating
77 parties SHOULD be a cryptographically strong random number, not a
78 guessable string of any sort.
79
80 The shared key is not constrained by this transform to any particular
81 size. Lengths of up to 160 bits MUST be supported by the
82 implementation, although any particular key may be shorter. Longer
83 keys are encouraged.
84
85
86
87 <span class="h3"><a class="selflink" id="section-1.2" href="#section-1.2">1.2</a>. Data Size</span>
88
89 SHA's 160-bit output is naturally 32-bit aligned. However, many
90 implementations require 64-bit alignment of the following headers, in
91 which case an additional 32 bits of padding is added, either before
92 or after the SHA output.
93
94 The size and position of this padding are negotiated as part of the
95 key management. Padding bits are filled with unspecified
96 implementation dependent (random) values, which are ignored on
97 receipt.
98
99
100
101 <span class="h3"><a class="selflink" id="section-1.3" href="#section-1.3">1.3</a>. Performance</span>
102
103 Preliminary results indicate that SHA is 62% as fast as MD5, and 80%
104 as fast as DES hashing. That is,
105
106
107
108 <span class="grey">Metzger &amp; Simpson Experimental [Page 2]</span></pre>
109 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-3" ></span>
110 <span class="grey"><a href="./rfc1852">RFC 1852</a> AH SHA September 1995</span>
111
112
113 SHA &lt; DES &lt; MD5
114
115 Nota Bene:
116 Suggestions are sought on alternative authentication algorithms
117 that have significantly faster throughput, are not patent-
118 encumbered, and still retain adequate cryptographic strength.
119
120
121
122 <span class="h2"><a class="selflink" id="section-2" href="#section-2">2</a>. Calculation</span>
123
124 The 160-bit digest is calculated as described in [<a href="#ref-FIPS-180-1">FIPS-180-1</a>]. At
125 the time of writing, a portable C language implementation of SHA is
126 available via FTP from <a href="ftp://rand.org/pub/jim/sha.tar.gz">ftp://rand.org/pub/jim/sha.tar.gz</a>.
127
128 The form of the authenticated message is
129
130 key, keyfill, datagram, key, SHAfill
131
132 First, the variable length secret authentication key is filled to the
133 next 512-bit boundary, using the same pad with length technique
134 defined for SHA.
135
136 Then, the filled key is concatenated with (immediately followed by)
137 the invariant fields of the entire IP datagram (variant fields are
138 zeroed), concatenated with (immediately followed by) the original
139 variable length key again.
140
141 A trailing pad with length to the next 512-bit boundary for the
142 entire message is added by SHA itself. The 160-bit SHA digest is
143 calculated, and the result is inserted into the Authentication Data
144 field.
145
146 Discussion:
147 The leading copy of the key is padded in order to facilitate
148 copying of the key at machine boundaries without requiring re-
149 alignment of the following datagram. The padding technique
150 includes a length which protects arbitrary length keys. Filling
151 to the SHA block size also allows the key to be prehashed to avoid
152 the physical copy in some implementations.
153
154 The trailing copy of the key is not necessary to protect against
155 appending attacks, as the IP datagram already includes a total
156 length field. It reintroduces mixing of the entire key, providing
157 minimal protection for very long and very short datagrams, and
158 marginal robustness against possible attacks on the IP length
159 field itself.
160
161
162
163
164 <span class="grey">Metzger &amp; Simpson Experimental [Page 3]</span></pre>
165 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-4" ></span>
166 <span class="grey"><a href="./rfc1852">RFC 1852</a> AH SHA September 1995</span>
167
168
169 When the implementation adds the keys and padding in place before
170 and after the IP datagram, care must be taken that the keys and/or
171 padding are not sent over the link by the link driver.
172
173
174
175 Security Considerations
176
177 Users need to understand that the quality of the security provided by
178 this specification depends completely on the strength of the SHA hash
179 function, the correctness of that algorithm's implementation, the
180 security of the key management mechanism and its implementation, the
181 strength of the key [<a href="#ref-CN94" title="&quot;On Weak Keys and Weak Data: Foiling the Two Nemeses&quot;">CN94</a>], and upon the correctness of the
182 implementations in all of the participating nodes.
183
184 The SHA algorithm was originally derived from the MD4 algorithm
185 [<a href="./rfc1320">RFC-1320</a>]. A flaw was apparently found in the original
186 specification of SHA [<a href="#ref-FIPS-180">FIPS-180</a>], and this document specifies the use
187 of a corrected version [<a href="#ref-FIPS-180-1">FIPS-180-1</a>].
188
189 At the time of writing of this document, there are no known flaws in
190 the SHA algorithm. That is, there are no known attacks on SHA or any
191 of its components that are better than brute force, and the 160-bit
192 hash output by SHA is substantially more resistant to brute force
193 attacks than the 128-bit hash size of MD4 and MD5.
194
195 However, as the flaw in the original SHA algorithm shows,
196 cryptographers are fallible, and there may be substantial
197 deficiencies yet to be discovered in the algorithm.
198
199
200
201 Acknowledgements
202
203 Some of the text of this specification was derived from work by
204 Randall Atkinson for the SIP, SIPP, and IPv6 Working Groups.
205
206 Preliminary performance analysis was provided by Joe Touch.
207
208 Comments should be submitted to the [email protected] mailing list.
209
210
211
212
213
214
215
216
217
218
219
220 <span class="grey">Metzger &amp; Simpson Experimental [Page 4]</span></pre>
221 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-5" ></span>
222 <span class="grey"><a href="./rfc1852">RFC 1852</a> AH SHA September 1995</span>
223
224
225 References
226
227 [<a id="ref-CN94">CN94</a>] John M. Carroll &amp; Sri Nudiati, "On Weak Keys and Weak Data:
228 Foiling the Two Nemeses", Cryptologia, Vol. 18 No. 23 pp.
229 253-280, July 1994.
230
231 [<a id="ref-FIPS-180">FIPS-180</a>]
232 "Secure Hash Standard", Computer Systems Laboratory,
233 National Institute of Standards and Technology, U.S.
234 Department Of Commerce, May 1993.
235
236 Also known as: 58 Fed Reg 27712 (1993).
237
238 [<a id="ref-FIPS-180-1">FIPS-180-1</a>]
239 "Secure Hash Standard", National Institute of Standards and
240 Technology, U.S. Department Of Commerce, April 1995.
241
242 Also known as: 59 Fed Reg 35317 (1994).
243
244 [<a id="ref-RFC-1320">RFC-1320</a>]
245 Ronald Rivest, "The MD4 Message-Digest Algorithm", <a href="./rfc1320">RFC-1320</a>,
246 April 1992.
247
248 [<a id="ref-RFC-1700">RFC-1700</a>]
249 Reynolds, J., and J. Postel, "Assigned Numbers", STD 2, <a href="./rfc1700">RFC</a>
250 <a href="./rfc1700">1700</a>, USC/Information Sciences Institute, October 1994.
251
252 [<a id="ref-RFC-1825">RFC-1825</a>]
253 Atkinson, R., "Security Architecture for the Internet
254 Protocol", <a href="./rfc1825">RFC-1825</a>, Naval Research Laboratory, July 1995.
255
256 [<a id="ref-RFC-1826">RFC-1826</a>]
257 Atkinson, R., "IP Authentication Header", <a href="./rfc1826">RFC-1826</a>, Naval
258 Research Laboratory, July 1995.
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276 <span class="grey">Metzger &amp; Simpson Experimental [Page 5]</span></pre>
277 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-6" ></span>
278 <span class="grey"><a href="./rfc1852">RFC 1852</a> AH SHA September 1995</span>
279
280
281 Author's Address
282
283 Questions about this memo can also be directed to:
284
285 Perry Metzger
286 Piermont Information Systems Inc.
287 160 Cabrini Blvd., Suite #2
288 New York, NY 10033
289
290 [email protected]
291
292
293 William Allen Simpson
294 Daydreamer
295 Computer Systems Consulting Services
296 1384 Fontaine
297 Madison Heights, Michigan 48071
298
299 [email protected]
300 [email protected]
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332 Metzger &amp; Simpson Experimental [Page 6]
333 </pre>