Annotation of www/crypto.html, Revision 1.34
1.10 deraadt 1: <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML Strict Level 2//EN//2.0">
1.1 deraadt 2: <html>
3: <head>
1.10 deraadt 4: <title>Cryptography in OpenBSD</title>
1.1 deraadt 5: <link rev=made href=mailto:www@openbsd.org>
6: <meta name="resource-type" content="document">
1.10 deraadt 7: <meta name="description" content="OpenBSD cryptography">
8: <meta name="keywords" content="openbsd,cryptography">
1.1 deraadt 9: <meta name="distribution" content="global">
10: <meta name="copyright" content="This document copyright 1997 by OpenBSD.">
11: </head>
12:
13: <BODY BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#23238E">
14:
1.22 deraadt 15: <img alt="[OpenBSD]" height=200 width=200 SRC="images/blowfish.jpg">
1.1 deraadt 16:
1.32 deraadt 17: <h3><font color=#e00000><strong>Cryptography</strong></font></h3>
18: <hr>
19:
20: <strong>Index</strong><br>
21: <a href=#why>Why do we ship cryptography?</a>.<br>
22: <a href=#disclosure>Full Disclosure policy</a>.<br>
23: <a href=#process>Source code auditing process</a>.<br>
24:
25: <a href=#prng>Pseudo Random Number Generators</a> (PRNG): ARC4, ...<br>
26: <a href=#hash>Cryptographic Hash Functions</a>: MD5, SHA1, ...<br>
27: <a href=#trans>Cryptographic Transforms</a>: DES, Blowfish, ...<br>
28:
29: <a href=#people>International Cryptographers wanted</a><br>
1.33 deraadt 30: <a href=#papers>Further Reading</a><br>
1.1 deraadt 31: <p>
1.32 deraadt 32: <hr>
33:
34: <dl>
35: <a name=why></a>
36: <li><h3><font color=#e00000><strong>Why do we ship cryptography?</strong></font></h3><p>
37:
38: In three words: <strong>because we can</strong>.<p>
39:
1.1 deraadt 40: The OpenBSD project is based in Canada.<p>
41:
1.23 deraadt 42: The <a href=ECL.html>Export Control List of Canada</a>
43: places no significant restriction on the export of
1.5 deraadt 44: cryptographic software, and is even more explicit about the free
45: export of freely-available cryptographic software. Marc Plumb has
46: done
1.2 deraadt 47: <a href=http://insight.mcmaster.ca/org/efc/pages/doc/crypto-export.html>
1.31 aaron 48: some research to test the cryptographic laws</a>.
1.2 deraadt 49: <p>
1.1 deraadt 50:
1.3 deraadt 51: Hence the OpenBSD project has embedded cryptography into numerous places
52: in the operating system. We require that the cryptographic software we
53: use be <a href=policy.html>freely available and with good licenses</a>.
1.32 deraadt 54: We do not directly use cryptography with nasty patents.
1.13 deraadt 55: We also require that such software is from countries with useful export
1.16 deraadt 56: licenses because we do not wish to break the laws of any country.
57: The cryptographic software components which we use currently were
58: written in Argentina, Australia, Canada, Germany, Greece, Norway, and
59: Sweden.
60: <p>
1.7 deraadt 61:
1.15 deraadt 62: When we create OpenBSD releases or snapshots we build our release
63: binaries in free countries to assure that the sources and binaries we
64: provide to users are free of tainting. In the past our release binary
65: builds have been done in Canada, Sweden, and Germany.<p>
66:
1.16 deraadt 67: OpenBSD ships with Kerberos IV included. The codebase we use is the
1.17 deraadt 68: exportable KTH-based release from Sweden. Our X11 source has been
69: extended to make use of Kerberos IV as well. Kerberos V support will
1.16 deraadt 70: perhaps appear in 1999, but at present time a freely exportable
71: Kerberos V release does not exist.<p>
72:
1.15 deraadt 73: Today cryptography is an important means for enhancing the <a
74: href=security.html>security</a> of an operating system. The
75: cryptography utilized in OpenBSD can be classified into three
1.33 deraadt 76: different aspects, which will be described later.<p>
1.10 deraadt 77:
78: <p>
1.18 deraadt 79: <a name=prng></a>
1.32 deraadt 80: <li><h3><font color=#e00000><strong>Pseudo Random Number Generators</strong></font></h3><p>
81:
1.10 deraadt 82: A Pseudo Random Number Generator (PRNG) provides applications with a stream of
83: numbers which have certain important properties for system security:<p>
84:
85: <ul>
1.11 deraadt 86: <li>It should be impossible for an outsider to predict the output of the
87: random number generator even with knowledge of previous output.
88: <li>The generated numbers should not have repeating patterns which means
89: the PRNG should have a very long cycle length.
1.10 deraadt 90: </ul>
1.32 deraadt 91: <p>
1.10 deraadt 92:
1.13 deraadt 93: A PRNG is normally just an algorithm where the same initial starting
94: values will yield the same sequence of outputs. On a multiuser
95: operating system there are many sources which allow seeding the PRNG
96: with random data. The OpenBSD kernel uses the mouse interrupt timing,
97: network data interrupt latency, inter-keypress timing and disk IO
98: information to fill an entropy pool. Random numbers are available for
99: kernel routines and are exported via devices to userland programs.
100: So far random numbers are used in the following places<p>
101:
1.10 deraadt 102: <ul>
1.14 deraadt 103: <li>Dynamic sin_port allocation in bind(2).
104: <li>PIDs of processes.
1.26 aaron 105: <li>IP datagram IDs.
1.14 deraadt 106: <li>RPC transaction IDs (XID).
107: <li>NFS RPC transaction IDs (XID).
108: <li>DNS Query-IDs.
109: <li>Inode generation numbers, see getfh(2) and fsirand(8).
1.31 aaron 110: <li>Timing perturbance in traceroute(8).
1.14 deraadt 111: <li>Stronger temporary names for mktemp(3) and mkstemp(3)
112: <li>Randomness added to the TCP ISS value for protection against
113: spoofing attacks.
1.29 deraadt 114: <li>random padding in IPSEC esp_old packets.
1.14 deraadt 115: <li>To generate salts for the various password algorithms.
116: <li>For generating fake S/Key challenges.
1.28 angelos 117: <li>In <a href=http://wserver.physnet.uni-hamburg.de/provos/photuris/>photurisd</a>
118: and <a href=http://www.openbsd.org/cgi-bin/man.cgi?query=isakmpd>isakmpd</a>
119: to provide liveness proof of key exchanges.
1.10 deraadt 120: </ul>
1.1 deraadt 121:
1.10 deraadt 122: <p>
1.18 deraadt 123: <a name=hash></a>
1.32 deraadt 124: <li><h3><font color=#e00000><strong>Cryptographic Hash Functions</strong></font></h3><p>
125:
1.10 deraadt 126: A Hash Function compresses its input data to a string of
127: constant size. For a Cryptographic Hash Function it is infeasible to find
1.1 deraadt 128: <ul>
1.11 deraadt 129: <li>two inputs which have the same output (collision resistant),
130: <li>a different input for a given input with the same output
131: (2nd preimage resistant).
1.1 deraadt 132: </ul>
1.32 deraadt 133: <p>
1.10 deraadt 134:
1.12 millert 135: In OpenBSD MD5, SHA1, and RIPEMD-160 are used as Cryptographic Hash Functions,
136: e.g.
1.10 deraadt 137: <ul>
1.27 deraadt 138: <li>In <a href=http://www.openbsd.org/cgi-bin/man.cgi?query=skey>S/Key</a>
139: to provide one time passwords.
140: <li>In <a href=http://www.openbsd.org/cgi-bin/man.cgi?query=ipsec>IPsec</a>,
141: <a href=http://wserver.physnet.uni-hamburg.de/provos/photuris/>photurisd</a>
142: and
143: <a href=http://www.openbsd.org/cgi-bin/man.cgi?query=isakmpd>isakmpd(8)</a>
144: to authenticate the data origin of packets and to ensure packet integrity.
145: <li>For FreeBSD-style MD5 passwords (not enabled by default), see
146: <a href=http://www.openbsd.org/cgi-bin/man.cgi?query=passwd.conf&sektion=5>
147: passwd.conf(5)</a>
148: <li>For TCP SYN cookie support (not enabled by default), see
149: <a href=http://www.openbsd.org/cgi-bin/man.cgi?query=options&sektion=4>
150: options(4)</a>
1.24 niklas 151: <li>In libssl for digital signing of messages.
1.10 deraadt 152: </ul>
1.32 deraadt 153: <p>
1.10 deraadt 154:
1.6 deraadt 155: <p>
1.18 deraadt 156: <a name=trans></a>
1.32 deraadt 157: <li><h3><font color=#e00000><strong>Cryptographic Transforms</strong></font></h3><p>
158:
1.11 deraadt 159: Cryptographic Transforms are used to encrypt and decrypt data. These
160: are normally used with an encryption key for data encryption and with
161: a decryption key for data decryption. The security of a Cryptographic
162: Transform should rely only on the keying material.<p>
1.6 deraadt 163:
1.24 niklas 164: OpenBSD provides transforms like DES, 3DES, Blowfish and Cast for the
165: kernel and userland programs, which are used in many places like
1.10 deraadt 166: <ul>
1.27 deraadt 167: <li>In libc for creating
168: <a href=http://www.openbsd.org/cgi-bin/man.cgi?query=blf_key>Blowfish</a>
1.33 deraadt 169: passwords. See also the <a href=papers/bcrypt-paper.ps>USENIX paper</a>
170: on this topic.
1.27 deraadt 171: <li>In
172: <a href=http://www.openbsd.org/cgi-bin/man.cgi?query=ipsec>IPsec</a>
173: to provide confidentiality for the network layer.
174: <li>In Kerberos and a handful of kerberized applications, like
175: <a href=http://www.openbsd.org/cgi-bin/man.cgi?query=telnet>telnet</a>,
176: <a href=http://www.openbsd.org/cgi-bin/man.cgi?query=cvs>cvs</a>,
177: <a href=http://www.openbsd.org/cgi-bin/man.cgi?query=rsh>rsh</a>,
178: <a href=http://www.openbsd.org/cgi-bin/man.cgi?query=rcp>rcp</a>,
179: and
180: <a href=http://www.openbsd.org/cgi-bin/man.cgi?query=rlogin>rlogin</a>.
1.24 niklas 181: <li>In <a href=http://wserver.physnet.uni-hamburg.de/provos/photuris/>
1.27 deraadt 182: photurisd</a> and
183: <a href=http://www.openbsd.org/cgi-bin/man.cgi?query=isakmpd>isakmpd</a>
184: to protect the exchanges where IPsec key material is negotiated.
1.24 niklas 185: <li>In AFS to protect the messages passing over the network, providing
1.27 deraadt 186: confidentiality of remote filesystem access.
1.24 niklas 187: <li>In libssl to let applications communicate over the de-facto standard
188: cryptographically secure SSL protocol.
1.10 deraadt 189: </ul>
1.1 deraadt 190:
1.10 deraadt 191: <p>
1.32 deraadt 192: <a name=people></a>
193: <li><h3><font color=#e00000><strong>International Cryptographers Wanted</strong></font></h3><p>
194:
195: Of course, our project needs people to work on these systems. If any
196: non-American cryptographer who meets the constraints listed earlier is
197: interested in helping out with embedded cryptography in OpenBSD,
198: please contact us.<p>
199:
1.33 deraadt 200: <p>
201: <a name=papers></a>
202: <li><h3><font color=#e00000><strong>Further Reading</strong></font></h3><p>
203:
204: A number of papers have been written by OpenBSD team members, about
205: cryptographic changes they have done in OpenBSD. The postscript
1.34 ! deraadt 206: versions of these documents are available as follows.<p>
1.33 deraadt 207:
208: <ul>
209: <li>A Future-Adaptable Password Scheme
210: Niels Provos, David Mazieres.<br>
211: <a href=papers/bcrypt-paper.ps>paper</a> and
212: <a href=papers/bcrypt-slides.ps>slides</a>.
213: <li>Cryptography in OpenBSD: An Overview<br>
214: Theo de Raadt, Niklas Hallqvist, Artur Grabowski,
215: Angelos D. Keromytis, Niels Provos.<br>
216: <a href=papers/crypt-paper.ps>paper</a> and
217: <a href=papers/crypt-slides.ps>slides</a>.
218: <li>strlcpy and strlcat -- consistent, safe, string copy and concatenation.
219: Todd C. Miller, Theo de Raadt.<br>
220: <a href=papers/strlcpy-paper.ps>paper</a> and
221: <a href=papers/strlcpy-slides.ps>slides</a>.
222: </ul>
223:
1.32 deraadt 224: </dl>
225:
226: <p>
1.1 deraadt 227: <hr>
1.19 pauls 228: <a href=/index.html><img height=24 width=24 src=back.gif border=0 alt=OpenBSD></a>
1.10 deraadt 229: <a href=mailto:www@openbsd.org>www@openbsd.org</a>
230: <br>
1.34 ! deraadt 231: <small>$OpenBSD: crypto.html,v 1.33 1999/09/22 06:00:52 deraadt Exp $</small>
1.1 deraadt 232:
1.10 deraadt 233: </body>
234: </html>