User Tools

Site Tools


Navigation Menu

Random numbers: The fast and the furious

The expression security = usability-1 can be interpreted in many ways. Either things become far too complicated, so that regular users just don't want to be bothered with them or the amount of energy it takes to complete a security-related task is just insane.

To wipe a 1TB (1024GB) disk with random data or prep a disk for encryption, it takes a little more than 4 days (97 hours) when utilizing /dev/urandom. Who would want to wait 4 days for a supporting task like this to finish? Just considering the energy it takes, to keep the whole system up and running, only to write random data to a disk, clearly demands higher random data bitrates without sacrificing quality. Hardware-RNG's are good alternative but not always available, so you might want to give /dev/frandom a try.

Introducing /dev/frandom

/dev/frandom is a kernel module that claims to offer 10 times or more output bitrate than /dev/urandom - without a decrease of random data quality. The best way to verify this claim, is to try it out and test yourself. Just download, untar, compile and insmod the module, it usually works out-of-the-box.

make
insmod ./frandom.ko

In case of missing device nodes, create them manually:

mknod /dev/frandom c 235 11
chmod 444 /dev/frandom
mknod /dev/erandom c 235 12
chmod 444 /dev/erandom

Tests

ebuild for dieharder test suite


# Copyright 1999-2008 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

inherit eutils autotools

DESCRIPTION="
       DieHarder This is the current snapshot of the dieharder  random  number
       tester.   It encapsulates all of the Gnu Scientific Library random num-
       ber generators as well as /dev/random and /dev/urandom in a single har-
       ness  that  can time them and subject them to various tests for random-
       ness.  These tests are variously drawn from George Marsaglia's 'Diehard
       battery  of  random number tests', the NIST Statistical Test Suite, and
       include a few useful e.g. binning or spectral  tests  that  I've  found
       doing  research  into  random  number tests or tests that I myself have
       made up or that are improvements on tests from other sources.

       The primary point of this tester is to make it easy to  time  and  test
       (pseudo)random  number  generators  OR  hardware  or  other generators.
       Three examples are provided of wrapping a random number  generator  and
       inserting  it  so  that  it is can be called via the GSL interface.  An
       interface is planned that would allow random numbers to be read in from
       a  file,  allowing the tool to be used with any generator (wrappable or
       not) that can generate a table of random numbers.

       Another important motivation for  writing  dieharder  is  to  have  the
       entire  test  code  and  documentation be fully Gnu Public Licensed and
       hence openly available for adaptation, testing, modification, including
       the  addition  of  new  tests.   The  primary objections I have towards
       diehard and sts are not that they are or are not adequate and complete;
       it  is that the code is obscure and not explicitly published for reuse.
       It is my hope that by providing this tool in autodocumenting source, it
       makes  it  easy to add new tests, critique older tests, and improve the
       suite in general."

HOMEPAGE="http://www.phy.duke.edu/~rgb/General/dieharder.php"
SRC_URI="http://www.phy.duke.edu/~rgb/General/dieharder/${P}.tgz"

LICENSE="GPL-2" #GPL-2-Beverage
SLOT="0"
KEYWORDS="~x86 ~amd64"
IUSE=""

DEPEND="sci-libs/gsl"
RDEPEND="${DEPEND}"

src_unpack() {
	unpack ${A}
	cd "${S}"
	eautoreconf
}

src_compile() {
	econf || die "Error: econf failed!"
	emake -j1 || die "Error: emake failed!"
}
	

src_install() {
	emake install DESTDIR="${D}" || die "Install failed"
	dodoc NEWS README* NOTES
	docinto "dieharder"
	dodoc dieharder/README dieharder/NOTES
	docinto "libdieharder"
	dodoc libdieharder/README libdieharder/NOTES
}

urandom test results

