[onerng talk] How to access raw data

Paul Campbell paul at taniwha.com
Sun Jan 10 21:19:11 GMT 2016


On Mon, 11 Jan 2016 10:05:17 andreas.livet wrote:
> I've just received my OneRNG key and it work well, thank you guys you did an
> awesome job.
> 
> I don't want to use it for cryptography but for personal research and wander
> how to access the raw data produced by the noise generator before it gets
> unbiased.
> 
> I can't find any documentation on this subject although you've mention that
> it could be possible in a talk.
> 
> Can you give me more information on this subject. Hope I don't need to
> change the firmware cause I bought a non programmable key :).

Start by going in to /etc/onerng.conf and turning off RNGD - that way when the 
board is plugged in it's available to be accessed directly.

Simply you open /dev/ttyACM0 (or whatever device name a particular device is 
allocated when plugged in) - it looks like a terminal device (you can access 
it with minicom for testing) it accepts commands (no echo) "cmd0"-"cmd7" 
choose 6 different modes (look at the online docs) half of them are the raw 
data (for example "cmd1" chooses the raw avalanche data) - "cmdo" and "cmdO" 
turns in the output data on/off which is simply raw 8-bit binary data.

If you're writing code to talk to the device directly use stty (or termio) to:
- turn off echo
- disable all flow control and modem control
- put the device into raw mode (so the tty device doesn't swallow stuff like 
^C)


> Also, I can't find the source on github for the Host software, where can we
> find them ?

The full source is available for download at the same place that you got your 
host software - look for the tar archive for "other linux systems" - there';s 
really only 3 components:

- a udev script that starts:
- a shell script for starting and stopping rngd which also invokes:
- a python program that verifies the firmware image's signature

You may not need any of these

	Paul


More information about the Discuss mailing list