Question
Need help with Python 2 a) Rumors on the internet claim that Linux random number generator is faulty, to test that theory write a solution
Need help with Python
2 a)
Rumors on the internet claim that Linux random number generator is faulty, to test that
theory write a solution that collects 20000 byte samples from /dev/urandom, then calculates a
histogram with 256 bins and prints the histogram in a vertical fashion each 20 samples inside
a bin should be represented by a single *
(end result should be something like:
000:***
001:***
002:*****
003:*
004:**
005:***
006:*****
etc.)
A) Solution that collects 20000 byte samples from /dev/urandom What is /dev/urandom? Fact: /dev/urandom is the preferred source of cryptographic randomness on UNIX-like systems. /dev/urandom is a pseudo random number generator, a PRNG , while /dev/random is a true random number generator.
2 b)
Make a script that can be run in the background, which on startup makes sure there is
a tmp sub-folder in current folder (otherwise it creates it) and repeatedly counts number of
files in the tmp sub folder, whenever the number of files reaches 10 the script creates an
archive files.tar.gz in current folder, which contains all the 10 files from tmp, then empties the
tmp folder, prints files collected to the console and exits.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started