You are not logged in.

#1 2015-04-10 23:48:17

johanc
Member
Registered: 2015-04-10
Posts: 3

rng-tools question

Hi,

first message on the forums, so please excuse me If I say/do something really dumb. (like if this is in the wrong category)

I bought a HRNG the other day (TrueRNG to be specific), figured it would be cool to play around with, I was sucessful at "installing" it and I can now pipe random data from the RNG to STDIN/STDOUT (and was happy to find out that my RNG works).

However, I'm trying to set it up so that it can re-fill the /dev/random pool (not that that's really necessary on a laptop) using rng-tools, but I have to say that (unless my googling is failing me, in which case I appologize) it seems like the documentation is extremely sparse. I read through the man pages and checked the usage and what not, but I still don't understand how to configure it correctly or even how to know when it is configured correctly (other than very general things like cat /proc/sys/kernel/random/entropyavail)

Right now my config file, /etc/conf.d/rngd is just:

HRNGDEVICE=/dev/TrueRNG   <-- (which is the correct device)
RNGD_OPTS=""                       <--(default line that I haven't filled in)

Which is probably wrong

i've tried systemctl start rngd, and rngd -o /dev/random -r /dev/TrueRNG and neither seem to give me errors

Again, sorry for my likely dumb question. I would appreciate any help very much (even just knowing where to find additional documentation).

I'm probably just spoiled from how well documented the vast majority of Arch packages are

Thanks!

P.S. I think Arch Linux is great :-) I used it off and on for a couple months and recently bought a laptop where I now have a full-time install

Offline

#2 2015-04-11 00:00:32

EscapedNull
Member
Registered: 2013-12-04
Posts: 129

Re: rng-tools question

johanc wrote:

I read through the man pages and checked the usage and what not, but I still don't understand how to configure it correctly or even how to know when it is configured correctly (other than very general things like cat /proc/sys/kernel/random/entropyavail)

Sorry if I misunderstood the question, but isn't that what rngtest(1) is for?

Offline

#3 2015-04-11 00:04:17

johanc
Member
Registered: 2015-04-10
Posts: 3

Re: rng-tools question

Thank you for the fast response!

According to the man page, rngtest takes its input from stdin, not /dev/random. I know that the HRNG works, and it's quite possible that my setup is correct, I just can't figure out how to verify if it's working.

Offline

#4 2015-04-11 00:11:44

EscapedNull
Member
Registered: 2013-12-04
Posts: 129

Re: rng-tools question

I assume you mean that you want to test the quality of the randomness being produced by the HRNG, which rngtest(1) does, according to the manual:

rngtest works on blocks of 20000 bits at a time, using the FIPS 140-2 (errata of 2001-10-10) tests to verify the randomness of the block of data.

Are you looking for something like this?

cat /dev/random | rngtest

You can try it once with and once without rngd(8) running, and compare your results. Other than that, I don't know of any way to test whether the numbers are truly random, or that the HRNG is "working" (better than the kernel's built-in functionality).

Offline

#5 2015-04-11 00:42:29

johanc
Member
Registered: 2015-04-10
Posts: 3

Re: rng-tools question

Thanks! That worked, it turns out it's not currently working. I'll have to keep researching. Thanks!

Offline

#6 2015-04-11 17:29:10

mitchejj
Member
Registered: 2013-04-21
Posts: 2

Re: rng-tools question

For me my `/etc/conf.d/rngd` looks like this:

    RNGD_OPTS="-o /dev/random -r /dev/hwrng"


Which seems to fail on boot, but when when I reload the service everything works just fine.

Offline

#7 2015-04-12 04:03:10

EscapedNull
Member
Registered: 2013-12-04
Posts: 129

Re: rng-tools question

johanc wrote:

Thanks! That worked, it turns out it's not currently working. I'll have to keep researching. Thanks!

Make sure you modify the RNGD_OPTS variable so it starts rngd with

-r /dev/TrueRNG

or it won't know where to pull the random data from.

man rngd wrote:

-r file, --rng-device=file
    Kernel device used for random number input (default: /dev/hwrandom)

Edit: in theory this is what HRNGDEVICE is for, but it might work around a bug.

Last edited by EscapedNull (2015-04-12 04:05:39)

Offline

Board footer

Powered by FluxBB