idnits 2.17.00 (12 Aug 2021) /tmp/idnits40316/draft-eastlake-randomness2-08.txt: -(795): Line appears to be too long, but this could be caused by non-ascii characters in UTF-8 encoding -(952): Line appears to be too long, but this could be caused by non-ascii characters in UTF-8 encoding -(1064): Line appears to be too long, but this could be caused by non-ascii characters in UTF-8 encoding -(1323): Line appears to be too long, but this could be caused by non-ascii characters in UTF-8 encoding -(1371): Line appears to be too long, but this could be caused by non-ascii characters in UTF-8 encoding -(1478): Line appears to be too long, but this could be caused by non-ascii characters in UTF-8 encoding -(1638): Line appears to be too long, but this could be caused by non-ascii characters in UTF-8 encoding -(1734): Line appears to be too long, but this could be caused by non-ascii characters in UTF-8 encoding -(1800): Line appears to be too long, but this could be caused by non-ascii characters in UTF-8 encoding Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- ** It looks like you're using RFC 3978 boilerplate. You should update this to the boilerplate described in the IETF Trust License Policy document (see https://trustee.ietf.org/license-info), which is required now. -- Found old boilerplate from RFC 3667, Section 5.1 on line 15. -- Found old boilerplate from RFC 3978, Section 5.5 on line 1587. ** The document claims conformance with section 10 of RFC 2026, but uses some RFC 3978/3979 boilerplate. As RFC 3978/3979 replaces section 10 of RFC 2026, you should not claim conformance with it if you have changed to using RFC 3978/3979 boilerplate. ** The document seems to lack an RFC 3978 Section 5.1 IPR Disclosure Acknowledgement -- however, there's a paragraph with a matching beginning. Boilerplate error? ** This document has an original RFC 3978 Section 5.4 Copyright Line, instead of the newer IETF Trust Copyright according to RFC 4748. ** The document seems to lack an RFC 3978 Section 5.4 Reference to BCP 78 -- however, there's a paragraph with a matching beginning. Boilerplate error? ** This document has an original RFC 3978 Section 5.5 Disclaimer, instead of the newer disclaimer which includes the IETF Trust according to RFC 4748. ** The document seems to lack an RFC 3979 Section 5, para. 1 IPR Disclosure Acknowledgement. ** The document seems to lack an RFC 3979 Section 5, para. 2 IPR Disclosure Acknowledgement. ** The document seems to lack an RFC 3979 Section 5, para. 3 IPR Disclosure Invitation. ** The document uses RFC 3667 boilerplate or RFC 3978-like boilerplate instead of verbatim RFC 3978 boilerplate. After 6 May 2005, submission of drafts without verbatim RFC 3978 boilerplate is not accepted. The following non-3978 patterns matched text found in the document. That text should be removed or replaced: By submitting this Internet-Draft, I certify that any applicable patent or other IPR claims of which I am aware have been disclosed, or will be disclosed, and any of which I become aware will be disclosed, in accordance with RFC 3668. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- ** Missing document type: Expected "INTERNET-DRAFT" in the upper left hand corner of the first page ** The document seems to lack a 1id_guidelines paragraph about Internet-Drafts being working documents. == There are 24 instances of lines with non-ascii characters in the document. == No 'Intended status' indicated for this document; assuming Proposed Standard == The page length should not exceed 58 lines per page, but there was 45 longer pages, the longest (page 2) being 59 lines == It seems as if not all pages are separated by form feeds - found 0 form feeds but 46 pages Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- ** The document seems to lack an IANA Considerations section. (See Section 2.2 of https://www.ietf.org/id-info/checklist for how to handle the case when there are no actions for IANA.) ** There is 1 instance of too long lines in the document, the longest one being 1 character in excess of 72. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the RFC 3978 Section 5.4 Copyright Line does not match the current year == The "Author's Address" (or "Authors' Addresses") section title is misspelled. == Line 806 has weird spacing: '...ity, it provi...' -- The document seems to lack a disclaimer for pre-RFC5378 work, but may have content which was first submitted before 10 November 2008. If you have contacted all the original authors and they are all willing to grant the BCP78 rights to the IETF Trust, then this is fine, and you can ignore this comment. If not, you may need to add the pre-RFC5378 disclaimer. (See the Legal Provisions document at https://trustee.ietf.org/license-info for more information.) -- The document date (August 2004) is 6487 days in the past. Is this intentional? Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) == Missing Reference: 'SHA1' is mentioned on line 1348, but not defined == Unused Reference: 'DNSSEC' is defined on line 1652, but no explicit reference was found in the text == Unused Reference: 'IPSEC' is defined on line 1676, but no explicit reference was found in the text == Unused Reference: 'MAIL PGP' is defined on line 1708, but no explicit reference was found in the text == Unused Reference: 'SBOX1' is defined on line 1755, but no explicit reference was found in the text == Unused Reference: 'SBOX2' is defined on line 1758, but no explicit reference was found in the text == Unused Reference: 'SHIFT1' is defined on line 1768, but no explicit reference was found in the text == Unused Reference: 'SHIFT2' is defined on line 1771, but no explicit reference was found in the text == Unused Reference: 'SHA-2' is defined on line 1779, but no explicit reference was found in the text == Unused Reference: 'SSH' is defined on line 1783, but no explicit reference was found in the text == Unused Reference: 'TLS' is defined on line 1788, but no explicit reference was found in the text -- Obsolete informational reference (is this intentional?): RFC 2535 (ref. 'DNSSEC') (Obsoleted by RFC 4033, RFC 4034, RFC 4035) -- Obsolete informational reference (is this intentional?): RFC 2401 (ref. 'IPSEC') (Obsoleted by RFC 4301) -- Obsolete informational reference (is this intentional?): RFC 1320 (ref. 'MD4') (Obsoleted by RFC 6150) -- No information found for draft-orman-public-key-lengths- - is the name correct? -- Obsolete informational reference (is this intentional?): RFC 1750 (Obsoleted by RFC 4086) -- No information found for draft-ietf-secsh- - is the name correct? -- Obsolete informational reference (is this intentional?): RFC 2246 (ref. 'TLS') (Obsoleted by RFC 4346) Summary: 14 errors (**), 0 flaws (~~), 18 warnings (==), 11 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 1 Network Working Group Donald E. Eastlake, 3rd 2 OBSOLETES RFC 1750 Jeffrey I. Schiller 3 Steve Crocker 4 Expires February 2005 August 2004 6 Randomness Requirements for Security 7 ---------- ------------ --- -------- 8 10 Status of This Document 12 By submitting this Internet-Draft, I certify that any applicable 13 patent or other IPR claims of which I am aware have been disclosed, 14 or will be disclosed, and any of which I become aware will be 15 disclosed, in accordance with RFC 3668. 17 This document is intended to become a Best Current Practice. 18 Comments should be sent to the authors. Distribution is unlimited. 20 This document is an Internet-Draft and is in full conformance with 21 all provisions of Section 10 of RFC 2026. Internet-Drafts are 22 working documents of the Internet Engineering Task Force (IETF), its 23 areas, and its working groups. Note that other groups may also 24 distribute working documents as Internet-Drafts. 26 Internet-Drafts are draft documents valid for a maximum of six months 27 and may be updated, replaced, or obsoleted by other documents at any 28 time. It is inappropriate to use Internet-Drafts as reference 29 material or to cite them other than as "work in progress." The list 30 of current Internet-Drafts can be accessed at 31 http://www.ietf.org/ietf/1id-abstracts.txt The list of Internet-Draft 32 Shadow Directories can be accessed at 33 http://www.ietf.org/shadow.html. 35 Abstract 37 Security systems are built on strong cryptographic algorithms that 38 foil pattern analysis attempts. However, the security of these 39 systems is dependent on generating secret quantities for passwords, 40 cryptographic keys, and similar quantities. The use of pseudo-random 41 processes to generate secret quantities can result in pseudo- 42 security. The sophisticated attacker of these security systems may 43 find it easier to reproduce the environment that produced the secret 44 quantities, searching the resulting small set of possibilities, than 45 to locate the quantities in the whole of the potential number space. 47 Choosing random quantities to foil a resourceful and motivated 48 adversary is surprisingly difficult. This document points out many 49 pitfalls in using traditional pseudo-random number generation 50 techniques for choosing such quantities. It recommends the use of 51 truly random hardware techniques and shows that the existing hardware 52 on many systems can be used for this purpose. It provides suggestions 53 to ameliorate the problem when a hardware solution is not available. 54 And it gives examples of how large such quantities need to be for 55 some applications. 57 Acknowledgements 59 Special thanks to Peter Gutmann, who has permitted the incorporation 60 of material from his paper "Software Generation of Practically Strong 61 Random Numbers", and to Paul Hoffman for his extensive comments. 63 The following other persons (in alphabetic order) have also 64 contributed substantially to this document: 66 Tony Hansen, Sandy Harris, Russ Housley 68 The following persons (in alphabetic order) contributed to RFC 1750, 69 the predecessor of this document: 71 David M. Balenson, Don T. Davis, Carl Ellison, Marc Horowitz, 72 Christian Huitema, Charlie Kaufman, Steve Kent, Hal Murray, Neil 73 Haller, Richard Pitkin, Tim Redmond, and Doug Tygar. 75 Table of Contents 77 Status of This Document....................................1 78 Abstract...................................................1 80 Acknowledgements...........................................3 82 Table of Contents..........................................4 84 1. Introduction............................................6 86 2. General Requirements....................................7 88 3. Traditional Pseudo-Random Sequences.....................9 90 4. Unpredictability.......................................11 91 4.1 Problems with Clocks and Serial Numbers...............11 92 4.2 Timing and Content of External Events.................12 93 4.3 The Fallacy of Complex Manipulation...................12 94 4.4 The Fallacy of Selection from a Large Database........13 96 5. Hardware for Randomness................................14 97 5.1 Volume Required.......................................14 98 5.2 Sensitivity to Skew...................................14 99 5.2.1 Using Stream Parity to De-Skew......................15 100 5.2.2 Using Transition Mappings to De-Skew................16 101 5.2.3 Using FFT to De-Skew................................17 102 5.2.4 Using Compression to De-Skew........................17 103 5.3 Existing Hardware Can Be Used For Randomness..........18 104 5.3.1 Using Existing Sound/Video Input....................18 105 5.3.2 Using Existing Disk Drives..........................18 106 5.4 Ring Oscillator Sources...............................19 108 6. Recommended Software Strategy..........................21 109 6.1 Mixing Functions......................................21 110 6.1.1 A Trivial Mixing Function...........................21 111 6.1.2 Stronger Mixing Functions...........................22 112 6.1.3 Using S-Boxes for Mixing............................24 113 6.1.4 Diffie-Hellman as a Mixing Function.................24 114 6.1.5 Using a Mixing Function to Stretch Random Bits......24 115 6.1.6 Other Factors in Choosing a Mixing Function.........25 116 6.2 Non-Hardware Sources of Randomness....................26 117 6.3 Cryptographically Strong Sequences....................27 118 6.3.1 Traditional Strong Sequences........................27 119 6.3.2 The Blum Blum Shub Sequence Generator...............28 120 6.3.3 Entropy Pool Techniques.............................29 122 7. Key Generation Standards and Examples..................31 123 7.1 US DoD Recommendations for Password Generation........31 124 7.2 X9.17 Key Generation..................................31 125 7.3 DSS Pseudo-Random Number Generation...................32 126 7.4 X9.82 Pseudo-Random Number Generation.................33 127 7.5 The /dev/random Device................................33 129 8. Examples of Randomness Required........................35 130 8.1 Password Generation..................................35 131 8.2 A Very High Security Cryptographic Key................36 132 8.2.1 Effort per Key Trial................................36 133 8.2.2 Meet in the Middle Attacks..........................37 134 8.2.3 Other Considerations................................38 136 9. Conclusion.............................................39 138 10. Security Considerations...............................40 139 11. Copyright and Disclaimer..............................40 141 12. Appendix A: Changes from RFC 1750.....................41 143 14. Informative References................................42 145 Authors Addresses.........................................46 146 File Name and Expiration..................................46 148 1. Introduction 150 Software cryptography is coming into wider use and is continuing to 151 spread, although there is a long way to go until it becomes 152 pervasive. 154 Systems like SSH, IPSEC, TLS, S/MIME, PGP, DNSSEC, Kerberos, etc. are 155 maturing and becoming a part of the network landscape [SSH, IPSEC, 156 MAIL*, TLS, DNSSEC]. By comparison, when the previous version of this 157 document [RFC 1750] was issued in 1994, about the only Internet 158 cryptographic security specification in the IETF was the Privacy 159 Enhanced Mail protocol [MAIL PEM]. 161 These systems provide substantial protection against snooping and 162 spoofing. However, there is a potential flaw. At the heart of all 163 cryptographic systems is the generation of secret, unguessable (i.e., 164 random) numbers. 166 The lack of generally available facilities for generating such 167 unpredictable numbers is an open wound in the design of cryptographic 168 software. For the software developer who wants to build a key or 169 password generation procedure that runs on a wide range of hardware, 170 the only safe strategy so far has been to force the local 171 installation to supply a suitable routine to generate random numbers. 172 This is an awkward, error-prone and unpalatable solution. 174 It is important to keep in mind that the requirement is for data that 175 an adversary has a very low probability of guessing or determining. 176 This can easily fail if pseudo-random data is used which only meets 177 traditional statistical tests for randomness or which is based on 178 limited range sources, such as clocks. Frequently such random 179 quantities are determinable by an adversary searching through an 180 embarrassingly small space of possibilities. 182 This Best Current Practice describes techniques for producing random 183 quantities that will be resistant to such attack. It recommends that 184 future systems include hardware random number generation or provide 185 access to existing hardware that can be used for this purpose. It 186 suggests methods for use if such hardware is not available. And it 187 gives some estimates of the number of random bits required for sample 188 applications. 190 2. General Requirements 192 A commonly encountered randomness requirement today is the user 193 password. This is usually a simple character string. Obviously, if a 194 password can be guessed, it does not provide security. (For re-usable 195 passwords, it is desirable that users be able to remember the 196 password. This may make it advisable to use pronounceable character 197 strings or phrases composed on ordinary words. But this only affects 198 the format of the password information, not the requirement that the 199 password be very hard to guess.) 201 Many other requirements come from the cryptographic arena. 202 Cryptographic techniques can be used to provide a variety of services 203 including confidentiality and authentication. Such services are based 204 on quantities, traditionally called "keys", that are unknown to and 205 unguessable by an adversary. 207 In some cases, such as the use of symmetric encryption with the one 208 time pads or an algorithm like the US Advanced Encryption Standard 209 [AES], the parties who wish to communicate confidentially and/or with 210 authentication must all know the same secret key. In other cases, 211 using what are called asymmetric or "public key" cryptographic 212 techniques, keys come in pairs. One key of the pair is private and 213 must be kept secret by one party, the other is public and can be 214 published to the world. It is computationally infeasible to determine 215 the private key from the public key and knowledge of the public is of 216 no help to an adversary [ASYMMETRIC]. [SCHNEIER, FERGUSON, KAUFMAN] 218 The frequency and volume of the requirement for random quantities 219 differs greatly for different cryptographic systems. Using pure RSA, 220 random quantities are required only when a new key pair is generated; 221 thereafter any number of messages can be signed without a further 222 need for randomness. The public key Digital Signature Algorithm 223 devised by the US National Institute of Standards and Technology 224 (NIST) requires good random numbers for each signature [DSS]. And 225 encrypting with a one time pad, in principle the strongest possible 226 encryption technique, requires a volume of randomness equal to all 227 the messages to be processed. [SCHNEIER, FERGUSON, KAUFMAN] 229 In most of these cases, an adversary can try to determine the 230 "secret" key by trial and error. (This is possible as long as the key 231 is enough smaller than the message that the correct key can be 232 uniquely identified.) The probability of an adversary succeeding at 233 this must be made acceptably low, depending on the particular 234 application. The size of the space the adversary must search is 235 related to the amount of key "information" present in the information 236 theoretic sense [SHANNON]. This depends on the number of different 237 secret values possible and the probability of each value as follows: 239 ----- 240 \ 241 Bits-of-information = \ - p * log ( p ) 242 / i 2 i 243 / 244 ----- 246 where i counts from 1 to the number of possible secret values and p 247 sub i is the probability of the value numbered i. (Since p sub i is 248 less than one, the log will be negative so each term in the sum will 249 be non-negative.) 251 If there are 2^n different values of equal probability, then n bits 252 of information are present and an adversary would, on the average, 253 have to try half of the values, or 2^(n-1) , before guessing the 254 secret quantity. If the probability of different values is unequal, 255 then there is less information present and fewer guesses will, on 256 average, be required by an adversary. In particular, any values that 257 the adversary can know are impossible, or are of low probability, can 258 be initially ignored by an adversary, who will search through the 259 more probable values first. 261 For example, consider a cryptographic system that uses 128 bit keys. 262 If these 128 bit keys are derived by using a fixed pseudo-random 263 number generator that is seeded with an 8 bit seed, then an adversary 264 needs to search through only 256 keys (by running the pseudo-random 265 number generator with every possible seed), not the 2^128 keys that 266 may at first appear to be the case. Only 8 bits of "information" are 267 in these 128 bit keys. 269 3. Traditional Pseudo-Random Sequences 271 Most traditional sources of random numbers use deterministic sources 272 of "pseudo-random" numbers. These typically start with a "seed" 273 quantity and use numeric or logical operations to produce a sequence 274 of values. 276 [KNUTH] has a classic exposition on pseudo-random numbers. 277 Applications he mentions are simulation of natural phenomena, 278 sampling, numerical analysis, testing computer programs, decision 279 making, and games. None of these have the same characteristics as the 280 sort of security uses we are talking about. Only in the last two 281 could there be an adversary trying to find the random quantity. 282 However, in these cases, the adversary normally has only a single 283 chance to use a guessed value. In guessing passwords or attempting to 284 break an encryption scheme, the adversary normally has many, perhaps 285 unlimited, chances at guessing the correct value. They can store the 286 message they are trying to break and repeatedly attack it. They are 287 also be assumed to be aided by a computer. 289 For testing the "randomness" of numbers, Knuth suggests a variety of 290 measures including statistical and spectral. These tests check things 291 like autocorrelation between different parts of a "random" sequence 292 or distribution of its values. But they could be met by a constant 293 stored random sequence, such as the "random" sequence printed in the 294 CRC Standard Mathematical Tables [CRC]. Despite meeting all the tests 295 suggested by Knuth, that sequence is unsuitable for cryptographic use 296 as adversaries must be assumed to have copies of all common published 297 "random" sequences and will able to spot the source and predict 298 future values. 300 A typical pseudo-random number generation technique, known as a 301 linear congruence pseudo-random number generator, is modular 302 arithmetic where the value numbered N+1 is calculated from the value 303 numbered N by 305 V = ( V * a + b )(Mod c) 306 N+1 N 308 The above technique has a strong relationship to linear shift 309 register pseudo-random number generators, which are well understood 310 cryptographically [SHIFT*]. In such generators bits are introduced at 311 one end of a shift register as the Exclusive Or (binary sum without 312 carry) of bits from selected fixed taps into the register. For 313 example: 315 +----+ +----+ +----+ +----+ 316 | B | <-- | B | <-- | B | <-- . . . . . . <-- | B | <-+ 317 | 0 | | 1 | | 2 | | n | | 318 +----+ +----+ +----+ +----+ | 319 | | | | 320 | | V +-----+ 321 | V +----------------> | | 322 V +-----------------------------> | XOR | 323 +---------------------------------------------------> | | 324 +-----+ 326 V = ( ( V * 2 ) + B .xor. B ... )(Mod 2^n) 327 N+1 N 0 2 329 The goodness of traditional pseudo-random number generator algorithms 330 is measured by statistical tests on such sequences. Carefully chosen 331 values a, b, c, and initial V or the placement of shift register tap 332 in the above simple processes can produce excellent statistics. 334 These sequences may be adequate in simulations (Monte Carlo 335 experiments) as long as the sequence is orthogonal to the structure 336 of the space being explored. Even there, subtle patterns may cause 337 problems. However, such sequences are clearly bad for use in security 338 applications. They are fully predictable if the initial state is 339 known. Depending on the form of the pseudo-random number generator, 340 the sequence may be determinable from observation of a short portion 341 of the sequence [SCHNEIER, STERN]. For example, with the generators 342 above, one can determine V(n+1) given knowledge of V(n). In fact, it 343 has been shown that with these techniques, even if only one bit of 344 the pseudo-random values are released, the seed can be determined 345 from short sequences. 347 Not only have linear congruent generators been broken, but techniques 348 are now known for breaking all polynomial congruent generators. 349 [KRAWCZYK] 351 4. Unpredictability 353 Statistically tested randomness in the traditional sense described in 354 section 3 is NOT the same as the unpredictability required for 355 security use. 357 For example, use of a widely available constant sequence, such as 358 that from the CRC tables, is very weak against an adversary. Once 359 they learn of or guess it, they can easily break all security, future 360 and past, based on the sequence. [CRC] Yet the statistical properties 361 of these tables are good. 363 The following sections describe the limitations of some randomness 364 generation techniques and sources. 366 4.1 Problems with Clocks and Serial Numbers 368 Computer clocks, or similar operating system or hardware values, 369 provide significantly fewer real bits of unpredictability than might 370 appear from their specifications. 372 Tests have been done on clocks on numerous systems and it was found 373 that their behavior can vary widely and in unexpected ways. One 374 version of an operating system running on one set of hardware may 375 actually provide, say, microsecond resolution in a clock while a 376 different configuration of the "same" system may always provide the 377 same lower bits and only count in the upper bits at much lower 378 resolution. This means that successive reads on the clock may produce 379 identical values even if enough time has passed that the value 380 "should" change based on the nominal clock resolution. There are also 381 cases where frequently reading a clock can produce artificial 382 sequential values because of extra code that checks for the clock 383 being unchanged between two reads and increases it by one! Designing 384 portable application code to generate unpredictable numbers based on 385 such system clocks is particularly challenging because the system 386 designer does not always know the properties of the system clocks 387 that the code will execute on. 389 Use of hardware serial numbers such as an Ethernet addresses may also 390 provide fewer bits of uniqueness than one would guess. Such 391 quantities are usually heavily structured and subfields may have only 392 a limited range of possible values or values easily guessable based 393 on approximate date of manufacture or other data. For example, it is 394 likely that a company that manufactures both computers and Ethernet 395 adapters will, at least internally, use its own adapters, which 396 significantly limits the range of built-in addresses. 398 Problems such as those described above related to clocks and serial 399 numbers make code to produce unpredictable quantities difficult if 400 the code is to be ported across a variety of computer platforms and 401 systems. 403 4.2 Timing and Content of External Events 405 It is possible to measure the timing and content of mouse movement, 406 key strokes, and similar user events. This is a reasonable source of 407 unguessable data with some qualifications. On some machines, inputs 408 such as key strokes are buffered. Even though the userどヨs inter- 409 keystroke timing may have sufficient variation and unpredictability, 410 there might not be an easy way to access that variation. Another 411 problem is that no standard method exists to sample timing details. 412 This makes it hard to build standard software intended for 413 distribution to a large range of machines based on this technique. 415 The amount of mouse movement or the keys actually hit are usually 416 easier to access than timings but may yield less unpredictability as 417 the user may provide highly repetitive input. 419 Other external events, such as network packet arrival times, can also 420 be used, with care. In particular, the possibility of manipulation of 421 such times by an adversary and the lack of history at system start up 422 must be considered. 424 4.3 The Fallacy of Complex Manipulation 426 One strategy which may give a misleading appearance of 427 unpredictability is to take a very complex algorithm (or an excellent 428 traditional pseudo-random number generator with good statistical 429 properties) and calculate a cryptographic key by starting with 430 limited data such as the computer system clock value as the seed. An 431 adversary who knew roughly when the generator was started would have 432 a relatively small number of seed values to test as they would know 433 likely values of the system clock. Large numbers of pseudo-random 434 bits could be generated but the search space an adversary would need 435 to check could be quite small. 437 Thus very strong and/or complex manipulation of data will not help if 438 the adversary can learn what the manipulation is and there is not 439 enough unpredictability in the starting seed value. They can usually 440 use the limited number of results stemming from a limited number of 441 seed values to defeat security. 443 Another serious strategy error is to assume that a very complex 444 pseudo-random number generation algorithm will produce strong random 445 numbers when there has been no theory behind or analysis of the 446 algorithm. There is a excellent example of this fallacy right near 447 the beginning of Chapter 3 in [KNUTH] where the author describes a 448 complex algorithm. It was intended that the machine language program 449 corresponding to the algorithm would be so complicated that a person 450 trying to read the code without comments wouldnどヨt know what the 451 program was doing. Unfortunately, actual use of this algorithm showed 452 that it almost immediately converged to a single repeated value in 453 one case and a small cycle of values in another case. 455 Not only does complex manipulation not help you if you have a limited 456 range of seeds but blindly chosen complex manipulation can destroy 457 the randomness in a good seed! 459 4.4 The Fallacy of Selection from a Large Database 461 Another strategy that can give a misleading appearance of 462 unpredictability is selection of a quantity randomly from a database 463 and assume that its strength is related to the total number of bits 464 in the database. For example, typical USENET servers process many 465 megabytes of information per day [USENET]. Assume a random quantity 466 was selected by fetching 32 bytes of data from a random starting 467 point in this data. This does not yield 32*8 = 256 bits worth of 468 unguessability. Even after allowing that much of the data is human 469 language and probably has no more than 2 or 3 bits of information per 470 byte, it doesnどヨt yield 32*2 = 64 bits of unguessability. For an 471 adversary with access to the same usenet database the unguessability 472 rests only on the starting point of the selection. That is perhaps a 473 little over a couple of dozen bits of unguessability. 475 The same argument applies to selecting sequences from the data on a 476 publicly available CD/DVD recording or any other large public 477 database. If the adversary has access to the same database, this 478 "selection from a large volume of data" step buys little. However, 479 if a selection can be made from data to which the adversary has no 480 access, such as system buffers on an active multi-user system, it may 481 be of help. 483 5. Hardware for Randomness 485 Is there any hope for true strong portable randomness in the future? 486 There might be. All thatどヨs needed is a physical source of 487 unpredictable numbers. 489 A thermal noise (sometimes called Johnson noise in integrated 490 circuits) or radioactive decay source and a fast, free-running 491 oscillator would do the trick directly [GIFFORD]. This is a trivial 492 amount of hardware, and could easily be included as a standard part 493 of a computer systemどヨs architecture. Most audio (or video) input 494 devices are useable [TURBID]. Furthermore, any system with a 495 spinning disk or ring oscillator and a stable (crystal) time source 496 or the like has an adequate source of randomness ([DAVIS] and Section 497 5.4). All thatどヨs needed is the common perception among computer 498 vendors that this small additional hardware and the software to 499 access it is necessary and useful. 501 5.1 Volume Required 503 How much unpredictability is needed? Is it possible to quantify the 504 requirement in, say, number of random bits per second? 506 The answer is not very much is needed. For AES, the key can be 128 507 bits and, as we show in an example in Section 8, even the highest 508 security system is unlikely to require strong keying material of much 509 over 200 bits. If a series of keys are needed, they can be generated 510 from a strong random seed (starting value) using a cryptographically 511 strong sequence as explained in Section 6.3. A few hundred random 512 bits generated at start up or once a day would be enough using such 513 techniques. Even if the random bits are generated as slowly as one 514 per second and it is not possible to overlap the generation process, 515 it should be tolerable in most high security applications to wait 200 516 seconds occasionally. 518 These numbers are trivial to achieve. It could be done by a person 519 repeatedly tossing a coin. Almost any hardware based process is 520 likely to be much faster. 522 5.2 Sensitivity to Skew 524 Is there any specific requirement on the shape of the distribution of 525 the random numbers? The good news is the distribution need not be 526 uniform. All that is needed is a conservative estimate of how non- 527 uniform it is to bound performance. Simple techniques to de-skew the 528 bit stream are given below and stronger cryptographic techniques are 529 described in Section 6.1.2 below. 531 5.2.1 Using Stream Parity to De-Skew 533 Consider taking a sufficiently long string of bits and map the string 534 to "zero" or "one". The mapping will not yield a perfectly uniform 535 distribution, but it can be as close as desired. One mapping that 536 serves the purpose is to take the parity of the string. This has the 537 advantages that it is robust across all degrees of skew up to the 538 estimated maximum skew and is absolutely trivial to implement in 539 hardware. 541 The following analysis gives the number of bits that must be sampled: 543 Suppose the ratio of ones to zeros is ( 0.5 + e ) to ( 0.5 - e ), 544 where e is between 0 and 0.5 and is a measure of the "eccentricity" 545 of the distribution. Consider the distribution of the parity function 546 of N bit samples. The probabilities that the parity will be one or 547 zero will be the sum of the odd or even terms in the binomial 548 expansion of (p + q)^N, where p = 0.5 + e, the probability of a one, 549 and q = 0.5 - e, the probability of a zero. 551 These sums can be computed easily as 553 N N 554 1/2 * ( ( p + q ) + ( p - q ) ) 555 and 556 N N 557 1/2 * ( ( p + q ) - ( p - q ) ). 559 (Which one corresponds to the probability the parity will be 1 560 depends on whether N is odd or even.) 562 Since p + q = 1 and p - q = 2e, these expressions reduce to 564 N 565 1/2 * [1 + (2e) ] 566 and 567 N 568 1/2 * [1 - (2e) ]. 570 Neither of these will ever be exactly 0.5 unless e is zero, but we 571 can bring them arbitrarily close to 0.5. If we want the probabilities 572 to be within some delta d of 0.5, i.e. then 574 N 575 ( 0.5 + ( 0.5 * (2e) ) ) < 0.5 + d. 577 Solving for N yields N > log(2d)/log(2e). (Note that 2e is less than 578 1, so its log is negative. Division by a negative number reverses the 579 sense of an inequality.) 581 The following table gives the length of the string which must be 582 sampled for various degrees of skew in order to come within 0.001 of 583 a 50/50 distribution. 585 +---------+--------+-------+ 586 | Prob(1) | e | N | 587 +---------+--------+-------+ 588 | 0.5 | 0.00 | 1 | 589 | 0.6 | 0.10 | 4 | 590 | 0.7 | 0.20 | 7 | 591 | 0.8 | 0.30 | 13 | 592 | 0.9 | 0.40 | 28 | 593 | 0.95 | 0.45 | 59 | 594 | 0.99 | 0.49 | 308 | 595 +---------+--------+-------+ 597 The last entry shows that even if the distribution is skewed 99% in 598 favor of ones, the parity of a string of 308 samples will be within 599 0.001 of a 50/50 distribution. 601 5.2.2 Using Transition Mappings to De-Skew 603 Another technique, originally due to von Neumann [VON NEUMANN], is to 604 examine a bit stream as a sequence of non-overlapping pairs. You 605 could then discard any 00 or 11 pairs found, interpret 01 as a 0 and 606 10 as a 1. Assume the probability of a 1 is 0.5+e and the probability 607 of a 0 is 0.5-e where e is the eccentricity of the source and 608 described in the previous section. Then the probability of each pair 609 is as follows: 611 +------+-----------------------------------------+ 612 | pair | probability | 613 +------+-----------------------------------------+ 614 | 00 | (0.5 - e)^2 = 0.25 - e + e^2 | 615 | 01 | (0.5 - e)*(0.5 + e) = 0.25 - e^2 | 616 | 10 | (0.5 + e)*(0.5 - e) = 0.25 - e^2 | 617 | 11 | (0.5 + e)^2 = 0.25 + e + e^2 | 618 +------+-----------------------------------------+ 620 This technique will completely eliminate any bias but at the expense 621 of taking an indeterminate number of input bits for any particular 622 desired number of output bits. The probability of any particular pair 623 being discarded is 0.5 + 2e^2 so the expected number of input bits to 624 produce X output bits is X/(0.25 - e^2). 626 This technique assumes that the bits are from a stream where each bit 627 has the same probability of being a 0 or 1 as any other bit in the 628 stream and that bits are not correlated, i.e., that the bits are 629 identical independent distributions. If alternate bits were from two 630 correlated sources, for example, the above analysis breaks down. 632 The above technique also provides another illustration of how a 633 simple statistical analysis can mislead if one is not always on the 634 lookout for patterns that could be exploited by an adversary. If the 635 algorithm were mis-read slightly so that overlapping successive bits 636 pairs were used instead of non-overlapping pairs, the statistical 637 analysis given is the same; however, instead of providing an unbiased 638 uncorrelated series of random 1どヨs and 0どヨs, it instead produces a 639 totally predictable sequence of exactly alternating 1どヨs and 0どヨs. 641 5.2.3 Using FFT to De-Skew 643 When real world data consists of strongly biased or correlated bits, 644 it may still contain useful amounts of randomness. This randomness 645 can be extracted through use of the discrete Fourier transform or its 646 optimized variant, the FFT. 648 Using the Fourier transform of the data, strong correlations can be 649 discarded. If adequate data is processed and remaining correlations 650 decay, spectral lines approaching statistical independence and 651 normally distributed randomness can be produced [BRILLINGER]. 653 5.2.4 Using Compression to De-Skew 655 Reversible compression techniques also provide a crude method of de- 656 skewing a skewed bit stream. This follows directly from the 657 definition of reversible compression and the formula in Section 2 658 above for the amount of information in a sequence. Since the 659 compression is reversible, the same amount of information must be 660 present in the shorter output than was present in the longer input. 661 By the Shannon information equation, this is only possible if, on 662 average, the probabilities of the different shorter sequences are 663 more uniformly distributed than were the probabilities of the longer 664 sequences. Therefore the shorter sequences must be de-skewed relative 665 to the input. 667 However, many compression techniques add a somewhat predictable 668 preface to their output stream and may insert such a sequence again 669 periodically in their output or otherwise introduce subtle patterns 670 of their own. They should be considered only a rough technique 671 compared with those described above or in Section 6.1.2. At a 672 minimum, the beginning of the compressed sequence should be skipped 673 and only later bits used for applications requiring random bits. 675 5.3 Existing Hardware Can Be Used For Randomness 677 As described below, many computers come with hardware that can, with 678 care, be used to generate truly random quantities. 680 5.3.1 Using Existing Sound/Video Input 682 Many computers are built with inputs that digitize some real world 683 analog source, such as sound from a microphone or video input from a 684 camera. Under appropriate circumstances, such input can provide 685 reasonably high quality random bits. The "input" from a sound 686 digitizer with no source plugged in or a camera with the lens cap on, 687 if the system has enough gain to detect anything, is essentially 688 thermal noise. 690 For example, on some UNIX based systems, one can read from the 691 /dev/audio device with nothing plugged into the microphone jack or 692 the microphone receiving only low level background noise. Such data 693 is essentially random noise although it should not be trusted without 694 some checking in case of hardware failure. It will, in any case, need 695 to be de-skewed as described elsewhere. 697 Combining this with compression to de-skew one can, in UNIXese, 698 generate a huge amount of medium quality random data by doing 700 cat /dev/audio | compress - >random-bits-file 702 A detailed examination of this type of randomness source appears in 703 [TURBID]. 705 5.3.2 Using Existing Disk Drives 707 Disk drives have small random fluctuations in their rotational speed 708 due to chaotic air turbulence [DAVIS]. By adding low level disk seek 709 time instrumentation to a system, a series of measurements can be 710 obtained that include this randomness. Such data is usually highly 711 correlated so that significant processing is needed, such as FFT (see 712 section 5.2.3). Nevertheless experimentation has shown that, with 713 such processing, most disk drives easily produce 100 bits a minute or 714 more of excellent random data. 716 Partly offsetting this need for processing is the fact that disk 717 drive failure will normally be rapidly noticed. Thus, problems with 718 this method of random number generation due to hardware failure are 719 unlikely. 721 5.4 Ring Oscillator Sources 723 If an integrated circuit is being designed or field programmed, an 724 odd number of gates can be connected in series to produce a free- 725 running ring oscillator. By sampling a point in the ring at a fixed 726 frequency, say one determined by a stable crystal oscillator, some 727 amount of entropy can be extracted due to variations in the free- 728 running oscillator timing. It is possible to increase the rate of 729 entropy by xorどヨing sampled values from a few ring oscillators with 730 relatively prime lengths. It is sometimes recommended that an odd 731 number of rings be used so that, even if the rings somehow become 732 synchronously locked to each other, there will still be sampled bit 733 transitions. Another possibility source to sample is the output of a 734 noisy diode. 736 Sampled bits from such sources will have to be heavily de-skewed, as 737 disk rotation timings must be (Section 5.3.2). An engineering study 738 would be needed to determine the amount of entropy being produced 739 depending on the particular design. In any case, these can be good 740 sources whose cost is a trivial amount of hardware by modern 741 standards. 743 As an example, IEEE 802.11i suggests that the circuit below be 744 considered, with due attention in the design to isolation of the 745 rings from each other and from clocked circuits to avoid undesired 746 synchronization, etc., and extensive post processing. [IEEE 802.11i] 747 |\ |\ |\ 748 +-->| >0-->| >0-- 19 total --| >0--+-------+ 749 | |/ |/ |/ | | 750 | | | 751 +----------------------------------+ V 752 +-----+ 753 |\ |\ |\ | | output 754 +-->| >0-->| >0-- 23 total --| >0--+--->| XOR |------> 755 | |/ |/ |/ | | | 756 | | +-----+ 757 +----------------------------------+ ^ ^ 758 | | 759 |\ |\ |\ | | 760 +-->| >0-->| >0-- 29 total --| >0--+------+ | 761 | |/ |/ |/ | | 762 | | | 763 +----------------------------------+ | 764 | 765 other randomness if available--------------+ 767 6. Recommended Software Strategy 769 What is the best overall strategy for meeting the requirement for 770 unguessable random numbers in the absence of a reliable hardware 771 source? It is to obtain random input from a number of uncorrelated 772 sources and to mix them with a strong mixing function. Such a 773 function will preserve the randomness present in any of the sources 774 even if other quantities being combined happen to be fixed or easily 775 guessable. This may be advisable even with a good hardware source, as 776 hardware can also fail, though this should be weighed against any 777 increase in the chance of overall failure due to added software 778 complexity. 780 6.1 Mixing Functions 782 A strong mixing function is one which combines two or more inputs and 783 produces an output where each output bit is a different complex non- 784 linear function of all the input bits. On average, changing any input 785 bit will change about half the output bits. But because the 786 relationship is complex and non-linear, no particular output bit is 787 guaranteed to change when any particular input bit is changed. 789 Consider the problem of converting a stream of bits that is skewed 790 towards 0 or 1 or which has a somewhat predictable pattern to a 791 shorter stream which is more random, as discussed in Section 5.2 792 above. This is simply another case where a strong mixing function is 793 desired, mixing the input bits to produce a smaller number of output 794 bits. The technique given in Section 5.2.1 of using the parity of a 795 number of bits is simply the result of successively Exclusive Orどヨing 796 them which is examined as a trivial mixing function immediately 797 below. Use of stronger mixing functions to extract more of the 798 randomness in a stream of skewed bits is examined in Section 6.1.2. 800 6.1.1 A Trivial Mixing Function 802 A trivial example for single bit inputs is the Exclusive Or function, 803 which is equivalent to addition without carry, as show in the table 804 below. This is a degenerate case in which the one output bit always 805 changes for a change in either input bit. But, despite its 806 simplicity, it provides a useful illustration. 808 +-----------+-----------+----------+ 809 | input 1 | input 2 | output | 810 +-----------+-----------+----------+ 811 | 0 | 0 | 0 | 812 | 0 | 1 | 1 | 813 | 1 | 0 | 1 | 814 | 1 | 1 | 0 | 815 +-----------+-----------+----------+ 817 If inputs 1 and 2 are uncorrelated and combined in this fashion then 818 the output will be an even better (less skewed) random bit than the 819 inputs. If we assume an "eccentricity" e as defined in Section 5.2 820 above, then the output eccentricity relates to the input eccentricity 821 as follows: 823 e = 2 * e * e 824 output input 1 input 2 826 Since e is never greater than 1/2, the eccentricity is always 827 improved except in the case where at least one input is a totally 828 skewed constant. This is illustrated in the following table where the 829 top and left side values are the two input eccentricities and the 830 entries are the output eccentricity: 832 +--------+--------+--------+--------+--------+--------+--------+ 833 | e | 0.00 | 0.10 | 0.20 | 0.30 | 0.40 | 0.50 | 834 +--------+--------+--------+--------+--------+--------+--------+ 835 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 836 | 0.10 | 0.00 | 0.02 | 0.04 | 0.06 | 0.08 | 0.10 | 837 | 0.20 | 0.00 | 0.04 | 0.08 | 0.12 | 0.16 | 0.20 | 838 | 0.30 | 0.00 | 0.06 | 0.12 | 0.18 | 0.24 | 0.30 | 839 | 0.40 | 0.00 | 0.08 | 0.16 | 0.24 | 0.32 | 0.40 | 840 | 0.50 | 0.00 | 0.10 | 0.20 | 0.30 | 0.40 | 0.50 | 841 +--------+--------+--------+--------+--------+--------+--------+ 843 However, keep in mind that the above calculations assume that the 844 inputs are not correlated. If the inputs were, say, the parity of the 845 number of minutes from midnight on two clocks accurate to a few 846 seconds, then each might appear random if sampled at random intervals 847 much longer than a minute. Yet if they were both sampled and combined 848 with xor, the result would be zero most of the time. 850 6.1.2 Stronger Mixing Functions 852 The US Government Advanced Encryption Standard [AES] is an example of 853 a strong mixing function for multiple bit quantities. It takes up to 854 384 bits of input (128 bits of "data" and 256 bits of "key") and 855 produces 128 bits of output each of which is dependent on a complex 856 non-linear function of all input bits. Other encryption functions 857 with this characteristic, such as [DES], can also be used by 858 considering them to mix all of their key and data input bits. 860 Another good family of mixing functions are the "message digest" or 861 hashing functions such as The US Government Secure Hash Standards 862 [SHA*] and the MD4, MD5 [MD4, MD5] series. These functions all take a 863 practically unlimited amount of input and produce a relatively short 864 fixed length output mixing all the input bits. The MD* series produce 865 128 bits of output, SHA-1 produces 160 bits, and other SHA functions 866 produce up to 512 bits. 868 Although the message digest functions are designed for variable 869 amounts of input, AES and other encryption functions can also be used 870 to combine any number of inputs. If 128 bits of output is adequate, 871 the inputs can be packed into a 128-bit data quantity and successive 872 AES keys, padding with zeros if needed, which are then used to 873 successively encrypt using AES in Electronic Codebook Mode. Or the 874 input could be packed into one 128-bit key and multiple data blocks 875 and a CBC-MAC calculated [MODES]. 877 If more than 128 bits of output are needed, use more complex mixing. 878 But keep in mind that it is absolutely impossible to get more bits of 879 "randomness" out than are put in. For example, if inputs are packed 880 into three quantities, A, B, and C, use AES to encrypt A with B as a 881 key and then with C as a key to produce the 1st part of the output, 882 then encrypt B with C and then A for more output and, if necessary, 883 encrypt C with A and then B for yet more output. Still more output 884 can be produced by reversing the order of the keys given above to 885 stretch things. The same can be done with the hash functions by 886 hashing various subsets of the input data or different copies of the 887 input data with different prefixes and/or suffixes to produce 888 multiple outputs. 890 An example of using a strong mixing function would be to reconsider 891 the case of a string of 308 bits each of which is biased 99% towards 892 zero. The parity technique given in Section 5.2.1 above reduced this 893 to one bit with only a 1/1000 deviance from being equally likely a 894 zero or one. But, applying the equation for information given in 895 Section 2, this 308 bit skewed sequence has over 5 bits of 896 information in it. Thus hashing it with SHA-1 and taking the bottom 5 897 bits of the result would yield 5 unbiased random bits as opposed to 898 the single bit given by calculating the parity of the string. 899 Alternatively, for some applications, you could use the entire hash 900 output to retain almost all of the entropy. 902 6.1.3 Using S-Boxes for Mixing 904 Many modern block encryption functions, including DES and AES, 905 incorporate modules known as S-Boxes (substitution boxes). These 906 produce a smaller number of outputs from a larger number of inputs 907 through a complex non-linear mixing function which would have the 908 effect of concentrating limited entropy in the inputs into the 909 output. 911 S-Boxes sometimes incorporate bent boolean functions (functions of an 912 even number of bits producing one output bit with maximum non- 913 linearity). Looking at the output for all input pairs differing in 914 any particular bit position, exactly half the outputs are different. 915 An S-Box in which each output bit is produced by a bent function such 916 that any linear combination of these functions is also a bent 917 function is called a "perfect S-Box". 919 S-boxes and various repeated application or cascades of such boxes 920 can be used for mixing. [SBOX*] 922 6.1.4 Diffie-Hellman as a Mixing Function 924 Diffie-Hellman exponential key exchange is a technique that yields a 925 shared secret between two parties that can be made computationally 926 infeasible for a third party to determine even if they can observe 927 all the messages between the two communicating parties. This shared 928 secret is a mixture of initial quantities generated by each of the 929 parties [D-H]. 931 If these initial quantities are random and uncorrelated, then the 932 shared secret combines that randomness, but, of course, can not 933 produce more randomness than the size of the shared secret generated. 935 While this is true if the Diffie-Hellman computation is performed 936 privately, if an adversary can observe either of the public keys and 937 knows the modulus being used, they need only search through the space 938 of the other secret key in order to be able to calculate the shared 939 secret [D-H]. So, conservatively, it would be best to consider public 940 Diffie-Hellman to produce a quantity whose guessability corresponds 941 to the worst of the two inputs. 943 6.1.5 Using a Mixing Function to Stretch Random Bits 945 While it is not necessary for a mixing function to produce the same 946 or fewer bits than its inputs, mixing bits cannot "stretch" the 947 amount of random unpredictability present in the inputs. Thus four 948 inputs of 32 bits each where there is 12 bits worth of 949 unpredictability (such as 4,096 equally probable values) in each 950 input cannot produce more than 48 bits worth of unpredictable output. 951 The output can be expanded to hundreds or thousands of bits by, for 952 example, mixing with successive integers, but the clever adversaryどヨs 953 search space is still 2^48 possibilities. Furthermore, mixing to 954 fewer bits than are input will tend to strengthen the randomness of 955 the output the way using Exclusive Or to produce one bit from two did 956 above. 958 The last table in Section 6.1.1 shows that mixing a random bit with a 959 constant bit with Exclusive Or will produce a random bit. While this 960 is true, it does not provide a way to "stretch" one random bit into 961 more than one. If, for example, a random bit is mixed with a 0 and 962 then with a 1, this produces a two bit sequence but it will always be 963 either 01 or 10. Since there are only two possible values, there is 964 still only the one bit of original randomness. 966 6.1.6 Other Factors in Choosing a Mixing Function 968 For local use, AES has the advantages that it has been widely tested 969 for flaws, is reasonably efficient in software, and is widely 970 documented and implemented with hardware and software implementations 971 available all over the world including open source code. The SHA* 972 family have had a little less study and tend to require more CPU 973 cycles than AES but there is no reason to believe they are flawed. 974 Both SHA* and MD5 were derived from the earlier MD4 algorithm. They 975 all have source code available [SHA*, MD*]. Some signs of weakness 976 have been found in MD4 and MD5. In particular, MD4 has only three 977 rounds and there are several independent breaks of the first two or 978 last two rounds. And some collisions have been found in MD5 output. 980 AES was selected by a robust, public, and international process. It 981 and SHA* have been vouched for by the US National Security Agency 982 (NSA) on the basis of criteria that mostly remain secret, as was DES. 983 While this has been the cause of much speculation and doubt, 984 investigation of DES over the years has indicated that NSA 985 involvement in modifications to its design, which originated with 986 IBM, was primarily to strengthen it. No concealed or special weakness 987 has been found in DES. It is likely that the NSA modifications to MD4 988 to produce the SHA algorithms similarly strengthened these 989 algorithms, possibly against threats not yet known in the public 990 cryptographic community. 992 Where input lengths are unpredictable, hash algorithms are a little 993 more convenient to use than block encryption algorithms since they 994 are generally designed to accept variable length inputs. Block 995 encryption algorithms generally require an additional padding 996 algorithm to accommodate inputs that are not an even multiple of the 997 block size. 999 As of the time of this document, the authors know of no patent claims 1000 to the basic AES, DES, SHA*, MD4, and MD5 algorithms other than 1001 patents for which an irrevocable royalty free license has been 1002 granted to the world. There may, of course, be basic patents of which 1003 the authors are unaware or patents on implementations or uses or 1004 other relevant patents issued or to be issued. 1006 6.2 Non-Hardware Sources of Randomness 1008 The best source of input for mixing would be a hardware randomness 1009 such as ring oscillators, disk drive timing, thermal noise, or 1010 radioactive decay. However, if that is not available, there are other 1011 possibilities. These include system clocks, system or input/output 1012 buffers, user/system/hardware/network serial numbers and/or addresses 1013 and timing, and user input. Unfortunately, each of these sources can 1014 produce very limited or predictable values under some circumstances. 1016 Some of the sources listed above would be quite strong on multi-user 1017 systems where, in essence, each user of the system is a source of 1018 randomness. However, on a small single user or embedded system, 1019 especially at start up, it might be possible for an adversary to 1020 assemble a similar configuration. This could give the adversary 1021 inputs to the mixing process that were sufficiently correlated to 1022 those used originally as to make exhaustive search practical. 1024 The use of multiple random inputs with a strong mixing function is 1025 recommended and can overcome weakness in any particular input. The 1026 timing and content of requested "random" user keystrokes can yield 1027 hundreds of random bits but conservative assumptions need to be made. 1028 For example, assuming at most a few bits of randomness if the inter- 1029 keystroke interval is unique in the sequence up to that point and a 1030 similar assumption if the key hit is unique but assuming that no bits 1031 of randomness are present in the initial key value or if the timing 1032 or key value duplicate previous values. The results of mixing these 1033 timings and characters typed could be further combined with clock 1034 values and other inputs. 1036 This strategy may make practical portable code to produce good random 1037 numbers for security even if some of the inputs are very weak on some 1038 of the target systems. However, it may still fail against a high 1039 grade attack on small, single user or embedded systems, especially if 1040 the adversary has ever been able to observe the generation process in 1041 the past. A hardware based random source is still preferable. 1043 6.3 Cryptographically Strong Sequences 1045 In cases where a series of random quantities must be generated, an 1046 adversary may learn some values in the sequence. In general, they 1047 should not be able to predict other values from the ones that they 1048 know. 1050 The correct technique is to start with a strong random seed, take 1051 cryptographically strong steps from that seed [FERGUSON, SCHNEIER], 1052 and do not reveal the complete state of the generator in the sequence 1053 elements. If each value in the sequence can be calculated in a fixed 1054 way from the previous value, then when any value is compromised, all 1055 future values can be determined. This would be the case, for example, 1056 if each value were a constant function of the previously used values, 1057 even if the function were a very strong, non-invertible message 1058 digest function. 1060 (It should be noted that if your technique for generating a sequence 1061 of key values is fast enough, it can trivially be used as the basis 1062 for a confidentiality system. If two parties use the same sequence 1063 generating technique and start with the same seed material, they will 1064 generate identical sequences. These could, for example, be xorどヨed at 1065 one end with data being send, encrypting it, and xorどヨed with this 1066 data as received, decrypting it due to the reversible properties of 1067 the xor operation. This is commonly referred to as a simple stream 1068 cipher.) 1070 6.3.1 Traditional Strong Sequences 1072 A traditional way to achieve a strong sequence has been to have the 1073 values be produced by hashing the quantities produced by 1074 concatenating the seed with successive integers or the like and then 1075 mask the values obtained so as to limit the amount of generator state 1076 available to the adversary. 1078 It may also be possible to use an "encryption" algorithm with a 1079 random key and seed value to encrypt and feedback some or all of the 1080 output encrypted value into the value to be encrypted for the next 1081 iteration. Appropriate feedback techniques will usually be 1082 recommended with the encryption algorithm. An example is shown below 1083 where shifting and masking are used to combine the cypher output 1084 feedback. This type of feedback is defined by the US Government in 1085 connection with AES and DES [MODES] as Output Feedback Mode (OFM) but 1086 should be avoided for reasons described below. 1088 +---------------+ 1089 | V | 1090 | | n |--+ 1091 +--+------------+ | 1092 | | +---------+ 1093 shift| +---> | | +-----+ 1094 +--+ | Encrypt | <--- | Key | 1095 | +-------- | | +-----+ 1096 | | +---------+ 1097 V V 1098 +------------+--+ 1099 | V | | 1100 | n+1 | 1101 +---------------+ 1103 Note that if a shift of one is used, this is the same as the shift 1104 register technique described in Section 3 above but with the all 1105 important difference that the feedback is determined by a complex 1106 non-linear function of all bits rather than a simple linear or 1107 polynomial combination of output from a few bit position taps. 1109 It has been shown by Donald W. Davies that this sort of shifted 1110 partial output feedback significantly weakens an algorithm compared 1111 with feeding all of the output bits back as input. In particular, for 1112 DES, repeated encrypting a full 64 bit quantity will give an expected 1113 repeat in about 2^63 iterations. Feeding back anything less than 64 1114 (and more than 0) bits will give an expected repeat in between 2^31 1115 and 2^32 iterations! 1117 To predict values of a sequence from others when the sequence was 1118 generated by these techniques is equivalent to breaking the 1119 cryptosystem or inverting the "non-invertible" hashing involved with 1120 only partial information available. The less information revealed 1121 each iteration, the harder it will be for an adversary to predict the 1122 sequence. Thus it is best to use only one bit from each value. It has 1123 been shown that in some cases this makes it impossible to break a 1124 system even when the cryptographic system is invertible and can be 1125 broken if all of each generated value was revealed. 1127 6.3.2 The Blum Blum Shub Sequence Generator 1129 Currently the generator which has the strongest public proof of 1130 strength is called the Blum Blum Shub generator after its inventors 1131 [BBS]. It is also very simple and is based on quadratic residues. 1132 Itどヨs only disadvantage is that it is computationally intensive 1133 compared with the traditional techniques give in 6.3.1 above. This is 1134 not a major draw back if it is used for moderately infrequent 1135 purposes, such as generating session keys. 1137 Simply choose two large prime numbers, say p and q, which both have 1138 the property that you get a remainder of 3 if you divide them by 4. 1139 Let n = p * q. Then you choose a random number x relatively prime to 1140 n. The initial seed for the generator and the method for calculating 1141 subsequent values are then 1143 2 1144 s = ( x )(Mod n) 1145 0 1147 2 1148 s = ( s )(Mod n) 1149 i+1 i 1151 You must be careful to use only a few bits from the bottom of each s. 1152 It is always safe to use only the lowest order bit. If you use no 1153 more than the 1154 log ( log ( s ) ) 1155 2 2 i 1156 low order bits, then predicting any additional bits from a sequence 1157 generated in this manner is provable as hard as factoring n. As long 1158 as the initial x is secret, you can even make n public if you want. 1160 An interesting characteristic of this generator is that you can 1161 directly calculate any of the s values. In particular 1163 i 1164 ( ( 2 )(Mod (( p - 1 ) * ( q - 1 )) ) ) 1165 s = ( s )(Mod n) 1166 i 0 1168 This means that in applications where many keys are generated in this 1169 fashion, it is not necessary to save them all. Each key can be 1170 effectively indexed and recovered from that small index and the 1171 initial s and n. 1173 6.3.3 Entropy Pool Techniques 1175 Many modern pseudo-random number sources utilize the technique of 1176 maintaining a "pool" of bits and providing operations for strongly 1177 mixing input with some randomness into the pool and extracting psuedo 1178 random bits from the pool. This is illustrated in the figure below. 1180 +--------+ +------+ +---------+ 1181 --->| Mix In |--->| POOL |--->| Extract |---> 1182 | Bits | | | | Bits | 1183 +--------+ +------+ +---------+ 1184 ^ V 1185 | | 1186 +-----------+ 1188 Bits to be feed into the pool can be any of the various hardware, 1189 environmental, or user input sources discussed above. It is also 1190 common to save the state of the pool on system shut down and restore 1191 it on re-starting, if stable storage is available. 1193 Care must be taken that enough entropy has been added to the pool to 1194 support particular output uses desired. See Section 7.5 for more 1195 details on an example implementation and [RSA BULL1] for similar 1196 suggestions. 1198 7. Key Generation Standards and Examples 1200 Several public standards and widely deployed examples are now in 1201 place for the generation of keys without special hardware. Three 1202 standards are described below. The two older standards use DES, with 1203 its 64-bit block and key size limit, but any equally strong or 1204 stronger mixing function could be substituted. The third is a more 1205 modern and stronger standard based on SHA-1. Lastly the widely 1206 deployed modern UNIX random number generators are described. 1208 7.1 US DoD Recommendations for Password Generation 1210 The United States Department of Defense has specific recommendations 1211 for password generation [DoD]. They suggest using the US Data 1212 Encryption Standard [DES] in Output Feedback Mode [MODES] as follows: 1214 use an initialization vector determined from 1215 the system clock, 1216 system ID, 1217 user ID, and 1218 date and time; 1219 use a key determined from 1220 system interrupt registers, 1221 system status registers, and 1222 system counters; and, 1223 as plain text, use an external randomly generated 64 bit 1224 quantity such as 8 characters typed in by a system 1225 administrator. 1227 The password can then be calculated from the 64 bit "cipher text" 1228 generated by DES in 64-bit Output Feedback Mode. As many bits as are 1229 needed can be taken from these 64 bits and expanded into a 1230 pronounceable word, phrase, or other format if a human being needs to 1231 remember the password. 1233 7.2 X9.17 Key Generation 1235 The American National Standards Institute has specified a method for 1236 generating a sequence of keys as follows [X9.17]: 1238 s is the initial 64 bit seed 1239 0 1241 g is the sequence of generated 64 bit key quantities 1242 n 1244 k is a random key reserved for generating this key sequence 1246 t is the time at which a key is generated to as fine a resolution 1247 as is available (up to 64 bits). 1249 DES ( K, Q ) is the DES encryption of quantity Q with key K 1251 g = DES ( k, DES ( k, t ) .xor. s ) 1252 n n 1254 s = DES ( k, DES ( k, t ) .xor. g ) 1255 n+1 n 1257 If g sub n is to be used as a DES key, then every eighth bit should 1258 be adjusted for parity for that use but the entire 64 bit unmodified 1259 g should be used in calculating the next s. 1261 7.3 DSS Pseudo-Random Number Generation 1263 Appendix 3 of the NIST Digital Signature Standard [DSS] provides an 1264 approved method of producing a sequence of pseudo-random 160 bit 1265 quantities for use as private keys or the like. A subset of that 1266 algorithm is as follows: 1268 t = 0x 67452301 EFCDAB89 98BADCFE 10325476 C3D2E1F0 1270 q = a 160-bit prime number 1272 XKEY = initial seed 1273 0 1275 For j = 0 to ... 1277 XVAL = ( XKEY + optional user input ) (Mod 2^512) 1278 j 1280 X = G( t, XVAL ) (Mod q) 1281 j 1283 XKEY = ( 1 + XKEY + X ) (Mod 2^512) 1284 j+1 j j 1286 The quantities X thus produced are the pseudo-random sequence of 1287 values in the rang 0 to q. Two functions can be used for "G" above. 1288 Each produces a 160-bit value and takes two arguments, the first a 1289 160-bit value and the second a 512 bit value. 1291 The first is based on SHA-1 and works by setting the 5 linking 1292 variables, denoted H with subscripts in the SHA-1 specification, to 1293 the first argument divided into fifths. Then steps (a) through (e) of 1294 section 7 of the NIST SHA-1 specification are run over the second 1295 argument as if it were a 512-bit data block. The values of the 1296 linking variable after those steps are then concatenated to produce 1297 the output of G. [SHA-1] 1299 As an alternative second method, NIST also defined an alternate G 1300 function based on multiple applications of the DES encryption 1301 function [DSS]. 1303 7.4 X9.82 Pseudo-Random Number Generation 1305 The National Institute for Standards and Technology (NIST) and the 1306 American National Standards Institutes (ANSI) X9F1 committee are in 1307 the final stages of creating a standard for random number generation. 1308 This standard includes a number of random number generators for use 1309 with AES and other block ciphers. It also includes random number 1310 generators based on hash functions and the arithmetic of elliptic 1311 curves [X9.82]. 1313 7.5 The /dev/random Device 1315 Several versions of the UNIX operating system provides a kernel- 1316 resident random number generator. In some cases, these generators 1317 makes use of events captured by the Kernel during normal system 1318 operation. 1320 For example, on some versions of Linux, the generator consists of a 1321 random pool of 512 bytes represented as 128 words of 4-bytes each. 1322 When an event occurs, such as a disk drive interrupt, the time of the 1323 event is xorどヨed into the pool and the pool is stirred via a primitive 1324 polynomial of degree 128. The pool itself is treated as a ring 1325 buffer, with new data being XORed (after stirring with the 1326 polynomial) across the entire pool. 1328 Each call that adds entropy to the pool estimates the amount of 1329 likely true entropy the input contains. The pool itself contains a 1330 accumulator that estimates the total over all entropy of the pool. 1332 Input events come from several sources as listed below. 1333 Unfortunately, for server machines without human operators, the first 1334 and third are not available and entropy may be added very slowly in 1335 that case. 1337 1. Keyboard interrupts. The time of the interrupt as well as the scan 1338 code are added to the pool. This in effect adds entropy from the 1339 human operator by measuring inter-keystroke arrival times. 1341 2. Disk completion and other interrupts. A system being used by a 1342 person will likely have a hard to predict pattern of disk 1343 accesses. (But not all disk drivers support capturing this timing 1344 information with sufficient accuracy to be useful.) 1346 3. Mouse motion. The timing as well as mouse position is added in. 1348 When random bytes are required, the pool is hashed with SHA-1 [SHA1] 1349 to yield the returned bytes of randomness. If more bytes are required 1350 than the output of SHA-1 (20 bytes), then the hashed output is 1351 stirred back into the pool and a new hash performed to obtain the 1352 next 20 bytes. As bytes are removed from the pool, the estimate of 1353 entropy is similarly decremented. 1355 To ensure a reasonable random pool upon system startup, the standard 1356 startup scripts (and shutdown scripts) save the pool to a disk file 1357 at shutdown and read this file at system startup. 1359 There are two user exported interfaces. /dev/random returns bytes 1360 from the pool, but blocks when the estimated entropy drops to zero. 1361 As entropy is added to the pool from events, more data becomes 1362 available via /dev/random. Random data obtained from such a 1363 /dev/random device is suitable for key generation for long term keys, 1364 if enough random bits are in the pool or are added in a reasonable 1365 amount of time. 1367 /dev/urandom works like /dev/random, however it provides data even 1368 when the entropy estimate for the random pool drops to zero. This may 1369 be adequate for session keys or for other key generation tasks where 1370 blocking while waiting for more random bits is not acceptable. The 1371 risk of continuing to take data even when the poolどヨs entropy estimate 1372 is small in that past output may be computable from current output 1373 provided an attacker can reverse SHA-1. Given that SHA-1 is designed 1374 to be non-invertible, this is a reasonable risk. 1376 To obtain random numbers under Linux, Solaris, or other UNIX systems 1377 equipped with code as described above, all an application needs to do 1378 is open either /dev/random or /dev/urandom and read the desired 1379 number of bytes. 1381 (The Linux Random device was written by Theodore Tsどヨo. It was based 1382 loosely on the random number generator in PGP 2.X and PGP 3.0 (aka 1383 PGP 5.0).) 1385 8. Examples of Randomness Required 1387 Below are two examples showing rough calculations of needed 1388 randomness for security. The first is for moderate security passwords 1389 while the second assumes a need for a very high security 1390 cryptographic key. 1392 In addition [ORMAN] and [RSA BULL13] provide information on the 1393 public key lengths that should be used for exchanging symmetric keys. 1395 8.1 Password Generation 1397 Assume that user passwords change once a year and it is desired that 1398 the probability that an adversary could guess the password for a 1399 particular account be less than one in a thousand. Further assume 1400 that sending a password to the system is the only way to try a 1401 password. Then the crucial question is how often an adversary can try 1402 possibilities. Assume that delays have been introduced into a system 1403 so that, at most, an adversary can make one password try every six 1404 seconds. Thatどヨs 600 per hour or about 15,000 per day or about 1405 5,000,000 tries in a year. Assuming any sort of monitoring, it is 1406 unlikely someone could actually try continuously for a year. In fact, 1407 even if log files are only checked monthly, 500,000 tries is more 1408 plausible before the attack is noticed and steps taken to change 1409 passwords and make it harder to try more passwords. 1411 To have a one in a thousand chance of guessing the password in 1412 500,000 tries implies a universe of at least 500,000,000 passwords or 1413 about 2^29. Thus 29 bits of randomness are needed. This can probably 1414 be achieved using the US DoD recommended inputs for password 1415 generation as it has 8 inputs which probably average over 5 bits of 1416 randomness each (see section 7.1). Using a list of 1000 words, the 1417 password could be expressed as a three word phrase (1,000,000,000 1418 possibilities) or, using case insensitive letters and digits, six 1419 would suffice ((26+10)^6 = 2,176,782,336 possibilities). 1421 For a higher security password, the number of bits required goes up. 1422 To decrease the probability by 1,000 requires increasing the universe 1423 of passwords by the same factor which adds about 10 bits. Thus to 1424 have only a one in a million chance of a password being guessed under 1425 the above scenario would require 39 bits of randomness and a password 1426 that was a four word phrase from a 1000 word list or eight 1427 letters/digits. To go to a one in 10^9 chance, 49 bits of randomness 1428 are needed implying a five word phrase or ten letter/digit password. 1430 In a real system, of course, there are also other factors. For 1431 example, the larger and harder to remember passwords are, the more 1432 likely users are to write them down resulting in an additional risk 1433 of compromise. 1435 8.2 A Very High Security Cryptographic Key 1437 Assume that a very high security key is needed for symmetric 1438 encryption / decryption between two parties. Assume an adversary can 1439 observe communications and knows the algorithm being used. Within the 1440 field of random possibilities, the adversary can try key values in 1441 hopes of finding the one in use. Assume further that brute force 1442 trial of keys is the best the adversary can do. 1444 8.2.1 Effort per Key Trial 1446 How much effort will it take to try each key? For very high security 1447 applications it is best to assume a low value of effort. Even if it 1448 would clearly take tens of thousands of computer cycles or more to 1449 try a single key, there may be some pattern that enables huge blocks 1450 of key values to be tested with much less effort per key. Thus it is 1451 probably best to assume no more than a couple hundred cycles per key. 1452 (There is no clear lower bound on this as computers operate in 1453 parallel on a number of bits and a poor encryption algorithm could 1454 allow many keys or even groups of keys to be tested in parallel. 1455 However, we need to assume some value and can hope that a reasonably 1456 strong algorithm has been chosen for our hypothetical high security 1457 task.) 1459 If the adversary can command a highly parallel processor or a large 1460 network of work stations, 10^11 cycles per second is probably a 1461 minimum assumption for availability today. Looking forward a few 1462 years, there should be at least an order of magnitude improvement. 1463 Thus assuming 10^10 keys could be checked per second or 3.6*10^12 per 1464 hour or 6*10^14 per week or 2.4*10^15 per month is reasonable. This 1465 implies a need for a minimum of 63 bits of randomness in keys to be 1466 sure they cannot be found in a month. Even then it is possible that, 1467 a few years from now, a highly determined and resourceful adversary 1468 could break the key in 2 weeks (on average they need try only half 1469 the keys). 1471 These questions are considered in detail in "Minimal Key Lengths for 1472 Symmetric Ciphers to Provide Adequate Commercial Security: A Report 1473 by an Ad Hoc Group of Cryptographers and Computer Scientists" 1474 [KeyStudy] which was sponsored by the Business Software Alliance. It 1475 concluded that a reasonable key length in 1995 for very high security 1476 is in the range of 75 to 90 bits and, since the cost of cryptography 1477 does not vary much with they key size, recommends 90 bits. To update 1478 these recommendations, just add 2/3 of a bit per year for Mooreどヨs law 1480 [MOORE]. Thus, in the year 2004, this translates to a determination 1481 that a reasonable key length is in the 81 to 96 bit range. In fact, 1482 today, it is increasingly common to use keys longer than 96 bits, 1483 such as 128-bit (or longer) keys with AES and keys with effective 1484 lengths of 112-bits using triple-DES. 1486 8.2.2 Meet in the Middle Attacks 1488 If chosen or known plain text and the resulting encrypted text are 1489 available, a "meet in the middle" attack is possible if the structure 1490 of the encryption algorithm allows it. (In a known plain text attack, 1491 the adversary knows all or part of the messages being encrypted, 1492 possibly some standard header or trailer fields. In a chosen plain 1493 text attack, the adversary can force some chosen plain text to be 1494 encrypted, possibly by "leaking" an exciting text that would then be 1495 sent by the adversary over an encrypted channel.) 1497 An oversimplified explanation of the meet in the middle attack is as 1498 follows: the adversary can half-encrypt the known or chosen plain 1499 text with all possible first half-keys, sort the output, then half- 1500 decrypt the encoded text with all the second half-keys. If a match is 1501 found, the full key can be assembled from the halves and used to 1502 decrypt other parts of the message or other messages. At its best, 1503 this type of attack can halve the exponent of the work required by 1504 the adversary while adding a very large but roughly constant factor 1505 of effort. Thus, if this attack can be mounted, a doubling of the 1506 amount of randomness in the very strong key to a minimum of 192 bits 1507 (96*2) is required for the year 2004 based on the [KeyStudy] 1508 analysis. 1510 This amount of randomness is well beyond the limit of that in the 1511 inputs recommended by the US DoD for password generation and could 1512 require user typing timing, hardware random number generation, or 1513 other sources. 1515 The meet in the middle attack assumes that the cryptographic 1516 algorithm can be decomposed in this way but we can not rule that out 1517 without a deep knowledge of the algorithm. Even if a basic algorithm 1518 is not subject to a meet in the middle attack, an attempt to produce 1519 a stronger algorithm by applying the basic algorithm twice (or two 1520 different algorithms sequentially) with different keys may gain less 1521 added security than would be expected. Such a composite algorithm 1522 would be subject to a meet in the middle attack. 1524 Enormous resources may be required to mount a meet in the middle 1525 attack but they are probably within the range of the national 1526 security services of a major nation. Essentially all nations spy on 1527 other nations traffic. 1529 8.2.3 Other Considerations 1531 [KeyStudy] also considers the possibilities of special purpose code 1532 breaking hardware and having an adequate safety margin. 1534 It should be noted that key length calculations such at those above 1535 are controversial and depend on various assumptions about the 1536 cryptographic algorithms in use. In some cases, a professional with a 1537 deep knowledge of code breaking techniques and of the strength of the 1538 algorithm in use could be satisfied with less than half of the 192 1539 bit key size derived above. 1541 For further examples of conservative design principles see 1542 [FERGUSON]. 1544 9. Conclusion 1546 Generation of unguessable "random" secret quantities for security use 1547 is an essential but difficult task. 1549 Hardware techniques to produce such randomness would be relatively 1550 simple. In particular, the volume and quality would not need to be 1551 high and existing computer hardware, such as audio input or disk 1552 drives, can be used. 1554 Widely available computational techniques are available to process 1555 low quality random quantities from multiple sources or a larger 1556 quantity of such low quality input from one source and produce a 1557 smaller quantity of higher quality keying material. In the absence of 1558 hardware sources of randomness, a variety of user and software 1559 sources can frequently, with care, be used instead; however, most 1560 modern systems already have hardware, such as disk drives or audio 1561 input, that could be used to produce high quality randomness. 1563 Once a sufficient quantity of high quality seed key material (a 1564 couple of hundred bits) is available, computational techniques are 1565 available to produce cryptographically strong sequences of 1566 computationally unpredictable quantities from this seed material. 1568 10. Security Considerations 1570 The entirety of this document concerns techniques and recommendations 1571 for generating unguessable "random" quantities for use as passwords, 1572 cryptographic keys, initialization vectors, sequence numbers, and 1573 similar security uses. 1575 11. Copyright and Disclaimer 1577 Copyright (C) The Internet Society 2004. This document is subject to 1578 the rights, licenses and restrictions contained in BCP 78 and except 1579 as set forth therein, the authors retain all their rights. 1581 This document and the information contained herein are provided on an 1582 "AS IS" basis and THE CONTRIBUTOR, THE ORGANIZATION HE/SHE REPRESENTS 1583 OR IS SPONSORED BY (IF ANY), THE INTERNET SOCIETY AND THE INTERNET 1584 ENGINEERING TASK FORCE DISCLAIM ALL WARRANTIES, EXPRESS OR IMPLIED, 1585 INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE 1586 INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED 1587 WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. 1589 12. Appendix A: Changes from RFC 1750 1591 1. Additional acknowledgements have been added. 1593 2. Insertion of section 5.2.4 on de-skewing with S-boxes. 1595 3. Addition of section 5.4 on Ring Oscillator randomness sources. 1597 4. AES and the members of the SHA series producing more than 160 1598 bits have been added. Use of AES has been emphasized and the use 1599 of DES de-emphasized. 1601 5. Addition of section 6.3.3 on entropy pool techniques. 1603 6. Addition of section 7.3 on the pseudo-random number generation 1604 techniques given in FIPS 186-2, 7.4 on those given in X9.82, and 1605 section 7.5 on the random number generation techniques of the 1606 /dev/random device in Linux and other UNIX systems. 1608 7. Addition of references to the "Minimal Key Lengths for Symmetric 1609 Ciphers to Provide Adequate Commercial Security" study published 1610 in January 1996 [KeyStudy]. 1612 8. Added caveats to using Diffie-Hellman as a mixing function. 1614 9. Addition of references to the [TURBID] paper and system. 1616 10. Minor wording changes and reference updates. 1618 14. Informative References 1620 [AES] - "Specification of the Advanced Encryption Standard (AES)", 1621 United States of America, US National Institute of Standards and 1622 Technology, FIPS 197, November 2001. 1624 [ASYMMETRIC] - "Secure Communications and Asymmetric Cryptosystems", 1625 edited by Gustavus J. Simmons, AAAS Selected Symposium 69, Westview 1626 Press, Inc. 1628 [BBS] - "A Simple Unpredictable Pseudo-Random Number Generator", SIAM 1629 Journal on Computing, v. 15, n. 2, 1986, L. Blum, M. Blum, & M. Shub. 1631 [BRILLINGER] - "Time Series: Data Analysis and Theory", Holden-Day, 1632 1981, David Brillinger. 1634 [CRC] - "C.R.C. Standard Mathematical Tables", Chemical Rubber 1635 Publishing Company. 1637 [DAVIS] - "Cryptographic Randomness from Air Turbulence in Disk 1638 Drives", Advances in Cryptology - Crypto どヨ94, Springer-Verlag Lecture 1639 Notes in Computer Science #839, 1984, Don Davis, Ross Ihaka, and 1640 Philip Fenstermacher. 1642 [DES] - "Data Encryption Standard", US National Institute of 1643 Standards and Technology, FIPS 46-3, October 1999. 1644 - "Data Encryption Algorithm", American National Standards 1645 Institute, ANSI X3.92-1981. 1646 (See also FIPS 112, Password Usage, which includes FORTRAN 1647 code for performing DES.) 1649 [D-H] - RFC 2631, "Diffie-Hellman Key Agreement Method", Eric 1650 Rescrola, June 1999. 1652 [DNSSEC] - RFC 2535, "Domain Name System Security Extensions", D. 1653 Eastlake, March 1999. 1655 [DoD] - "Password Management Guideline", United States of America, 1656 Department of Defense, Computer Security Center, CSC-STD-002-85. 1657 (See also FIPS 112, Password Usage, which incorporates CSC-STD-002-85 1658 as one of its appendices.) 1660 [DSS] - "Digital Signature Standard (DSS)", US National Institute of 1661 Standards and Technology, FIPS 186-2, January 2000. 1663 [FERGUSON] - "Practical Cryptography", Niels Ferguson and Bruce 1664 Schneier, Wiley Publishing Inc., ISBN 047122894X, April 2003. 1666 [GIFFORD] - "Natural Random Number", MIT/LCS/TM-371, David K. 1667 Gifford, September 1988. 1669 [IEEE 802.11i] - "Amendment to Standard for Telecommunications and 1670 Information Exchange Between Systems - LAN/MAN Specific Requirements 1671 - Part 11: Wireless Medium Access Control (MAC) and physical layer 1672 (PHY) specifications: Medium Access Control (MAC) Security 1673 Enhancements", The Institute for Electrical and Electronics 1674 Engineers, January 2004. 1676 [IPSEC] - RFC 2401, "Security Architecture for the Internet 1677 Protocol", S. Kent, R. Atkinson, November 1998. 1679 [KAUFMAN] - "Network Security: Private Communication in a Public 1680 World", Charlie Kaufman, Radia Perlman, and Mike Speciner, Prentis 1681 Hall PTR, ISBN 0-13-046019-2, 2nd Edition 2002. 1683 [KeyStudy] - "Minimal Key Lengths for Symmetric Ciphers to Provide 1684 Adequate Commercial Security: A Report by an Ad Hoc Group of 1685 Cryptographers and Computer Scientists", M. Blaze, W. Diffie, R. 1686 Rivest, B. Schneier, T. Shimomura, E. Thompson, and M. Weiner, 1687 January 1996, . 1689 [KNUTH] - "The Art of Computer Programming", Volume 2: Seminumerical 1690 Algorithms, Chapter 3: Random Numbers. Addison Wesley Publishing 1691 Company, 3rd Edition November 1997, Donald E. Knuth. 1693 [KRAWCZYK] - "How to Predict Congruential Generators", Journal of 1694 Algorithms, V. 13, N. 4, December 1992, H. Krawczyk 1696 [MAIL PEM] - RFCs 1421 through 1424: 1697 - RFC 1421, Privacy Enhancement for Internet Electronic Mail: 1698 Part I: Message Encryption and Authentication Procedures, 02/10/1993, 1699 J. Linn 1700 - RFC 1422, Privacy Enhancement for Internet Electronic Mail: 1701 Part II: Certificate-Based Key Management, 02/10/1993, S. Kent 1702 - RFC 1423, Privacy Enhancement for Internet Electronic Mail: 1703 Part III: Algorithms, Modes, and Identifiers, 02/10/1993, D. Balenson 1704 - RFC 1424, Privacy Enhancement for Internet Electronic Mail: 1705 Part IV: Key Certification and Related Services, 02/10/1993, B. 1706 Kaliski 1708 [MAIL PGP] 1709 - RFC 2440, "OpenPGP Message Format", J. Callas, L. 1710 Donnerhacke, H. Finney, R. Thayer", November 1998. 1711 - RFC 3156, "MIME Security with OpenPGP" M. Elkins, D. Del 1712 Torto, R. Levien, T. Roessler, August 2001. 1714 [MAIL S/MIME] - RFCs 2632 through 2634: 1715 - RFC 2632, "S/MIME Version 3 Certificate Handling", B. 1716 Ramsdell, Ed., June 1999. 1717 - RFC 2633, "S/MIME Version 3 Message Specification", B. 1718 Ramsdell, Ed., June 1999. 1720 - RFC 2634, "Enhanced Security Services for S/MIME" P. 1721 Hoffman, Ed., June 1999. 1723 [MD4] - "The MD4 Message-Digest Algorithm", RFC1320, April 1992, R. 1724 Rivest 1726 [MD5] - "The MD5 Message-Digest Algorithm", RFC1321, April 1992, R. 1727 Rivest 1729 [MODES] - "DES Modes of Operation", US National Institute of 1730 Standards and Technology, FIPS 81, December 1980. 1731 - "Data Encryption Algorithm - Modes of Operation", American 1732 National Standards Institute, ANSI X3.106-1983. 1734 [MOORE] - Mooreどヨs Law: the exponential increase in the logic density 1735 of silicon circuits. Originally formulated by Gordon Moore in 1964 as 1736 a doubling every year starting in 1962, in the late 1970s the rate 1737 fell to a doubling every 18 months and has remained there through the 1738 date of this document. See "The New Hackerどヨs Dictionary", Third 1739 Edition, MIT Press, ISBN 0-262-18178-9, Eric S. Raymond, 1996. 1741 [ORMAN] - "Determining Strengths For Public Keys Used For Exchanging 1742 Symmetric Keys", draft-orman-public-key-lengths-*.txt, Hilarie Orman, 1743 Paul Hoffman, work in progress. 1745 [RFC 1750] - "Randomness Requirements for Security", D. Eastlake, S. 1746 Crocker, J. Schiller, December 1994. 1748 [RSA BULL1] - "Suggestions for Random Number Generation in Software", 1749 RSA Laboratories Bulletin #1, January 1996. 1751 [RSA BULL13] - "A Cost-Based Security Analysis of Symmetric and 1752 Asymmetric Key Lengths", RSA Laboratories Bulletin #13, Robert 1753 Silverman, April 2000 (revised November 2001). 1755 [SBOX1] - "Practical s-box design", S. Mister, C. Adams, Selected 1756 Areas in Cryptography, 1996. 1758 [SBOX2] - "Perfect Non-linear S-boxes", K. Nyberg, Advances in 1759 Cryptography - Eurocrypt どヨ91 Proceedings, Springer-Verland, 1991. 1761 [SCHNEIER] - "Applied Cryptography: Protocols, Algorithms, and Source 1762 Code in C", 2nd Edition, John Wiley & Sons, 1996, Bruce Schneier. 1764 [SHANNON] - "The Mathematical Theory of Communication", University of 1765 Illinois Press, 1963, Claude E. Shannon. (originally from: Bell 1766 System Technical Journal, July and October 1948) 1768 [SHIFT1] - "Shift Register Sequences", Aegean Park Press, Revised 1769 Edition 1982, Solomon W. Golomb. 1771 [SHIFT2] - "Cryptanalysis of Shift-Register Generated Stream Cypher 1772 Systems", Aegean Park Press, 1984, Wayne G. Barker. 1774 [SHA-1] - "Secure Hash Standard (SHA-1)", US National Institute of 1775 Science and Technology, FIPS 180-1, April 1993. 1776 - RFC 3174, "US Secure Hash Algorithm 1 (SHA1)", D. Eastlake, 1777 P. Jones, September 2001. 1779 [SHA-2] - "Secure Hash Standard", Draft (SHA-2156/384/512), US 1780 National Institute of Science and Technology, FIPS 180-2, not yet 1781 issued. 1783 [SSH] - draft-ietf-secsh-*, work in progress. 1785 [STERN] - "Secret Linear Congruential Generators are not 1786 Cryptographically Secure", Proceedings of IEEE STOC, 1987, J. Stern. 1788 [TLS] - RFC 2246, "The TLS Protocol Version 1.0", T. Dierks, C. 1789 Allen, January 1999. 1791 [TURBID] - "High Entropy Symbol Generator", John S. Denker, 1792 , 2003. 1794 [USENET] - RFC 977, "Network News Transfer Protocol", B. Kantor, P. 1795 Lapsley, February 1986. 1796 - RFC 2980, "Common NNTP Extensions", S. Barber, October 1797 2000. 1799 [VON NEUMANN] - "Various techniques used in connection with random 1800 digits", von Neumannどヨs Collected Works, Vol. 5, Pergamon Press, 1963, 1801 J. von Neumann. 1803 [X9.17] - "American National Standard for Financial Institution Key 1804 Management (Wholesale)", American Bankers Association, 1985. 1806 [X9.82] - "Random Number Generation", ANSI X9F1, work in progress. 1808 Authors Addresses 1810 Donald E. Eastlake 3rd 1811 Motorola Laboratories 1812 155 Beaver Street 1813 Milford, MA 01757 USA 1815 Telephone: +1 508-786-7554 (w) 1816 +1 508-634-2066 (h) 1817 EMail: Donald.Eastlake@motorola.com 1819 Jeffrey I. Schiller 1820 MIT, Room E40-311 1821 77 Massachusetts Avenue 1822 Cambridge, MA 02139-4307 USA 1824 Telephone: +1 617-253-0161 1825 E-mail: jis@mit.edu 1827 Steve Crocker 1829 EMail: steve@stevecrocker.com 1831 File Name and Expiration 1833 This is file draft-eastlake-randomness2-08.txt. 1835 It expires February 2005.