LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Does RANDOM entrpy pool init ensure /dev/urandom entrpy pool init ? (https://www.linuxquestions.org/questions/linux-general-1/does-random-entrpy-pool-init-ensure-dev-urandom-entrpy-pool-init-4175538374/)

RV11 03-31-2015 07:45 PM

Does RANDOM entrpy pool init ensure /dev/urandom entrpy pool init ?
 
If I do something like

RANDOM=`date +%s%N | cut -b14-19` # i.e. RANDOM entropy pool init

Will this have modified the /dev/urandom pool also?

i.e. will for example

shuf --random-source=/dev/urandom inputfile > outputfile

Have a presumably more random outcome?

dijetlo 04-01-2015 01:11 AM

Both are generated from random environmental noise. The primary difference appears to be that urandom will generate a pseudo-random number when queried before the necessary entropy has been established while random just blocks.

See man random(4) for details.

If I was trying to do what you're suggesting, I might populate it with jitter, offset and delay from ntpq -p since that's an externally dependent, 'one time only' dataset vs. any manipulation of system time which is internal and persistent. (theoretically, your random calculation could be accurately reproduce) however unless your generating a lot of large reads, more than one per minute, for example, the environmental noise source is effectively impenetrable out to 32bits of crypto quality randomness (as far as we know).

---------- Post added 04-01-15 at 02:12 AM ----------

Both are generated from random environmental noise. The primary difference appears to be that urandom will generate a pseudo-random number when queried before the necessary entropy has been established while random just blocks.

See man random(4) for details.

If I was trying to do what you're suggesting, I might populate it with jitter, offset and delay from ntpq -p since that's an externally dependent, 'one time only' dataset vs. any manipulation of system time which is internal and persistent. (theoretically, your random calculation could be accurately reproduce) however unless your generating a lot of large reads, more than one per minute, for example, the environmental noise source is effectively impenetrable out to 32bits of crypto quality randomness (as far as we know).

veerain 04-01-2015 01:23 AM

Yes /dev/urandom is more random than just date.

/dev/urandom uses a seed from internal entropy pool(/dev/random source) to give pseudo-random numbers.

/dev/random is the most good random number source present in a typical system.

Or you can use quality external hardware random number generators.

dijetlo 04-01-2015 01:32 AM

It appears I'm stuttering....

frostschutz 04-01-2015 06:43 AM

Quote:

Originally Posted by RV11 (Post 5340613)
RANDOM=`date +%s%N | cut -b14-19` # i.e. RANDOM entropy pool init

With any luck, the shell will do a better job at initializing this than you.

Unless you want to reproduce a specific set of pseudo-random numbers, you shouldn't initialize it yourself.


All times are GMT -5. The time now is 06:05 PM.