Year: 2012

Update to Arduino Random Library!!!

Recently I have been working on the new api for the Arduino Random library. The library now has methods that return different integer sizes from byte to long. I’m not sure if I’ll add long long though as the delay would be too great. This is because the library will block the MCU until it has gathered all of the entropy. If the source of randomness going into the Arduino’s ADC is not very random the library can take a long time to generate the bits. This is especially true of the von neumann debiasing code since it truncates long stretches of ones or zeros.

The library is based on code by Rob Seward albeit heavily modified. Most of the debiasing code remains the same as well as the calibration code. The new code is now up on Github at https://github.com/infomaniac50/Random/. Feel free to fork away and make changes as you see fit. If you use the code please include links back to this blog. I’m sure Rob would like to see some attribution to him as well.

If anybody has any questions feel free to leave a comment, but please, only if you are human.

Posted by admin in Electronics, Programming, 0 comments

Beware!! The Fraudsters are Lurking in the Shadows!!

Pick PocketAs we all know there are fraudsters out in the world. These people try and quite often succeed at pilfering money from unsuspecting individuals. Yours truly just got a call from a fraudster claiming to negotiate with my credit card company to reduce my interest rate. Sometimes these fraudsters don’t put a lot of effort into the scam. Seeing how I don’t even have a credit card, it’s kind of hard to take them seriously. They didn’t even have a real person on the phone but fraudsters still try anyway without fail to call me but never succeed. I looked up the scam on the FTC website and I found a link to an article that describes the bastards and their tactics. Just another number going into my block list for me though. Anyway here is the link to the article. http://ftc.gov/bcp/edu/pubs/consumer/alerts/alt178.shtm.

BTW. The number they called from is 1-425-406-9028.

Posted by admin in Things that Suck, 1 comment

Yay!!! New Arduino RNG

Here are the results of the new random number generator I built yesterday.
The old random number generator was not putting out an unbiased stream of bits.
I tried using debiasing algorithms with the old generator but it was not enough.

ent LOGGER00.CSV

Entropy is how random a piece of data is, basically how many random bits are in one byte.
True randomness is 8.0 bits per byte.
We are really close. Yay!!! Five Nines!!! Statistically Significant!!! Yay!!!
Entropy = 7.999993 bits per byte.

Basically says how small you could get it with a zip file
Zip files and pretty much all compression schemes do their job by removing patterned and repeating sequences of bits
Optimum compression would reduce the size
of this 25874432 byte file by 0 percent.

Can’t quite figure out what a good figure is on this test
but 50 percent with an average of 254.05 seems good
Chi square distribution for 25874432 samples is 254.05, and randomly
would exceed this value 50.50 percent of the times.

Do the bytes average out to be in the middle
Tests the ratio of ones to zeros in the bit stream
Arithmetic mean value of data bytes is 127.4920 (127.5 = random).

Can we calculate Pi correctly, if so, we pass. Yay for Pi!!! Yay for Pie!!!
Monte Carlo value for Pi is 3.141568568 (error 0.00 percent).

Assuming this tests byte to byte similarities
Which means is the current byte similar to the last one
Serial correlation coefficient is -0.000016 (totally uncorrelated = 0.0).

True_Random_Logger

Random class for Arduino

Logger class for Arduino

Schematic

The diode is a 12.1V zener and C1 is a ceramic disc type capacitor. The zener diode’s part number is an artefact of the designer I used so you can ignore it.

[svg src=/wp-content/uploads/2012/05/RNG2_schem.svg width=550 height=550]


Full Size

Posted by admin in Computers, Electronics, Programming, 3 comments