cat /dev/urandom | dieharder -a -g 200
#                        Run Details
# Random number generator tested: stdin_input_raw
# Samples per test pvalue = 100000 (test default is 100000)
# P-values in final KS test = 100 (test default is 100)
#==================================================================
#                Histogram of p-values
##################################################################
# Counting histogram bins, binscale = 0.100000
#     20|    |    |    |    |    |    |    |    |    |    |
#       |    |    |    |    |    |    |    |    |    |    |
#     18|    |    |    |    |    |    |    |    |    |    |
#       |    |    |    |    |    |    |    |    |    |    |
#     16|    |    |    |    |    |    |    |    |    |    |
#       |    |    |    |    |    |    |    |    |    |    |
#     14|    |    |****|    |    |    |    |    |    |    |
#       |    |    |****|    |    |****|    |    |    |    |
#     12|    |    |****|    |    |****|    |    |    |    |
#       |    |    |****|    |    |****|    |    |    |    |
#     10|****|    |****|****|****|****|    |    |****|    |
#       |****|****|****|****|****|****|****|****|****|    |
#      8|****|****|****|****|****|****|****|****|****|    |
#       |****|****|****|****|****|****|****|****|****|    |
#      6|****|****|****|****|****|****|****|****|****|****|
#       |****|****|****|****|****|****|****|****|****|****|
#      4|****|****|****|****|****|****|****|****|****|****|
#       |****|****|****|****|****|****|****|****|****|****|
#      2|****|****|****|****|****|****|****|****|****|****|
#       |****|****|****|****|****|****|****|****|****|****|
#       |--------------------------------------------------
#       | 0.1| 0.2| 0.3| 0.4| 0.5| 0.6| 0.7| 0.8| 0.9| 1.0|
#==================================================================
#                          Results
Kuiper KS: p = 0.97927058
Assessment: PASSED at > 5% for RGB Permutations Test

real	1m7.539s
user	0m13.536s
sys	0m51.354s

frandom test results

cat /dev/frandom | dieharder -a -g 200
#                        Run Details
# Random number generator tested: stdin_input_raw
# Samples per test pvalue = 100000 (test default is 100000)
# P-values in final KS test = 100 (test default is 100)
#==================================================================
#                Histogram of p-values
##################################################################
# Counting histogram bins, binscale = 0.100000
#     20|    |    |    |    |    |    |    |    |    |    |
#       |    |    |    |    |    |    |    |    |    |    |
#     18|    |    |    |    |    |    |    |    |    |    |
#       |    |    |    |    |    |    |    |    |    |    |
#     16|    |    |    |    |    |    |    |    |    |    |
#       |    |    |    |    |    |    |    |    |    |    |
#     14|    |    |    |    |    |    |    |    |    |    |
#       |    |    |    |    |    |    |    |    |    |    |
#     12|    |    |    |    |****|    |    |    |    |    |
#       |    |    |****|    |****|****|    |    |****|****|
#     10|****|****|****|    |****|****|    |    |****|****|
#       |****|****|****|    |****|****|    |****|****|****|
#      8|****|****|****|    |****|****|****|****|****|****|
#       |****|****|****|****|****|****|****|****|****|****|
#      6|****|****|****|****|****|****|****|****|****|****|
#       |****|****|****|****|****|****|****|****|****|****|
#      4|****|****|****|****|****|****|****|****|****|****|
#       |****|****|****|****|****|****|****|****|****|****|
#      2|****|****|****|****|****|****|****|****|****|****|
#       |****|****|****|****|****|****|****|****|****|****|
#       |--------------------------------------------------
#       | 0.1| 0.2| 0.3| 0.4| 0.5| 0.6| 0.7| 0.8| 0.9| 1.0|
#==================================================================
#                          Results
Kuiper KS: p = 0.99947994
Assessment: PASSED at > 5% for RGB Bit Distribution Test

real	0m15.707s
user	0m13.545s
sys	0m1.947s

Conclusion

Given a good kernel entropy source (try rng-tools), /dev/frandom delivered indeed 10 times the bitrate /dev/urandom could offer. The dd to fill the disk with random data leveled at about 3 Megabytes/s random data. Although a Hardware-RNG still would be preferable, /dev/frandom can fill a gap when high random data bitrates are needed. Compared to /dev/urandom, the f in /dev/frandom deserves the attributes fast and furious.

Discussion

Miroslav Rovis, 2012/09/16 02:44

I added a link to this page in the Gentoo Community Wiki. Search for words “fast and furious”, there the link is next to.

The wiki page is:

http://en.gentoo-wiki.com/wiki/Talk:Writing_Ebuilds

Cheers!

chrono, 2012/09/19 13:43

Thanks for the ping - keep on happy ebuilding :)

online bingo, 2024/02/08 06:20

This blog is really great. The information here will surely be of some help to me. Thanks! online bingo philippines

25fox, 2024/02/13 00:10

Buy a driver's license Hello, welcome to the world's largest online driver's license organization. We sell authentic and registered driving licenses and we have several driving schools with which we collaborate.

https://origineelrijbewijskopen.com/

https://origineelrijbewijskopen.com/2023/11/10/rijbewijs-kopen-telegram/

https://origineelrijbewijskopen.com/2023/10/24/rijbewijs-kopen-nederland/ https://origineelrijbewijskopen.com/2023/11/01/rijbewijs-kopen-belgie/

https://origineelrijbewijskopen.com/2023/11/07/rijbewijs-a-kopen/

https://origineelrijbewijskopen.com/2023/11/07/rijbewijs-kopen-prijs/

https://origineelrijbewijskopen.com/2023/11/07/rijbewijs-te-koop-belgie/

https://origineelrijbewijskopen.com/2023/11/10/belgisch-rijbewijs-kopen/

https://origineelrijbewijskopen.com/2023/11/10/rijbewijs-kopen-duitsland/ https://origineelrijbewijskopen.com/2023/11/10/rijbewijs-examens-kopen/

https://origineelrijbewijskopen.com/2023/11/10/rijbewijs-kopen-hongarije/

What a nice post! I'm so happy to read this. What you wrote was very helpful to me. Thank you. Actually, I run a site similar to yours. If you have time, could you visit my site? Please leave your comments after reading what I wrote. If you do so, I will actively reflect your opinion. I think it will be a great help to run my site. Have a good day.

https://cf-cc-qualitylab.com/

https://cf-cc-qualitylab.com/product/american-dollars-for-sale/

https://cf-cc-qualitylab.com/product/buy-counterfeit-aud-online/

https://cf-cc-qualitylab.com/product/buy-fake-british-pounds-online/

https://cf-cc-qualitylab.com/product/buy-fake-euro-banknotes-online/

https://cf-cc-qualitylab.com/product/buy-new-zealand-dollars-online/ https://cf-cc-qualitylab.com/product/buy-undetected-canadian-dollars/

It is incredibly average to see the best inconspicuous components presented in a basic and seeing way Thank you. Actually, I run a site similar to yours. If you have time, could you visit my site? Please leave your comments after reading what I wrote. If you do so, I will actively reflect your opinion. I think it will be a great help to run my site. Have a good day.

https://cf-cc-qualitylab.com/product/paypal-flip/

https://cf-cc-qualitylab.com/product/western-union-flip/

https://cf-cc-qualitylab.com/product/cash-app-flip/ https://cf-cc-qualitylab.com/product/western-union-flip-sale/

https://cf-cc-qualitylab.com/product/legit-paypal-flip/

https://cf-cc-qualitylab.com/product/legit-cash-app-flip/ https://cf-cc-qualitylab.com/product/buy-cloned-cards/

https://cf-cc-qualitylab.com/product/buy-credit-card-dumps-online/

https://cf-cc-qualitylab.com/product/cloned-credit-cards-for-sale/ https://cf-cc-qualitylab.com/product/legit-paypal-money-transfer/

https://cf-cc-qualitylab.com/product/legit-paypal-money-transfer/

https://cf-cc-qualitylab.com/product/western-union-money-flip/

https://cf-cc-qualitylab.com/product/hacked-cash-app/

Such an especially significant article. To a great degree charming to examine this article.I should need to thank you for the undertakings you had made for creating this astonishing article. https://cf-cc-qualitylab.com/product/automated-money-developer-machines/

https://cf-cc-qualitylab.com/product/high-quality-automatic-solution/ https://cf-cc-qualitylab.com/product/ssd-chemical-solution-packaging-materials/

https://cf-cc-qualitylab.com/product/vector-paste-ssd-solution/ https://cf-cc-qualitylab.com/product/humine-activation-powder/

https://cf-cc-qualitylab.com/product/99-99-pure-gallium-metal-alloy-for-mercury-replacement/ https://cf-cc-qualitylab.com/product/automated-money-developer-machines/

I am another client of this site so here I saw different articles and posts posted by this site,I inquisitive more enthusiasm for some of them trust you will give more data on this points in your next articles.

https://cf-cc-qualitylab.com/2024/02/01/western-union-uberweisen-umdrehen/ https://cf-cc-qualitylab.com/2024/02/01/kaufen-sie-western-union-umdrehen/

https://cf-cc-qualitylab.com/product/automated-money-developer-machines/

https://cf-cc-qualitylab.com/2024/02/01/koop-western-union-omzet/

https://cf-cc-qualitylab.com/2024/01/31/acquistare-lanciare-western-union/

https://cf-cc-qualitylab.com/2024/01/31/contanti-ribaltabili-della-western-union/

https://cf-cc-qualitylab.com/2024/01/30/volteo-de-dinero-de-western-union/

https://cf-cc-qualitylab.com/2024/01/30/comprar-voltear-de-western-union/

https://cf-cc-qualitylab.com/2024/01/28/transfert-dargent-western-union/

https://cf-cc-qualitylab.com/2024/01/28/retournement-de-western-union/

https://cf-cc-qualitylab.com/2024/01/27/online-kredietkaart-dumps-kopen/

https://cf-cc-qualitylab.com/2024/01/27/gekloonde-kredietkaarten-te-koop/

https://cf-cc-qualitylab.com/2024/01/27/gekloonde-kaarten-kopen/ https://cf-cc-qualitylab.com/2024/01/27/kaufen-sie-kreditkarten-dumps-online/

https://cf-cc-qualitylab.com/2024/01/27/geklonte-karten-dumps-zum-verkauf/

All things considered I read it yesterday yet I had a few musings about it and today I needed to peruse it again in light of the fact that it is extremely elegantly composed.

https://cf-cc-qualitylab.com/2024/01/27/kaufen-sie-geklonte-karten/

https://cf-cc-qualitylab.com/2024/01/27/acquistare-scarico-di-carte-di-credito-in-linea/ https://cf-cc-qualitylab.com/2024/01/27/carte-di-credito-clonate-in-vendita/ https://cf-cc-qualitylab.com/2024/01/27/carte-clonate-in-vendita/ https://cf-cc-qualitylab.com/2024/01/26/comprar-volcados-de-tarjetas-de-credito/

https://cf-cc-qualitylab.com/2024/01/26/tarjetas-de-credito-clonadas-a-la-venta/ https://cf-cc-qualitylab.com/2024/01/25/comprar-tarjetas-clonadas/ https://cf-cc-qualitylab.com/2024/01/25/acheter-des-dumps-de-cartes-de-credit-en-ligne/

https://cf-cc-qualitylab.com/2024/01/25/cartes-de-credit-clonees-a-vendre/

https://cf-cc-qualitylab.com/2024/01/25/cartes-clonees-a-vendre/ https://cf-cc-qualitylab.com/2024/01/23/requisitengeld-zum-verkauf/ https://cf-cc-qualitylab.com/2024/01/23/falschgeld-kaufen/

https://cf-cc-qualitylab.com/2024/01/23/gefalschter-euro-zum-verkauf/

https://cf-cc-qualitylab.com/2024/01/21/koop-valse-polymeerbiljetten/ https://cf-cc-qualitylab.com/2024/01/21/koop-valse-bankbiljetten/

 Actually, I run a site similar to yours. If you have time, could you visit my site? Please leave your comments after reading what I wrote. If you do so, I will actively reflect your opinion. I think it will be a great help to run my site. Have a good day.

https://cf-cc-qualitylab.com/2024/01/21/koop-valse-euro-bankbiljetten/

https://cf-cc-qualitylab.com/2024/01/21/comprar-dinero-falso-en-linea/

https://cf-cc-qualitylab.com/2024/01/21/comprar-dinero-falso/

https://cf-cc-qualitylab.com/2024/01/21/billetes-de-euro-a-la-venta/

https://cf-cc-qualitylab.com/2024/01/17/soldi-realistici-in-vendita/

https://cf-cc-qualitylab.com/2024/01/17/acquistare-denaro-falso/ https://cf-cc-qualitylab.com/2024/01/17/banconote-in-euro-in-vendita/ https://cf-cc-qualitylab.com/2024/01/17/argent-accessoire-a-vendre/ https://cf-cc-qualitylab.com/2024/01/17/acheter-des-billets-indetectables/ https://cf-cc-qualitylab.com/2024/01/17/faux-euros-a-vendre-en-ligne/

https://cf-cc-qualitylab.com/2024/01/09/buy-euros-online-cyprus/

https://cf-cc-qualitylab.com/2024/01/09/fake-polymer-notes-for-sale/

https://cf-cc-qualitylab.com/2024/01/09/counterfeit-money-for-sale/

https://cf-cc-qualitylab.com/2024/01/09/buy-fake-dollar-bills/

https://cf-cc-qualitylab.com/2024/01/09/buy-prop-money-canada/

https://cf-cc-qualitylab.com/2024/01/09/buy-fake-polymer-notes/

Enter your comment. Wiki syntax is allowed:
I T E᠎ T L