Random Number Generation via Hardware

Hi, Is it possible to generating Random Numbers via any hardware ?

Thx in advans, Karthik Balaguru

Reply to
karthikbalaguru
Loading thread data ...

Sure. But the solution depends on the requirements.

Do you need a random number to simulate the throw of a die in a game, or do you need to create a one-time pad that the NSA can't crack ?

Reply to
Arlet Ottens

On Fri, 7 Dec 2007 00:59:28 -0800 (PST), I said, "Pick a card, any card" and karthikbalaguru instead replied:

Yes, and all it takes is a normally open switch and the inability of the human interface (our fingertips) to control the press of the button with any real precision.

Use as high a clock as you can on your processor. Start an internal timer on power-up which cycles forever. Await a button press closure from your switch on any I/O line. When it happens, save the counter value. Again waiting for the opening of the same (now closed) button, save that new counter value when it happens. Do any simple math on the two numbers to use as a random number seed. For example, multiply them and use the result as the seed. Multiply the first by

5, the second by 2 and add them disregarding any overflow. You can use the individual digits of the counter itself to create the math.

Let's say the decimal equivalent of 30335 is in one counter. Add all the digits together repeatedly until you have only a single digit.

3+0+3+3+5=14. Then, 1+4=5. Do the same with the second and use those as multipliers. You can then sample the timer again after your program completes the math to get the final seed.

The possibilities are endless but you get the idea. Even someone intent on making an exactly timed button press won't have a chance against 8 million cycles per second in doing both the opening and the closing exactly the same two times. In human time, this process will occur within a few thousandths of a second.

-- Ray

Reply to
Ray Haddad

Pseudo random numbers (which repeat after a certein period) can be made with shift registers with feedbacks.

For *true* randomness you can measure physical processes with built-in randomness like thermal noise oder radioactive decay and generate your numbers from these results.

Mit freundlichen Grüßen

Frank-Christian Krügel

Reply to
Frank-Christian Kruegel

Le Fri, 07 Dec 2007 00:59:28 -0800, karthikbalaguru a écrit:

I did it many years ago. I implemented (In LCA Xilinx) the well-known Lewis-Payne Fibonnacci-based pseudo RNG that is Xn = (X(n-24) + X(n-55))mod 2^32

The period of this RNG is # 2^85

Theory about RNG's --> D.E. Knuth Books

BTW, you can simulate this in C and plotting samples (with gnuplot) to evaluate random distribution. I did not remember exactly bu it seemed to me that it was a quasi uniform distibution.

--
HBV
Reply to
Habib Bouaziz-Viallet

In fact, it's not possible to generate random numbers any other way.

Do you want random or pseudo-random? Do you want numbers that theoretically cannot be predicted, numbers that we don't know how to predict (or if we know, we aren't telling), or numbers that are merely hard to predict? Are you defending against COTS technology, nation-states, quantum technology, or alien technology?

--
	mac the naïf
Reply to
Alex Colvin

"karthikbalaguru" schreef in bericht news: snipped-for-privacy@s8g2000prg.googlegroups.com...

Google for 'Noise Diode'

--
Posted via a free Usenet account from http://www.teranews.com
Reply to
Jim Relsh

Yes, and many system already do. Seeded generators are very simple, but not truly random. Anyone who knows the exact time when they were seeded, can predict their next result.

Analog systems can be either (multiple) Ring Oscillators, and/or deliberately noisy circuits. Ring Oscillators should be spread-sectrum to avoid snooping systems being able to derive information.

-jg

Reply to
Jim Granville

Yes, and it doesn't even need to be particularly complex. See

formatting link
However, to be doubly sure of good randomness I'd recommend hashing the resulting data with e.g. MD5 to remove any biases caused by the hardware itself.

--
Andrew Smallshaw
andrews@sdf.lonestar.org
Reply to
Andrew Smallshaw

berichtnews: snipped-for-privacy@s8g2000prg.googlegroups.com...

Or "Johnson Noise" "Random number"

-=Dave

Reply to
Dave Hansen
Reply to
Brendan Gillatt

karthikbalaguru ha scritto:

in small microcontroller i'v made simil_roulette. the wheel is a fast pseudo_random ring counter (shift_xor). the pick_number time come from a slow and little variable timer: the charging time of 1 external capacitor placed on 1 I/O pin; current is feed from onchip pullup resistor. if wheel is quite fast (100 rev while timer) then few % variability in timer period make randomness. (thanks electrical noise from uC itself).

ciao

Reply to
lowcost

snipped-for-privacy@s8g2000prg.googlegroups.com...

I find that the idea of using Noise for Random Number generator is really cool :):)

Karthik Balaguru

Reply to
karthikbalaguru

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.