Catch up on stories from the past week (and beyond) at the Slashdot story archive


Forgot your password?

DIY Random Number Generator 227

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."
This discussion has been archived. No new comments can be posted.

DIY Random Number Generator

Comments Filter:
  • by click2005 ( 921437 ) on Sunday August 13, 2006 @11:00AM (#15898192)
    This project seems to work well... []
  • by patio11 ( 857072 ) on Sunday August 13, 2006 @11:04AM (#15898207)
      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.
  • by patio11 ( 857072 ) on Sunday August 13, 2006 @11:11AM (#15898226)
    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.
  • cheap alternatives (Score:4, Informative)

    by flok ( 24996 ) <> on Sunday August 13, 2006 @11:24AM (#15898277) Homepage Journal
    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.
  • No analysis? (Score:4, Informative)

    by rotenberry ( 3487 ) on Sunday August 13, 2006 @11:27AM (#15898288)
    This is a well done hardware project, but there was no analysis demonstrating that he could generate random numbers using this hardware.

    For example, see enerator [] [] s_200201/ai_n9046353 []
  • Re:Old-school (Score:5, Informative)

    by Jerf ( 17166 ) on Sunday August 13, 2006 @12:07PM (#15898414) Journal
    Yes, but the programs that use this don't use just the key distribution. First, they also use the time the keystrokes occur, which is reasonably random.

    Second, you can measure "how random" something is (for suitable definitions of "random") by measuring its "entropy", which is a measure of how many "random" bits is in a given input. The entropy of English text is 1.1 to 1.6 bits per character [], which means to safely obtain a 128 bit key from a bit of English text you need almost as many characters as you want bits. "Smashing on the keyboard's" randomness will probably vary even more, from perhaps as low as ~.5 if you smash poorly to 2.5-3 if you smash "randomly", but you also get the entropy from the timing information, which if you use a very-high-resolution clock contributes several bits itself.

    So, basically, this "statistical analysis" problem is extremely well known, and very well quantified, down to the fractional number of bits of randomness that you can extract from a bit of text. Since these fractional bits can just be added together (four "English text characters" at 1.5 bits apiece gives you 6 strongly-"random" bits), the solution turns out to be very simple: Smash on the keyboard longer, until you've got at least as much entropy as you have bits. Voila, a strongly-random key suitable for almost all purposes. (It probably is suitable for all purposes, but taking a key from radioactive decay has the advantage of letting you know the key is random, whereas with this technique you can only be "very, very, very sure".)

    Handled properly, it's not a problem.

    Many, if not most, modern systems will also maintain an "entropy pool" at the OS level, which uses interrupt timings and other such events to feed the pool, which can then be drawn on by programs in lieu of reading the keyboard directly. This works nicely, and among the inputs used is keyboard and mouse events.

    The nice thing about the entropy pool is the input can really come from anywhere. It doesn't have to be totally random to contribute, it just can't be totally predictable.
  • by iansmith ( 444117 ) on Sunday August 13, 2006 @12:08PM (#15898417) Homepage
    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.
  • by Anonymous Coward on Sunday August 13, 2006 @12:37PM (#15898515)

    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.

  • by amliebsch ( 724858 ) on Sunday August 13, 2006 @12:44PM (#15898537) Journal
    This has actually been done, using the fluctuations of lava lamps as a photon seed. []
  • by iansmith ( 444117 ) on Sunday August 13, 2006 @12:55PM (#15898571) Homepage
    Yes, that was David Hahn [] who used quite a bit of social engineering to get information and equipment to build his own little breeder reactor in his mothers garden shed. A very interesting story. Lots of writeups all over the web.
  • You did, as well. (Score:4, Informative)

    by Elemenope ( 905108 ) on Sunday August 13, 2006 @01:37PM (#15898687)
    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!
  • by ArbitraryConstant ( 763964 ) on Sunday August 13, 2006 @01:42PM (#15898717) Homepage
    For the better part of a century, radioactive decay is what scientists always use when they want to invoke a natural process that is "random." But is radioactive decay really random... that is, are there, say, well-established quantum-mechanical equations that predict this?
    The decay of an atom is a fundementally probability-driven process. You can predict the half-life of a material on a large scale, but it is impossible to predict the decay of an individual atom. And, every signal received by your detector comes from an individual atom decaying, so it's impossible for someone to predict or duplicate.

    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.
  • by ChairmanMeow ( 787164 ) on Sunday August 13, 2006 @01:51PM (#15898761) Journal
    You've got 13 fingers now?! For Christs's sake, throw that thing away. It's not safe!

    Perhaps he's counting in binary on his fingers, in which case he only needs one hand.
  • Re:Typically silly (Score:2, Informative)

    by bitrex ( 859228 ) on Sunday August 13, 2006 @02:57PM (#15899022)
    For anyone interested in doing some experimenting, an NPN transistor connected to a power-supply through a large resistor, with its emitter and base connected to ground makes a great johnston noise source. Take the ouptput from the collector, amplify with an op amp and low-pass filter it, and feed it to an A/D converter and you've got a good starting point for experimentation.
  • by gardyloo ( 512791 ) on Sunday August 13, 2006 @03:56PM (#15899231)
    This was referenced in the book Complexity by Waldorf. At least in that context, it was about a competition among computer programs and genetic algorithms. It may also have shown up in Hofstadter's Fluid Concepts and Creative Analogies. Of course, it may have been done far earlier than the mid-80's, but those are the two books I'd look at first.
  • Re:Typos (Score:3, Informative)

    by larry bagina ( 561269 ) on Sunday August 13, 2006 @06:00PM (#15899639) Journal
    In 1999, when Andover bought slashdot, they paid him a salary of $90,000 (with a 3-year employment contract). That doesn't include the $1.5 million paid for /. or the $3.5 million in stock grants.

  • by Anonymous Coward on Sunday August 13, 2006 @06:13PM (#15899684)
    It was closer to a reactor than you think. Technically it did qualify as a reactor but with an extremely low k value; fortunately for south east Michigan. He did manage to start an easily measureable fission reaction, not with the Americium which is a red herring. In fact the only reason he stopped was when his radiation detector was picking up elevated readings a block away from his lab.
  • by hr raattgift ( 249975 ) on Sunday August 13, 2006 @06:40PM (#15899761)
    On the contrary, he had assembled the pieces of a small and subcritical but reasonably efficient 232Th-fuel-cycle reactor that was happily, if slowly, breeding 233U.

    With some attention to geometry, which is suggested by his parcelling of ash, his 232Th had a reasonable probability of capturing slow neutrons from his small emitter, becoming 233Th, which quickly beta decays into 233Pa which in some days beta decays into 233U . His neutron spectrum was sufficiently fast that more 233U fission than actinide production is plausible. Apart from the low neutron flux of his initiating neutron source, nowhere near enough neutrons are produced in this Thorium cycle to maintain a fast neutron chain reaction, so his reactor would have remained subcritical while still breeding 233U.

    His apparatus was not particularly conventional, but was clearly a breeder reactor, in the form: Th-232+n -> Th-233 (22 m) -> Pa-233 (27 d) -> U-233 (1.6*10^5 a).

    Incidentally, breeding 233U from 232Th is the long term strategy for India, and some small experimental piles there (and in the West in the 50s and 60s) may have looked much like Hahn's description of his own.

    What he might have done next is anybody's guess, but he may have made some gains making a powdered mixture of his 9Be with his 241Am or his 226Ra as is done in some conventional neutron generators.

    He was clearly pretty bright (no pun intended), and good at learning and improvising as he went along.

    Unfortunately for him, Uranium in general is chemically hazardous, and he is also likely to have been accumulating some 232U which has many alpha and gamma emitters in its decay chain. These were obvious and dangerous environmental hazards (not just to him), not least of which is the reactivity surge from 233U production after shutting down and dismantling his reactor, thanks to the relatively long half-life of 233Pa.

If I have seen farther than others, it is because I was standing on the shoulders of giants. -- Isaac Newton