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