From: Damian Yerrick Newsgroups: comp.os.msdos.programmer,comp.os.msdos.djgpp Subject: Re: Uptime and entropy in DOS Organization: Pin Eight Software http://pineight.8m.com/ Message-ID: References: <38A420E4 DOT 27CA35B2 AT americasm01 DOT nt DOT com> <38A4450C DOT 31C58BC AT hns DOT com> <38A45BBF DOT 845CE314 AT americasm01 DOT nt DOT com> X-Newsreader: Forte Agent 1.7/32.534 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Lines: 35 X-Trace: /bNDCy3F8vw92L6L2tJ5GF4gP9Ylh2SR9DYFjQbDpcH1Z1G8IbxUmyvopiBJbLxOL2qxoEsZi5kX!fpBweKbM7fL+mWGfpJgx7Cf7YOdm+q3TpaU0N/eO/rdEqaJ65HHvBT6+Q9w+1N+uiu1afGcb0Q6k!uU6nX6M= X-Complaints-To: abuse AT gte DOT net X-Abuse-Info: Please be sure to forward a copy of ALL headers X-Abuse-Info: Otherwise we will be unable to process your complaint properly NNTP-Posting-Date: Sat, 12 Feb 2000 03:50:09 GMT Distribution: world Date: Sat, 12 Feb 2000 03:50:09 GMT To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com On Fri, 11 Feb 2000 13:58:07 -0500, "Campbell, Rolf [SKY:1U32:EXCH]" wrote: >Link Hochnadel wrote: > >> "Campbell, Rolf [SKY:1U32:EXCH]" wrote: >> > >> > Damian Yerrick wrote: >> > >> > > Is it possible to get the uptime of a DOS system? I need more entropy >> > > than the 32 bits I get from time(NULL) to initialize a pseudorandom >> > > number generator. Is there a predictable way to get at least 64 bits >> > > of entropy? >> Flip the bits end-to-end, then multiply both values to get 64 bits. > > That will only be 32-bit's of entropy in a 64-bit container. It would be >just as effective to assign the upper 32-bits some constant (like >0xdeadbeef). Which is a famous graphics library author's speedh AT ck password. Anyway, how do I read these lower 32 bits of entropy? And what about 486s that lack the instruction? And what about portability? (I am isolating and minimizing code that relies on a specific architecture.) Are there other sources of entropy? 1. lower 16 bits of unix datetime 2. lower 32 bits of CPU uptime (Pentiums only) 3. __________________________________ -- Damian Yerrick http://yerricde.tripod.com/ Comment on story ideas: http://home1.gte.net/frodo/quickjot.html AOL is sucks! Find out why: http://anti-aol.org/faqs/aas/ View full sig: http://www.rose-hulman.edu/~yerricde/sig.html