Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 01 Oct 1995 14:30:50 +0200
From:      Mark Murray <mark@grondar.za>
To:        Bruce Evans <bde@zeta.org.au>
Cc:        hackers@freebsd.org, mark@grondar.za
Subject:   Re: How to get to the hardware? 
Message-ID:  <199510011230.OAA04285@grumble.grondar.za>

next in thread | raw e-mail | index | archive | help
> This is much the same as calling microtime() or gettimeofday() and
> and getting "random" bits from (tv_usec & 1) and (tv_usec & (1 << 7))
> (here 7 is an approximation to (1e6 / TIMER_FREQ) * 8)).  These bits
> are actually extremely non-random.  They can be predicted as accurately
> as the current time if their values at a previous time are known.  Thus
> they are insignificantly more random than the current time in
> microseconds.  More investigation is required to find a source of
> random bits.

I suspected so. I think the code had better stay out as time is
already used.

More questions; where would be a good place to call these: (I am
having a large problem with the add_interrupt_randomness one)

 * Exported interfaces ---- input
 * ==============================
 *
 * The two current exported interfaces for gathering environmental
 * noise from the devices are:
 * 
 * 	void add_keyboard_randomness(unsigned char scancode);
 * 	void add_interrupt_randomness(int irq);
 * 
 * The first function uses the inter-keypress timing, as well as the
 * scancode as random inputs into the "entropy pool".
 *
 * The second function uses the inter-interrupt timing as random
 * inputs to the entropy pool.  Note that not all interrupts are good
 * sources of randomness!  For example, the timer interrupts is not a
 * good choice, because the periodicity of the interrupts is to
 * regular, and hence predictable to an attacker.  Disk interrupts are
 * a better measure, since the timing of the disk interrupts are more
 * unpredictable.  The routines try to estimate how many bits of
 * randomness a particular interrupt channel offers, by keeping track
 * of the first and second order deltas in the interrupt timings.

BTW - would you be prepared to review this code before committal?

M
--
Mark Murray
46 Harvey Rd, Claremont, Cape Town 7700, South Africa
+27 21 61-3768 GMT+0200
Finger mark@grumble.grondar.za for PGP key



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199510011230.OAA04285>