[2012-06-03 20:48:21 +0200] Tobias Powalowski: > with enabling pacman signing, shouldn't we add the rng-tools to extra to > be able to use it on install media too?
For interactive installers, it seems to me like a better solution to simply ask the user to provide true entropy through typing random stuff on their keyboards - shouldn't take more than twenty seconds or so. For virtual machines, I use the stupid code attached to transfer entropy from the host to the guest. I don't know rng-tools but if it better answers either problem it would indeed be nice to have it in [extra]. > Or is there any way to generate > entropy without it and without user interaction? Linux gathers entropy from IDE timings, so any kind of disk activity will refill the pool over time. Cheers. -- Gaetan
/*
scp crap_pool.c vm:
ssh vm cc -o crap_pool crap_pool.c
head -c 37k /dev/urandom | ssh vm sudo ./crap_pool
*/
#include <stdlib.h>
#include <fcntl.h>
#include <linux/random.h>
#define BUFSIZE 16384
#define ENTROPY 4096
int main (int argc, char *argv[]) {
int i;
struct rand_pool_info *rand = malloc(sizeof(struct rand_pool_info) + BUFSIZE);
rand->buf_size = BUFSIZE;
rand->entropy_count = ENTROPY;
for (i=0;i<BUFSIZE;i++) (rand->buf)[i]=getchar();
int fd = open("/dev/random", O_WRONLY);
ioctl(fd, RNDADDENTROPY, rand);
close(fd);
return 0;
}
pgpFij9eeMN2G.pgp
Description: PGP signature

