How random is /dev/random? Visualizing the output of /dev/random using hexdump, dd, and python

I wrote a python script that will plot the output of /dev/random in a few ways so you can see just how random it is.

Make a line plot:

Screen Shot 2015-05-30 at 9.08.52 AM

Make a histogram:

Screen Shot 2015-05-30 at 9.08.02 AM

 

Options:

Do be careful when using the dd command. It can wipe out your filesystem if you set the outfile incorrectly. I’d recommend not changing the option of=”./randfile”.

Edit the block size and/or block count in *.sh to change the output resolution:

Screen Shot 2015-05-30 at 8.33.37 AM

You may need root privileges to use the dd command.

Remember that on OSX, /dev/random and /dev/urandom are identical.  On linux, to get 100 blocks as I have, you may have to use /dev/urandom (unlimited random). The linux case is probably more interesting as the outputs are different.  How exactly DO they differ?

OSX is known to use Yarrow-160 a cryptographic algorithm that makes use of hash functions (specifically SHA1) to create “unlimited” seemingly-random bits from a finite entropy pool.

As far as I know, linux does not. Linux will wait for more entropy when /dev/random is used as opposed to /dev/urandom.

See personal page and github repository.

http://www.phys.ufl.edu/~majewski/

Posted in Stuff
One comment on “How random is /dev/random? Visualizing the output of /dev/random using hexdump, dd, and python

comment on this post

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

popular
  • None
“recent” posts
%d bloggers like this: