jahboater wrote: ↑Tue Jan 30, 2018 10:09 am
Also you might want to add the "bs=10" argument to dd, otherwise you are taking lots of entropy for just a few bytes of output, and you can then skip the head bit.
Good point!
Heater wrote: ↑Tue Jan 30, 2018 6:26 am
I'm quite partial to this circuit for generating random bits:
Cool!
jahboater wrote: ↑Tue Jan 30, 2018 11:55 am
Isn't /dev/random deprecated now?
https://unix.stackexchange.com/question ... ev-urandom
Interesting question, this post from 2016 does mention that, but highest ranked answer explains it a bit better. depends what distro!
seems a competition between CSPRNG randomness vs. the HWRNG randomness
It seems to me, after having rng-tools set up /dev/random gives a mix of outputs from CSPRNG and HWRNG, precisely the ratio I am not sure
but as I said previously, can do that manually and manually random select snippets from both devices /dev/urandom and /dev/hwrng and you dont need to set up rng-tools as the /dev/hwrng device does exist by default.
/dev/urandom is much faster than /dev/hwrng
just messing with dieharder tests, tick tock!
on a 3gb file from /dev/hwrng raspberry only weak on two dieharder tests, fails none
the "truerng" box (not the circuit above) fails tests and is weak in others looking at results posted in comments on the page linked earlier at scruss.com
running rngtest on same 3gb file is giving about 0.8 failures per 1000 tests, which is in line with results shown on the arch linux write up of rng-tools
======= test just run last night/this morning on a pi zer raspbian stretch
sudo dd if=/dev/hwrng iflag=fullblock count=3072 bs=1024k > random.pi
3072+0 records in
3072+0 records out
3221225472 bytes (3.2 GB, 3.0 GiB) copied, 28286.3 s, 114 kB/s
dieharder -a -g 201 -f random.pi
#=============================================================================#
# dieharder version 3.31.1 Copyright 2003 Robert G. Brown #
#=============================================================================#
rng_name | filename |rands/second|
file_input_raw| random.pi| 1.16e+07 |
#=============================================================================#
test_name |ntup| tsamples |psamples| p-value |Assessment
#=============================================================================#
diehard_birthdays| 0| 100| 100|0.12817816| PASSED
diehard_operm5| 0| 1000000| 100|0.22048199| PASSED
diehard_rank_32x32| 0| 40000| 100|0.91056214| PASSED
diehard_rank_6x8| 0| 100000| 100|0.41087991| PASSED
diehard_bitstream| 0| 2097152| 100|0.27521249| PASSED
diehard_opso| 0| 2097152| 100|0.94962586| PASSED
diehard_oqso| 0| 2097152| 100|0.77127671| PASSED
diehard_dna| 0| 2097152| 100|0.82050944| PASSED
diehard_count_1s_str| 0| 256000| 100|0.01849413| PASSED
# The file file_input_raw was rewound 1 times
diehard_count_1s_byt| 0| 256000| 100|0.08190277| PASSED
# The file file_input_raw was rewound 1 times
diehard_parking_lot| 0| 12000| 100|0.83699181| PASSED
# The file file_input_raw was rewound 1 times
diehard_2dsphere| 2| 8000| 100|0.95686960| PASSED
# The file file_input_raw was rewound 1 times
diehard_3dsphere| 3| 4000| 100|0.99233785| PASSED
# The file file_input_raw was rewound 1 times
diehard_squeeze| 0| 100000| 100|0.96072528| PASSED
# The file file_input_raw was rewound 1 times
diehard_sums| 0| 100| 100|0.57914487| PASSED
# The file file_input_raw was rewound 1 times
diehard_runs| 0| 100000| 100|0.90135448| PASSED
diehard_runs| 0| 100000| 100|0.16385325| PASSED
# The file file_input_raw was rewound 1 times
diehard_craps| 0| 200000| 100|0.08028264| PASSED
diehard_craps| 0| 200000| 100|0.56360433| PASSED
# The file file_input_raw was rewound 4 times
marsaglia_tsang_gcd| 0| 10000000| 100|0.33259823| PASSED
marsaglia_tsang_gcd| 0| 10000000| 100|0.03050897| PASSED
# The file file_input_raw was rewound 4 times
sts_monobit| 1| 100000| 100|0.97148091| PASSED
# The file file_input_raw was rewound 4 times
sts_runs| 2| 100000| 100|0.28219246| PASSED
# The file file_input_raw was rewound 4 times
sts_serial| 1| 100000| 100|0.35579413| PASSED
sts_serial| 2| 100000| 100|0.36324454| PASSED
sts_serial| 3| 100000| 100|0.96272178| PASSED
sts_serial| 3| 100000| 100|0.01257694| PASSED
sts_serial| 4| 100000| 100|0.95116462| PASSED
sts_serial| 4| 100000| 100|0.77351319| PASSED
sts_serial| 5| 100000| 100|0.11167134| PASSED
sts_serial| 5| 100000| 100|0.43545752| PASSED
sts_serial| 6| 100000| 100|0.03955459| PASSED
sts_serial| 6| 100000| 100|0.49509367| PASSED
sts_serial| 7| 100000| 100|0.54105723| PASSED
sts_serial| 7| 100000| 100|0.34156956| PASSED
sts_serial| 8| 100000| 100|0.10471962| PASSED
sts_serial| 8| 100000| 100|0.16366930| PASSED
sts_serial| 9| 100000| 100|0.19866319| PASSED
sts_serial| 9| 100000| 100|0.83008866| PASSED
sts_serial| 10| 100000| 100|0.52377778| PASSED
sts_serial| 10| 100000| 100|0.88503393| PASSED
sts_serial| 11| 100000| 100|0.80646749| PASSED
sts_serial| 11| 100000| 100|0.88100940| PASSED
sts_serial| 12| 100000| 100|0.98819546| PASSED
sts_serial| 12| 100000| 100|0.36571213| PASSED
sts_serial| 13| 100000| 100|0.34246257| PASSED
sts_serial| 13| 100000| 100|0.20584354| PASSED
sts_serial| 14| 100000| 100|0.28470331| PASSED
sts_serial| 14| 100000| 100|0.96681292| PASSED
sts_serial| 15| 100000| 100|0.17196949| PASSED
sts_serial| 15| 100000| 100|0.56678498| PASSED
sts_serial| 16| 100000| 100|0.10885051| PASSED
sts_serial| 16| 100000| 100|0.21679957| PASSED
# The file file_input_raw was rewound 4 times
rgb_bitdist| 1| 100000| 100|0.75755337| PASSED
# The file file_input_raw was rewound 4 times
rgb_bitdist| 2| 100000| 100|0.24559046| PASSED
# The file file_input_raw was rewound 4 times
rgb_bitdist| 3| 100000| 100|0.31840340| PASSED
# The file file_input_raw was rewound 4 times
rgb_bitdist| 4| 100000| 100|0.70484062| PASSED
# The file file_input_raw was rewound 4 times
rgb_bitdist| 5| 100000| 100|0.22229752| PASSED
# The file file_input_raw was rewound 4 times
rgb_bitdist| 6| 100000| 100|0.95721531| PASSED
# The file file_input_raw was rewound 4 times
rgb_bitdist| 7| 100000| 100|0.95461611| PASSED
# The file file_input_raw was rewound 4 times
rgb_bitdist| 8| 100000| 100|0.10947090| PASSED
# The file file_input_raw was rewound 5 times
rgb_bitdist| 9| 100000| 100|0.81983779| PASSED
# The file file_input_raw was rewound 5 times
rgb_bitdist| 10| 100000| 100|0.72972825| PASSED
# The file file_input_raw was rewound 5 times
rgb_bitdist| 11| 100000| 100|0.86017380| PASSED
# The file file_input_raw was rewound 6 times
rgb_bitdist| 12| 100000| 100|0.49492861| PASSED
# The file file_input_raw was rewound 6 times
rgb_minimum_distance| 2| 10000| 1000|0.45879860| PASSED
# The file file_input_raw was rewound 6 times
rgb_minimum_distance| 3| 10000| 1000|0.79775642| PASSED
# The file file_input_raw was rewound 6 times
rgb_minimum_distance| 4| 10000| 1000|0.65490744| PASSED
# The file file_input_raw was rewound 6 times
rgb_minimum_distance| 5| 10000| 1000|0.99998384| WEAK
# The file file_input_raw was rewound 6 times
rgb_permutations| 2| 100000| 100|0.06886222| PASSED
# The file file_input_raw was rewound 6 times
rgb_permutations| 3| 100000| 100|0.12798774| PASSED
# The file file_input_raw was rewound 6 times
rgb_permutations| 4| 100000| 100|0.05407457| PASSED
# The file file_input_raw was rewound 6 times
rgb_permutations| 5| 100000| 100|0.71970459| PASSED
# The file file_input_raw was rewound 6 times
rgb_lagged_sum| 0| 1000000| 100|0.89914248| PASSED
# The file file_input_raw was rewound 6 times
rgb_lagged_sum| 1| 1000000| 100|0.91807981| PASSED
# The file file_input_raw was rewound 7 times
rgb_lagged_sum| 2| 1000000| 100|0.88250769| PASSED
# The file file_input_raw was rewound 7 times
rgb_lagged_sum| 3| 1000000| 100|0.84357829| PASSED
# The file file_input_raw was rewound 8 times
rgb_lagged_sum| 4| 1000000| 100|0.66286812| PASSED
# The file file_input_raw was rewound 8 times
rgb_lagged_sum| 5| 1000000| 100|0.65416539| PASSED
# The file file_input_raw was rewound 9 times
rgb_lagged_sum| 6| 1000000| 100|0.65814328| PASSED
# The file file_input_raw was rewound 10 times
rgb_lagged_sum| 7| 1000000| 100|0.88325203| PASSED
# The file file_input_raw was rewound 11 times
rgb_lagged_sum| 8| 1000000| 100|0.73038115| PASSED
# The file file_input_raw was rewound 13 times
rgb_lagged_sum| 9| 1000000| 100|0.72493156| PASSED
# The file file_input_raw was rewound 14 times
rgb_lagged_sum| 10| 1000000| 100|0.42001270| PASSED
# The file file_input_raw was rewound 16 times
rgb_lagged_sum| 11| 1000000| 100|0.76646166| PASSED
# The file file_input_raw was rewound 17 times
rgb_lagged_sum| 12| 1000000| 100|0.07396891| PASSED
# The file file_input_raw was rewound 19 times
rgb_lagged_sum| 13| 1000000| 100|0.65308069| PASSED
# The file file_input_raw was rewound 21 times
rgb_lagged_sum| 14| 1000000| 100|0.82744548| PASSED
# The file file_input_raw was rewound 23 times
rgb_lagged_sum| 15| 1000000| 100|0.29800685| PASSED
# The file file_input_raw was rewound 25 times
rgb_lagged_sum| 16| 1000000| 100|0.47557053| PASSED
# The file file_input_raw was rewound 27 times
rgb_lagged_sum| 17| 1000000| 100|0.11015354| PASSED
# The file file_input_raw was rewound 29 times
rgb_lagged_sum| 18| 1000000| 100|0.90713869| PASSED
# The file file_input_raw was rewound 32 times
rgb_lagged_sum| 19| 1000000| 100|0.95001124| PASSED
# The file file_input_raw was rewound 35 times
rgb_lagged_sum| 20| 1000000| 100|0.98604591| PASSED
# The file file_input_raw was rewound 37 times
rgb_lagged_sum| 21| 1000000| 100|0.52015903| PASSED
# The file file_input_raw was rewound 40 times
rgb_lagged_sum| 22| 1000000| 100|0.95892483| PASSED
# The file file_input_raw was rewound 43 times
rgb_lagged_sum| 23| 1000000| 100|0.00003096| WEAK
# The file file_input_raw was rewound 46 times
rgb_lagged_sum| 24| 1000000| 100|0.06317806| PASSED
# The file file_input_raw was rewound 49 times
rgb_lagged_sum| 25| 1000000| 100|0.86579617| PASSED
# The file file_input_raw was rewound 53 times
rgb_lagged_sum| 26| 1000000| 100|0.58423834| PASSED
# The file file_input_raw was rewound 56 times
rgb_lagged_sum| 27| 1000000| 100|0.86529381| PASSED
# The file file_input_raw was rewound 60 times
rgb_lagged_sum| 28| 1000000| 100|0.41184149| PASSED
# The file file_input_raw was rewound 64 times
rgb_lagged_sum| 29| 1000000| 100|0.81736046| PASSED
# The file file_input_raw was rewound 67 times
rgb_lagged_sum| 30| 1000000| 100|0.28461423| PASSED
# The file file_input_raw was rewound 71 times
rgb_lagged_sum| 31| 1000000| 100|0.36322747| PASSED
# The file file_input_raw was rewound 76 times
rgb_lagged_sum| 32| 1000000| 100|0.05140941| PASSED
# The file file_input_raw was rewound 76 times
rgb_kstest_test| 0| 10000| 1000|0.02448435| PASSED
# The file file_input_raw was rewound 76 times
dab_bytedistrib| 0| 51200000| 1|0.84928041| PASSED
# The file file_input_raw was rewound 76 times
dab_dct| 256| 50000| 1|0.37264438| PASSED
Preparing to run test 207. ntuple = 0
# The file file_input_raw was rewound 76 times
dab_filltree| 32| 15000000| 1|0.64814623| PASSED
dab_filltree| 32| 15000000| 1|0.36970382| PASSED
Preparing to run test 208. ntuple = 0
# The file file_input_raw was rewound 76 times
dab_filltree2| 0| 5000000| 1|0.52176096| PASSED
dab_filltree2| 1| 5000000| 1|0.37962593| PASSED
Preparing to run test 209. ntuple = 0
# The file file_input_raw was rewound 76 times
dab_monobit2| 12| 65000000| 1|0.30470240| PASSED
rngtest: bits received from input: 21858240032
rngtest: FIPS 140-2 successes: 1092038
rngtest: FIPS 140-2 failures: 874
rngtest: FIPS 140-2(2001-10-10) Monobit: 116
rngtest: FIPS 140-2(2001-10-10) Poker: 122
rngtest: FIPS 140-2(2001-10-10) Runs: 358
rngtest: FIPS 140-2(2001-10-10) Long run: 285
rngtest: FIPS 140-2(2001-10-10) Continuous run: 0
rngtest: input channel speed: (min=178.257; avg=8314.235; max=19073.486)Mibits/s
rngtest: FIPS tests speed: (min=11.659; avg=38.808; max=40.155)Mibits/s
rngtest: Program run time: 540006024 microseconds