About a year ago, I got into a cryptology suite program.
I had FITS trying to make LINUX give me "CPU random bytes" that I *knew* were there, and all the big cryptology progs run off of the same bytes I am going to get...
I only needed to, periodically, stop and get a "new key pool".
IE, I need "x" bytes of completely random, mathematically random, distribution.
(software can bust you immediately, if you only PRETEND and use a RND statement, BTW)
so, this little GEM? took me *longer* than I will admit to publicly, to get
(learning LINUX as I go)
yeah, I know, your AI is *fine* with RND*256 random choices, yields 0-255;
this is for when you need "mathematically pure" random bytes. on demand.
PROGRAM:
1) runs perfect on LINUX MINT
2) most LINUX's should be okay
3) creates a couple files:
ddd, eee, fff, ggg
these contain the 1k / 4k / 64k / 1,000,000 bytes (respectively)
NOTE: if you are like me? and want to open and SEE the bytes are indeed "changing" each run?
use "ddd" or "eee".....
if you click on ggg, and open up 1,000,000 random bytes of gobbledygook? your little text editor might complain (mine does)
linux MINT executable :
got code?
Print "attempting to extract 1k+4k+64k+1mb of bytes...":
Print Shell "head -c 1024 /dev/urandom > ddd.dat" Print "1k successful; attempting 4k..." Shell "head -c 4096 /dev/urandom > eee.dat" Print "4k successful; attempting 64k..." Shell "head -c 65536 /dev/urandom > fff.dat" Print "64k successful; attempting 1,000,000 bytes..." Shell "head -c 1000000 /dev/urandom > ggg.dat" Print "check the file(s) now; program will terminate."
NOTE: it goes w/o saying, this is LINUX only... some windows API guy can explain how to do this in windows, please have them make a post