Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watnot!watmath!clyde!rutgers!princeton!allegra!ulysses!faline!karn From: karn@faline.UUCP Newsgroups: sci.math,sci.physics,sci.crypt,sci.math.stat Subject: Re: Do you use RANDOM NUMBERS? Message-ID: <438@faline.UUCP> Date: Mon, 23-Mar-87 17:33:58 EST Article-I.D.: faline.438 Posted: Mon Mar 23 17:33:58 1987 Date-Received: Sat, 28-Mar-87 02:16:37 EST References: <5712@reed.UUCP> <4397@utcsri.UUCP> Organization: Bell Communications Research, Inc Lines: 39 Xref: utgpu sci.math:770 sci.physics:966 sci.crypt:259 sci.math.stat:85 Summary: random numbers and encryption keys "Anyone who uses deterministic computer techniques to generate random numbers is, of course, living in a state of sin" -John von Neumann (quoted from memory) > For DES keys I use a set of "Dungeons and Dragons" dice and a backgammon > cup.... Not being into D&D, I use a pair of ordinary 6-sided dice. Roll one die from each hand, being careful to keep them separate. If a die comes up 5 or 6, roll it again. Now you will have a pair of numbers ranging from 1 to 4 which I will call L and H. Compute (L-1)*4 + (R-1). The result is a single 4-bit number evenly distributed between 0 and 15. Repeat 16 times and you'll have your DES key. With a little practice this becomes pretty quick. Speaking of DES, I have taken the public-domain DES posted to net.sources a while back and worked on it a bit. It now runs a lot faster, thanks to operations on longs instead of 8-bit-bytes. (It is, nevertheless, still portable as long as you set the LITTLE_ENDIAN flag appropriately before compiling). You first call an initialization function; this takes an argument saying whether you want standard DES (slow) or DES without the initial and final permutations (faster and just as secure, but incompatible with hardware chips). This function allocates space for and precomputes a number of internal tables for things like combined S and P boxes. When done, you call another function to free the internal table space. I have written a few applications around it, including "descert", which takes the NBS test data posted a while back and verifies the DES function; "des", an encrypt/decrypt filter functionally compatible with the Sun Micro command of the same name; "descalc", a simple program for interactively encrypting and decrypting single blocks of hex data; "radlogin", an experimental DES-authenticated UNIX login program for amateur packet radio. The whole bunch works fine on the PC as well as under UNIX on both big-endian and little-endian machines. I'll post the combination to the net as soon as I figure out what newsgroup I'm supposed to use. Phil