Use /dev/random(requires user input, such as mouse movement) or /dev/urandom. The latter has an entropy pool and does not require any user input if the pool is empty.
You can read from the pool as follows:
char buf[100];
FILE *fp;
if (fp = fopen("/dev/urandom", "r")) {
fread(&buf, sizeof(char), 100, fp);
fclose(fp);
}
Or something like that.
source
share