From owner-freebsd-hackers Tue Aug 1 21:16: 9 2000 Delivered-To: freebsd-hackers@freebsd.org Received: from critter.freebsd.dk (critter.freebsd.dk [212.242.40.131]) by hub.freebsd.org (Postfix) with ESMTP id DA99937BFDE for ; Tue, 1 Aug 2000 21:15:57 -0700 (PDT) (envelope-from phk@critter.freebsd.dk) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.9.3/8.9.3) with ESMTP id GAA13362; Wed, 2 Aug 2000 06:15:41 +0200 (CEST) (envelope-from phk@critter.freebsd.dk) To: John Cochran Cc: freebsd-hackers@FreeBSD.ORG Subject: Re: How to make *real* random bits. In-reply-to: Your message of "Tue, 01 Aug 2000 16:16:00 EDT." <200008012016.QAA34620@smof.fiawol.org> Date: Wed, 02 Aug 2000 06:15:41 +0200 Message-ID: <13360.965189741@critter.freebsd.dk> From: Poul-Henning Kamp Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG In message <200008012016.QAA34620@smof.fiawol.org>, John Cochran writes: > [snip...] > >> If I generate true random bits it takes 3 timestamps to get one >> bit of randomness: >> >> T1: Time of event 1 >> T2: Time of event 2 >> T3: Time of event 3 >> >> if (T2 - T1 > T3 - T2) >> return 0; >> else if (T2 - T1 < T3 - T2) >> return 1; >> else >> try again. >> >> In my rather crude setup it produces about 5 bits per second [3]. > >It seems to me that if you get about 15 events per second, then you >should be able to produce about 7 to 8 random bits per second instead >of only 5. What you're looking for is the difference (greater or less) >between events. Because of this your T3 value can be considered the T1 >value for the next random bit you generate. No it cannot. If you did that then the probability would skew from bit to bit. If the (t3-t2) was large bit N == 1 and the probability of bit N+1 == 0 is > .5 then. -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD coreteam member | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message