DIY Random Number Generator
Compu486 writes "The guys over at Inventgeek have come up with a project and how artical on building
a random number
generator that is less than 100.00 utilizing radioactive decay. Using some
Linux based open source apps and with a little ingenuity and some parts you probably
have laying around your house you can build your own."
I think it should read:
and how to article on...
And I have to wonder...that is less than 100.00 what?
I hooked up a geiger counter to an old school analog game port.
I had a simple C program that just spun between 0 and 255, and when a signal came across the game port it would record the current number.
run that through a hash function of your choice and it worked great.
dont cpus today have some noise generators built into them though?
I know the English may not be the submitter's first language, but it would be nice if the editors....um, you know....*edited* the piece so it made sense.
Michael (Who now sits back and waits for people to pounce on my spelling/grammatical mistakes)
I once collected loads of old broken smoke detectors and ripped out the small cell of americium from each of them.
I placed them into a big ball wrapped in tinfoil (shiney side in), then used my fathers' geiger counter to supply random numbers.
Its been working well, I've been counting the number of years its been running on my fingers, so far I've got to 13.
*note, this is totally false, but there was some stupid kid who did something similar.
liqbase
Whatever happened to just mashing your fists on the keyboard?
If you don't know where you are going, you will wind up somewhere else.
This project seems to work well... http://www.lavarnd.org/
I am a free slashdotter. I will not be modded, blogged, DRM'd, patented, podcasted or RFID'd. My life is my own.
>>
One of the applications I have envisioned for this project is a cheap and easy genuine random number generator. True random numbers in computing are nearly impossible, and successful solutions are very expensive systems based on radioactive decay or atmospheric measurements, for example. Using a small / relatively safe radioactive source and a high res CCD or CMOS sensor and assigning a value to each pixel and perhaps mixing in an algorithm or two with an inexpensive practical PCI card that is capable of generating genuine random numbers. Applications that could greatly benefit from this would be encryption, security applications, Computer AI and the Gambling establishment to name a few.
>>
Actually, no, none of these really benefit from "truly random numbers". The applicability of randomness to AI is... spurious at best? For gambling, you just have to be reasonably sure that someone can't predict in advance what your random sequence is going to be, and the Mersenne Twister plus any unknown piece of data as a seed is good enough at resisting everything our current understanding of mathematics can throw at it. (Yes, thats security through obscurity... in the same way that hiding your server behind locked doors, a firewall, and a secure password is security through obscurity. Its both necessary and sufficient.)
Encryption, similarly, would not benefit from transitioning from an "almost perfect" pseudo-random generator to a "perfect" random generator. For your security to fall based on random numbers, someone needs to be able to not just come up with a theoretical imperfection (ahah, 200 million runs of this random number generator and you'll notice it slightly skews away from these five integers!) but have to crack it wide open. Yay, yawn.
Now, radiation + poorly understood mathematics = geek high, I know. But in terms of practical application this gets a near zero.
Help poke pirates in the eyepatch, arr.
P.S. Clarification: if you're using the Mersenne Twister in a *real life* application that plus a seed value is good enough for a gambling application. For example, if you're generating nice big integers and then taking %6 to get the value of a die or using them to shuffle one or ten or a hundred decks of cards. If, on the other hand, you have some contrived game where you are passing the output directly to the player and continue in the same sequence for a rather improbably long time a player could figure out what sequence the Twister was on and then successfully predict all numbers in advance. But this is one of those earn-you-bonus-points-with-your-CS-professor-and-n ever-use-again pieces of trivia, because in the real world you have to basically design the system to fail for it to fail in this manner.
Help poke pirates in the eyepatch, arr.
IIRC Random.org just uses a soundcard and a radio tuned in between channels and collects atmospheric noise. Sounds much simpler/safer.
For a practical solution, I'd just get a VIA Nehemiah CPU. The later ones have an embedded RNG, and do AES at truly amazing speeds. The actual CPU performance is quite bad compared to pretty much anything else, but it makes a nice quiet box if you don't need vast amounts of CPU power.
And besides, why the emphasis on shielding the camera? You'd think that for a RNG interference is good as it adds more randomness.
Less than 100.00! I've waited at least the past 8 for something like this!
There was a study done that asked a group of people to come up with a string of random ones and zeros. Unsurprisingly, after statistical analysis, they weren't very good. But the fantastic bit was to ask another group to pair off and for each of them to try to outguess the other: let your opponent see your string of ones and zeros so far and then try to make the next bit the opposite to the one they are likely to pick. Amazingly, these random strings were impressively more random. Perhaps we've evolved special pseudo-random number generators to allow us to be sneaky.
[I know, a reference would have been nice, but age does terrible things to your internal bibtex database]
If you find building something yourself to much of a hassle and you have either a webcam or a soundcard lying around, you could give audio-entropyd or video-entropyd a try.
www.vanheusden.com - home of Multitail, HTTPing, CoffeeSaint, EntropyBroker, rsstail, bsod, listener, nagcon, nagi
John Walker, of Autodesk fame, did a similar project, although with a simpler count-the-clicks approach. I copied it using an off-the-shelf Geiger counter and a piece of Autunite; it works well.
Paleotechnologist and connoisseur of pretty shiny things.
This is a well done hardware project, but there was no analysis demonstrating that he could generate random numbers using this hardware.
g enerator
p
i s_200201/ai_n9046353
For example, see
http://en.wikipedia.org/wiki/Pseudorandom_number_
http://www.phy.duke.edu/~rgb/General/rand_rate.ph
http://www.findarticles.com/p/articles/mi_qa3742/
Randomness exists in nature all over the place. In fact, in every single atom, simply because we are not living in a world that is anywhere near a temperature of absolute zero. A johnson noise generator costs a few cents. In analog electronics, keeping randomness *OUT* is actually the harder problem.
Frankly, you don't need all that much true randomness to generate random numbers. You just need to be able to continuously seed a CSPNG from a random source, and not even at a very high rate. A few bits a second is plenty.
Move along,
-Matt
It's good enough to have been passed by all the regulators and is used by our online gaming systems.
A few things of note about dealing with smoke detector sources.
First, removing the source from a smoke detector is illegal in the US. I'm not aware of anyone being put in jail for doing it, but with the state of affairs currently I would not go posting the fact that you did it all over the internet.
Second, those sources can be very dangerous if mishandled. The source is coated in a THIN layer of gold and/or silver.. only a few atoms thick. If you touch it with anything you will break the seal and contaminate the object. If you then happen to touch it, you have a good chance of ingesting or inhaling it. This is bad. Am-231 is what is called a bone-seeker. It will be used in new bone growth and eventually kill you by causing bone tumors and other cancers.
Now with a little care you can be pretty safe, but the article in question should have been a little more explict about the dangers involved here.
From the article, it seems that he was creating something to satisfy his personal curiosity. He put together a good simple plan and actually made it work. That is interesting, fun, and admirable. I did not get the feeling that he set out to save the world from pseudo-randomness; as many have noted, it does not need saving. If he made some over-enthusiastic claims about the utility of his creation, who cares, he made it and it works; and, that is cool. Now, if next week, he starts hawking them at $250.00 each for the Ultimate Internet Privacy Shield, then give him hell. :)
WARNING: Smoking this sig may cause lowered IQ, insanity or short term memory loss. It is also really bad for your monit
There seems to some possiblity for the creation of a superhero here. Wonder what his ability would be?
spoonerize "magic trackpad"
Am-231 is what is called a bone-seeker
The isotope used in smoke detectors is Am-241, not Am-231. Am-231 is too unstable to be listed in standard isotope tables.
Of course, all isotopes of Americium are bone-seekers, so your point remains valid, though I find it a bit nannying. The quantity of Am-241 in a smoke detector is really minute.
2) Pseudo-random number generators (with a sufficiently random seed) aren't good enough? Then maybe you'll be able to tell me what comes next after this base64 encoded output of the
No, the grandparent is right. By avoiding our excellent pseudo-random number generators and going with this hacked together entropy generator you're more likely to decrease your security because of flaws in the hardware than gain a practical increase in security.
// MD_Update(&m,buf,j);
This has actually been done, using the fluctuations of lava lamps as a photon seed. http://www.lavarnd.org/
If you don't know where you are going, you will wind up somewhere else.
You don't need radiation to make a randomizer from a camera. How about pointing the camera out of a window at a road. The cars, the people and other objects (birds) will move around supplying you with random data. Or you could have a transparent plastic box full of mosquitos or flies and point the camera at that ;)
How about using a soundcard and ambient noise? Or you could use an AM radio receiver for static noise. There are plenty of other sources of randomness.
You can't handle the truth.
http://www.random.org/cgi-bin/randnum?num=1&min=1& max=100&col=1
-- Boycott Shell
I don't recommend the internal PCI version - you shouldn't place a gamma emmitter (yes, for the pedantic, Am241 is PRIMARILY an alpha emmitter) inside your case. You will be increasing the odds of a memory bit flip or such.
No, I don't trust in god. He'll have to pay up front, like everybody else.
If you parse the original sentence, it is still technically correct (if a little odd); we often do not use the definite article 'the' to describe something like a language, but it is implicit, especially when making normative standards, that there is a definite object to compare. 'The English' refers to an objective standard; whether such an object even exists is another matter not even vaguely related to the question at hand, and irrelevant, since properly constructed statements may refer to virtual or non-sensical subject matter and still be syntactically well-formed. Interestingly, the difference between "the" and "that", while substantially changing the structure of the sentence, does not much change its content; it basically means the same thing!
All the techniques ever used to make men moral have been themselves thoroughly immoral... (Nietzsche)
No dungeon master worth his weight in geldings goes anywhere without his... twenty-sided die!
mund freud.
A chaotic system would be something where the difficulty in predicting it comes from the complexity of the system, and the ability of small changes to significantly influence the outcome. Radioactive decay doesn't work like that. There's simply a particular event that either happens or doesn't.
I rarely criticize things I don't care about.
Notorious throughout the slashdot community for malapropisms and misspellings.
Funny thing is, I read an interview with Rob where he said he's currently using a Mac. As far as I know, all recent Macs have the option of turning on spell checking across the OS -- so for instance, typing this on my Powerbook I see red underlines under misspelled words in the "Comment" text box on the submission page. Which means that he's either too lazy to turn this feature on -- or worse, too lazy to try and correct misspellings and typos that are already clearly marked.
Interested in a Flash-based MAME front end? Visit mame.danzbb.com
I put together a simple random number generator in the late '90s using avalanche noise from the reverse break-down of a cheap transistor's emitter/base junction. I amplified it with a simple supply noise insensitive 4-transistor amplifier, and pushed it through an 8-bit 40 megabit/sec Analog Devices A/D converter. I xor-ed 80 samples together, while rotating bits in between samples. I used a $3 Lattice PLD to interface the board to an old PCs ISA bus.
... .5*2^i*d^i = .5*(2*d)^i
.5*(2*d)^i
I generated a CD full of random data, which anyone is willing to have if they want it. I've tested it against the "Die Hard" tests, and almost all the 10-meg files pass. There is one test that failed now and then, so I contacted the statistics professor who wrote it. I showed him that his own random number generator, thought to be nearly foolproof, failed the same test with the same probability. It seems I found a bug in his program!
Total cost for components is $10. Anyone who is interested can have schematics for free. Contact me at bill@billrocks.org.
The theory behind it is simple... who cares if the bits from the source are completely random? It turns out you just need a LITTLE true randomness from the source. By xoring bits together that have some randomness, you quickly approach truly random. By my estimate, only God would ever know the difference for the data I generated from perfectly random data, since the board could generate data for billions of years before accumulating even one bit of non-random data in it's output.
Mathematical proof:
Two semi-random bits b1 and b2 each contain small amounts of
non-random noise which we can call d1 and d2. Note that d1 and d2 can
be correlated, and usually are. The notation P(expression) means the
probability that the expression will be 1.
I define P(b1) and P(b2) as:
P(b1) = 0.5 + d1
P(b2) = 0.5 + d2
Both d1 and d2 have a range of -0.5 to 0.5. Xoring b1 and b2 together gives:
P(b1 ^ b2) = P(b1 & !b2) + P(!b1 & b2) = P(b1)*P(!b2) + P(!b1)*P(b2)
= (0.5 + d1)*(0.5 - d2) + (0.5 - d1)*(0.5 + d2)
= 0.25 - 0.5*d2 + 0.5*d1 - d1*d2 + 0.25 + 0.5*d2 - 0.5*d1 - d1*d2
= 0.5 - 2*d1*d2
Squaring a small number makes it very small indeed. If d1 and d2 are
already 0.01, then xoring b1 and b2 together results in a random bit
noise level 0.0002. This leads to the following equation for the
amount of non-random noise defined as n(bits) given the number of bits
in the xor sum:
n(1) = d
n(2) = 2*n(1)^2 = 2*d^2
n(4) = 2*n(2)^2 = 2*(2*d^2)^2 = 2^3*d^4
n(8) = 2*n(4)^2 = 2*(2^3*d^4)^2 = 2^7*d^8
n(i) = 2^(i-1)*d^i =
Here's how you can use this equation. Lets say you believe you have
non-random noise levels of no more than d. You want the noise level
to be less than N. We want to compute the number of bits needed, i:
N = n(i) =
2*N = (2*d)^i
log(2*N) = i*log(2*d)
i = log(2*N)/log(2*d)
So, for example, if you feel your non-randomness per bit is less than 10%,
but you need less than 1 part per billion, we compute the number of bits
needed in the xor-sum:
i = log(2*10^-9)/log(2*.1) = 12.5
In other words, just xor together at least 13 bits.
Beer is proof that God loves us, and wants us to be happy.
You're half right... the experiment in question was indeed positron decay... BUT it was completely a result of momentum conservation. There is no particle left behind so the momentum has to be carried away in a pair of photons, and not a single one.
You're also right that this doesn't apply to aplha decay, because momentum is conserved via the slight recoil in the nucleus - that was a brain fart on my part remembering which type of radiation we're dealing with here.
What you are COMPLETELY FUCKING WRONG about, though, is photons having no momentum. If you had ever studied special relativity, you would know that it's possible to have momentum without mass, and the momentum of a photon is defined as P=E/c, or h*v/c.
Perhaps before you sit here calling me a twit, you should spend half a second googling for the word "photon", fuckwad.
I just use a female-mood-detector. That's _my_ source of high-grade randomness.
Awesome furniture, accessories and cabinetry in Santa Rosa, CA: http://humanity-home.com/
I generated a CD full of random data, which anyone is willing to have if they want it.
:P
640 megabytes is a little much for my connection to handle right now. Could you compress it and send it to me please?
strike
"Someone needs to talk to the tree of liberty about its ghoulish drinking problem." by ohnocitizen