Go Down

Topic: Beta testers needed for a new library that generates true random numbers (Read 9 times) previous topic - next topic

wanderson

I have just published a new library that uses the jitter associated with the watch dog timer and timer one on an arduino to generate truly random numbers.  Preliminary testing indicates that this library generates random sequences with far greater entropy and uniformity than either the randomSeed(analogRead(0)) method or the TrueRandom library which demonstrably does not generate true random numbers.

I would like folks to download and test the software for defects.  While I have tested the software and the algorithms used on all current arduino hardware, UNO (dip and smd), MEGA (R3), and the 32u4 used in the leonardo, I would like to obtain test data from as many different examples of these chips as possible.  To that end I would appreciate any an all folks emailing me (at wandrson01 at gmail.com) with screen captures of the following sketch, along with the type of arduino used (UNO, MEGA, LEONARDO, etc... along with indication if the chip is a smd or dip version).  To be statistically significant the samples need to contain at least 25,000 lines of capture (a few hours run time), but 250,000 (a day and a half) would be even better.  I will collect the results from these samples and publish the statistical performance on the libraries web site.

While it appears that the library is producing cryptographically useful random numbers, the test data needs to be from a much larger sample to verify that.  Here is the test script I need run to collect these samples:

Code: [Select]

// Generate_Random_Numbers - This sketch makes use of the Entropy library
// to produce a serial of random 8 bit integers (bytes) that are streamed
// to the serial port of the arduino
//
// Copyright 2012 by Walter Anderson
//
// This file is part of Entropy, an Arduino library.
// Entropy is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Entropy is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Entropy.  If not, see <http://www.gnu.org/licenses/>.

#include <Entropy.h>

void setup()
{
  Serial.begin(115200);

  // This routine sets up the watch dog timer with interrupt handler to maintain a
  // pool of real entropy for use in sketches.  This mechanism is relatively slow
  // since it will only produce a little less than two 32-bit random values per
  // second.
  Entropy.Initialize();

}

void loop()
{
  // When the random method is called with a single integer parameter it will return
  // a random integer that is in the range: 0 <= random_value < integer parameter
  Serial.println(Entropy.random());
}


The library (zip file) is available from the download page (a link to the library is on the home page) at http://code.google.com/p/avr-hardware-random-number-generation/ as well as an attachment to this post.

The source of the library is also on this site as a git repository and includes the draft of the documentation I have prepared.  I welcome any and all comments.  Any assistance is appreciated.
New true random number library available at: http://code.google.com/p/avr-hardware-random-number-generation/

Current version 1.0.1

pYro_65

I've got a clone mega 2560 I'll set up soon.
But before I do I might try and find a standalone serial app, don't want to use the IDE serial monitor.

EDIT: Is running now, I have at least 48 hours I can donate to this.

pYro_65

I'm not far into this, so I will ask; Do you want the data as binary instead, seems easier to work with when analysing, not to mention the size.
Code: [Select]
#include <Entropy.h>

void setup()
{
 Serial.begin(115200);
 Entropy.Initialize();
}

void loop()
{
 uint32_t u_Data = Entropy.random();
 char *c_Data = ( char* ) &u_Data;
 for( char c_Index = 0 ; c_Index < sizeof( uint32_t ) ; Serial.write( c_Data[ c_Index++ ] ) );
}

wanderson

Thank you.  I chose the ascii data format for two reasons.  One, it avoided any issues with platform specific binary storage formats, which shouldn't matter if the data is truly random, but if not could introduce bias.  And secondly, I wanted it easy for everyone to see what data they were providing me, so it was clear that it wasn't a virus or such.

Feel free to use a zip or other archiving program to compress the ascii file when you email it.  Thanks!
New true random number library available at: http://code.google.com/p/avr-hardware-random-number-generation/

Current version 1.0.1

wanderson


I've got a clone mega 2560 I'll set up soon.
But before I do I might try and find a standalone serial app, don't want to use the IDE serial monitor.

EDIT: Is running now, I have at least 48 hours I can donate to this.


I use minicom on my linux boxes to perform the screen captures.  On windows, older versions will have hyper terminal which would work, new versions of windows could make use of bray's terminal to perform that function.  Also bray's is very useful for other arduino related communication

http://www.smileymicros.com/download/term20040714.zip?&MMN_position=42:42
New true random number library available at: http://code.google.com/p/avr-hardware-random-number-generation/

Current version 1.0.1

Go Up