LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 03-31-2015, 07:45 PM   #1
RV11
LQ Newbie
 
Registered: Feb 2014
Posts: 2

Rep: Reputation: Disabled
Question 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?
 
Old 04-01-2015, 01:11 AM   #2
dijetlo
Senior Member
 
Registered: Jan 2009
Location: RHELtopia....
Distribution: Solaris 11.2/Slackware/RHEL/
Posts: 1,491
Blog Entries: 2

Rep: Reputation: Disabled
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).
 
Old 04-01-2015, 01:23 AM   #3
veerain
Senior Member
 
Registered: Mar 2005
Location: Earth bound to Helios
Distribution: Custom
Posts: 2,524

Rep: Reputation: 319Reputation: 319Reputation: 319Reputation: 319
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.
 
Old 04-01-2015, 01:32 AM   #4
dijetlo
Senior Member
 
Registered: Jan 2009
Location: RHELtopia....
Distribution: Solaris 11.2/Slackware/RHEL/
Posts: 1,491
Blog Entries: 2

Rep: Reputation: Disabled
It appears I'm stuttering....
 
Old 04-01-2015, 06:43 AM   #5
frostschutz
Member
 
Registered: Apr 2004
Distribution: Gentoo
Posts: 95

Rep: Reputation: 28
Quote:
Originally Posted by RV11 View Post
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.
 
  


Reply

Tags
random


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
SAN storage pool for VM Guest OS images - which pool type is best practice myc5 Linux - Virtualization and Cloud 1 11-23-2014 09:14 PM
Pseudo Random Generator is not initialized from the (entropy pool) !!!!? LinuxInDepth Red Hat 1 04-29-2012 06:24 PM
How does Cygwin's /dev/random and urandom work? Da_Nuke General 1 10-09-2011 09:18 AM
/dev/urandom not that random NoobieDoobieDo Linux - Security 10 02-26-2007 06:18 AM
/dev/random and /dev/urandom pool(s)? kpeirce Linux - Software 2 01-31-2006 06:54 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 05:46 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration