This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
mission:log:2011:06:09:random-numbers-the-fast-and-the-furious [2012-02-15 08:32] – created chrono | mission:log:2011:06:09:random-numbers-the-fast-and-the-furious [2013-06-05 14:34] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== Random numbers: The fast and the furious ====== | ||
+ | The expression **security = usability< | ||
+ | |||
+ | 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 / | ||
+ | |||
+ | ===== ===== | ||
+ | |||
+ | |||
+ | ===== Introducing / | ||
+ | |||
+ | [[http:// | ||
+ | |||
+ | < | ||
+ | make | ||
+ | </ | ||
+ | |||
+ | < | ||
+ | insmod ./ | ||
+ | </ | ||
+ | |||
+ | In case of missing device nodes, create them manually: | ||
+ | |||
+ | < | ||
+ | mknod / | ||
+ | chmod 444 / | ||
+ | mknod / | ||
+ | chmod 444 / | ||
+ | </ | ||
+ | |||
+ | ===== Tests ===== | ||
+ | |||
+ | ==== ebuild for dieharder test suite ==== | ||
+ | |||
+ | |||
+ | <sxh bash> | ||
+ | |||
+ | # Copyright 1999-2008 Gentoo Foundation | ||
+ | # Distributed under the terms of the GNU General Public License v2 | ||
+ | # $Header: $ | ||
+ | |||
+ | inherit eutils autotools | ||
+ | |||
+ | DESCRIPTION=" | ||
+ | | ||
+ | | ||
+ | ber generators as well as /dev/random and / | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | 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 | ||
+ | | ||
+ | Three examples are provided of wrapping a random number | ||
+ | | ||
+ | | ||
+ | | ||
+ | not) that can generate a table of random numbers. | ||
+ | |||
+ | | ||
+ | | ||
+ | hence openly available for adaptation, testing, modification, | ||
+ | | ||
+ | | ||
+ | | ||
+ | It is my hope that by providing this tool in autodocumenting source, it | ||
+ | | ||
+ | suite in general." | ||
+ | |||
+ | HOMEPAGE=" | ||
+ | SRC_URI=" | ||
+ | |||
+ | LICENSE=" | ||
+ | SLOT=" | ||
+ | KEYWORDS=" | ||
+ | IUSE="" | ||
+ | |||
+ | DEPEND=" | ||
+ | RDEPEND=" | ||
+ | |||
+ | src_unpack() { | ||
+ | unpack ${A} | ||
+ | cd " | ||
+ | eautoreconf | ||
+ | } | ||
+ | |||
+ | src_compile() { | ||
+ | econf || die " | ||
+ | emake -j1 || die " | ||
+ | } | ||
+ | |||
+ | |||
+ | src_install() { | ||
+ | emake install DESTDIR=" | ||
+ | dodoc NEWS README* NOTES | ||
+ | docinto " | ||
+ | dodoc dieharder/ | ||
+ | docinto " | ||
+ | dodoc libdieharder/ | ||
+ | } | ||
+ | |||
+ | </ | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | ==== urandom test results ==== | ||
+ | |||
+ | < | ||
+ | |||
+ | < | ||
+ | # 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 | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # 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 ==== | ||
+ | |||
+ | < | ||
+ | |||
+ | < | ||
+ | # 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 | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # 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), / | ||
+ | |||
+ | {{tag> | ||
+ | |||
+ | ~~DISCUSSION~~ |