[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: K2 images



"Alfred M. Szmidt" <ams@kemisten.nu> writes:

> Care to say more about how lsh gatheres its random bits? How good are
> they?

The quality is quite system dependent, so in general, it's hard to
guarantee anything more than "better than nothing".

The current sources are:

  /dev/random or /dev/urandom, whichever one exists.

    It reads 40 bytes, and counts the data as 160 bits of entropy.

  System state, netstat, vmstat, etc.

    Entropy counts are reasonably conservative but not strict in any
    mathematic sense. They depend on the amount of output and on which
    command is running.

If we have at least 160 bits of entropy from *each* of those two
sources, that's all entropy that is used. If not, the user is asked to
type randomly, for a third source of about 160 bits of entropy.

I've considered to also, in the root case, read and hash the contents
of the raw devices that the partitions /tmp and /var are located on,
but I've not written that code. It seems that the easiest way to do
that portably is to use something like

  system("cat `df /var /tmp | awk some script`");

which isn't particularly pretty.

I would like to also, in the root case, read and hash all the physical
memory, but there's no portable way to do that either. Reading
/dev/mem might work on most x86 machines, but in general it can cause
the machine to emit blue smoke.

All this is done by the lsh-make-seed program,
http://cvs.lysator.liu.se/viewcvs/viewcvs.cgi/lsh/src/lsh-make-seed.c?rev=HEAD&cvsroot=lsh&content-type=text/vnd.viewcvs-markup

Regards,
/Niels



Reply to: