Raspberry Pi Random Pup

A home for all kinds of Puppy related projects
Post Reply
Message
Author
User avatar
Q5sys
Posts: 1105
Joined: Thu 11 Dec 2008, 19:49
Contact:

Raspberry Pi Random Pup

#1 Post by Q5sys »

Image

This is intended to be a single purpose release. With the expense of Hardware RNG devices, not to mention the delay in getting them... I've been looking for another alternative. The Raspberry Pi's BCM2835 system-on-a-chip has a hardware random number generator. This release allows you to utilize the RPi's hardware RNG across a local network by any computer on the network.

XZ Compressed 4gb SDcard Image can be downloaded here:
SourceForge Download Source
Backup Mirror



Proper Use:
Expand the image and write to SD card using dd
Insert SD card into RPi and plug in ethernet and power.
Wait about 15 seconds for the unit to boot.

On Local Machine:

Code: Select all

ssh -l root [Rpi-IP]
pass: woofwoof
On RPi through SSH:

Code: Select all

modprobe bcm2708-rng
/etc/init.d/rng-tools start
cat /dev/hwrng | nc -l -p 1337
On Local Machine:

Code: Select all

mkfifo -m 0666 /dev/hwrng
nc [RPi-IP] 1337 > /dev/hwrng
The device is now ready, however be aware that data transfer will ONLY begin once you start trying to get data from /dev/hwrng

It'll burn up about ~120KB/s on your network. Also ensure your RPi has proper cooling, as running cat /dev/hwrng will max the ARM CPU. Due to this, I would not recommend overclocking your RPi. However you want to try, you can uncomment the lines in config.txt that is in the 1st partition.

When you [Ctrl-C] your terminal on local machine it'll terminate the NetCat session on the RPi. When you discontinue pulling from /dev/hwrng on your local machine, this will also terminate the NetCat session on the RPi.

If you need to start and stop you're pulling data from /dev/hwrng on your local machine. You will need to restart netcat on both RPi and local machine. Your other option is to leave the initial cat /dev/hwrng open (minimize it). You can spawn new terminals and pull from /dev/hwrng starting and stoping as many times as you'd like. As long as the initial terminal remains open there will be no 'short write' error on the RPi.

Shutdown on the RPi:
nohup poweroff &


Image

-

Image

-

Image

-

Image

If you run rngtest multiple times you will notice that there will be failures. This is actually a good thing. True Randomness will produce patterns which will fail a computers analysis of randomness. As long as the failure rate is small (around 1%), there is no cause for concern. Also True Randomness will show failures across multiple tests, a weakened RNG will fail at specific tests only. Example
Thanks to 01Micko for the base RPi image!

User avatar
ally
Posts: 1957
Joined: Sat 19 May 2012, 19:29
Location: lincoln, uk
Contact:

#2 Post by ally »


Post Reply