Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.
Photo

Netdunio TRNG


  • Please log in to reply
7 replies to this topic

#1 Arron Chapman

Arron Chapman

    Advanced Member

  • Members
  • PipPipPip
  • 289 posts
  • LocationOregon, USA

Posted 28 November 2010 - 01:47 AM

I've built a True Random Number Generator (TRNG) with my netduino, I bassed the curcuit and the core of the code on Rob Seward's TRNG for the aurduino (http://robseward.com/misc/RNG2/). It seems to work well enough except for the bias, I'm currently running this code http://pastebin.com/rY9rnUzr and I'm seeing results like this:
01101101
11101011
11111111
11101101
11111011
10011111
10111111
10111111
11010110
10111011
11111111

Clearly this has a fairly substantial bias. I tried to impliment a Von Neumann bias filter (also done by Mr. Seward) however, I seem to only have made the bias worse :).

My Von Neumann code:
private static int previous;
//Snip...
private static void vonNeumann(int input)
        {
            if (input != previous)
            {
                byt = byt + input.ToString();
                previous = (in_port.Read() > calibration_value) ? 0 : 1;
            }
        }
This is based on my understanding of Von Neumann's bias filter. Am I doing something wrong or is the universe's entropy just screwing with me?

When you talk EE use small words, I'm just a Software Developer :)
My Blog/Site and Everything Else

If my post helped you please consider pressing the "Like This" button in the bottom right-hand corner.

 

Oh my. So many things, so little money!!

 


#2 Arron Chapman

Arron Chapman

    Advanced Member

  • Members
  • PipPipPip
  • 289 posts
  • LocationOregon, USA

Posted 28 November 2010 - 02:05 AM

I seem to have gotten better bias filtering with the ExclusiveOr option (also proposed by Mr. Seward). The final code is here http://pastebin.com/dYPxRY4N and I'll post a video of it soon. In the mean time here is some example output:
01110101 = 117
00011101 = 29
01110101 = 117
01100000 = 96
01100100 = 100
01010001 = 81
01010001 = 81
01100110 = 102
01010001 = 81
01111101 = 125
00110100 = 52
00110111 = 55
00010001 = 17
00110100 = 52
01110101 = 117
01001101 = 77
01000010 = 66
01010101 = 85
11110000 = 240
01011100 = 92
00010101 = 21
01010101 = 85
01110111 = 119
01011000 = 88
00010111 = 23
01010111 = 87
00010101 = 21
01010111 = 87
01010101 = 85
01010001 = 81
00010001 = 17
00010000 = 16
01000111 = 71
01110001 = 113
01110101 = 117
01010100 = 84
11010001 = 209
01001110 = 78
01010101 = 85
01010101 = 85
00010101 = 21
01011101 = 93
01011100 = 92
01010101 = 85
01000101 = 69
00010101 = 21

When you talk EE use small words, I'm just a Software Developer :)
My Blog/Site and Everything Else

If my post helped you please consider pressing the "Like This" button in the bottom right-hand corner.

 

Oh my. So many things, so little money!!

 


#3 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 28 November 2010 - 03:48 AM

UnkwnTech, Welcome to the Netduino community! This is very cool. There are a ton of possible uses for a true random number generator, especially in security. You have me curious--what are you building with it? Chris

#4 entens

entens

    Member

  • Members
  • PipPip
  • 10 posts

Posted 28 November 2010 - 04:40 AM

What are you using for your external stimuli? I always wanted to try making a TRNG using radiation emissions. Check this project log out for an example of what I mean [www.inventgeek.­com/­Projects/­AlphaRad/­Overview.­aspx]

#5 Arron Chapman

Arron Chapman

    Advanced Member

  • Members
  • PipPipPip
  • 289 posts
  • LocationOregon, USA

Posted 29 November 2010 - 01:46 AM

@Chris Walker who said I was building anything with it ;). It's good enough for me just to say I have a TRNG. @entens according to Rob Seward (the source of my circuit design) it uses "avalanche noise" between 2 of the transistors, though to be honest I'm a complete EE n00b and I have no idea what this means :). I guess my next project should be a Neduino Mini + LCD/7 Segment LEDs + Enclosure, a nice little TRNG box.

When you talk EE use small words, I'm just a Software Developer :)
My Blog/Site and Everything Else

If my post helped you please consider pressing the "Like This" button in the bottom right-hand corner.

 

Oh my. So many things, so little money!!

 


#6 entens

entens

    Member

  • Members
  • PipPip
  • 10 posts

Posted 29 November 2010 - 04:00 PM

@entens according to Rob Seward (the source of my circuit design) it uses "avalanche noise" between 2 of the transistors, though to be honest I'm a complete EE n00b and I have no idea what this means :).


if your curious as to what is providing your noise take a look at this wikipedia article [http://en.wikipedia....che_breakdown]. It gives a pretty good explanation of what causes avalanche noise in electrical circuits. Basically your using the first transistor pair to step the current up to the point where an unknown amount of current is leaking through the insulation thereby creating a noisy signal. The third transistor is stepping the noisy signal to a level that is easily measured by the microcontroller.

You probably already understand this by now, but I figured it be nice to have a short explanation of the methodology for the non EE people here.

#7 Arron Chapman

Arron Chapman

    Advanced Member

  • Members
  • PipPipPip
  • 289 posts
  • LocationOregon, USA

Posted 29 November 2010 - 04:57 PM

@entens thanks for the info. Here is a video of of it in action

When you talk EE use small words, I'm just a Software Developer :)
My Blog/Site and Everything Else

If my post helped you please consider pressing the "Like This" button in the bottom right-hand corner.

 

Oh my. So many things, so little money!!

 


#8 Eric Burdo

Eric Burdo

    Advanced Member

  • Members
  • PipPipPip
  • 130 posts

Posted 29 November 2010 - 05:19 PM

You probably already understand this by now, but I figured it be nice to have a short explanation of the methodology for the non EE people here.



That would be me!

Thanks for the explanation. :)
~ Eric D. Burdo ~ http://brick-labs.com/

Today LED's, tomorrow, the world!!! Well, OK, maybe servos.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.