/* 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 #include #include #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;ibuf)[i]=getchar(); int fd = open("/dev/random", O_WRONLY); ioctl(fd, RNDADDENTROPY, rand); close(fd); return 0; }