Slashdot Mirror


When Is It Random Enough?

TheCamper asks: "The generation of random numbers is very important in many areas, especially encryption. Pseudo Random numbers created by software is simply not good enough. Many key generation applications ask the user to move the mouse or bang on the keyboard to add to the randomness. You can also purchase a (very expensive) hardware random number generator to make truly random numbers. Wanting the randomness of a hardware random number generator without wanting to pay for or build my own, I was wondering if crinkling cellophane (or the like) into my computer's microphone would be considered random enough for serious encryption key generation." What entropy sources would you use for the generation of strong encryption keys?

153 comments

  1. Windy by BladeMelbourne · · Score: 2, Funny

    I prefer to burp or pass wind. Nobody can do that like I can; and the random number produced helps keep my data safe.

    1. Re:Windy by Cipster · · Score: 1

      I've begun to just chart my wife's moods. It's about as close to true randomness you can get. And it works! Nobody has cracked any of my data yet.

  2. White Noise? by bennyp · · Score: 1

    I'm no expert, but perhaps piping some white noise into the audio-in would do it?

    --
    could it be?
    1. Re:White Noise? by poopdeville · · Score: 1

      That's a good idea, but getting good high entropy white noise is as difficult as coming up with good random number generator. Of course, this depends on the context -- this might be an effective source of entropy if one were just generating a few numbers, but it would be completely inappropriate for, say, a bank.

      Of course, that the OP doesn't seem to want to make very many numbers. :-)

      --
      After all, I am strangely colored.
    2. Re:White Noise? by X0563511 · · Score: 2, Interesting

      How about randomly sorted slices of randomly-chosen radio frequencies? I was under the impression that was the kind of thing the NSA uses.

      You could then take the sliced-and-diced random radio noise and apply some kind of simple encryption to it with user entropy and use the result as the random data. That would be pretty random.

      --
      For large sets, this will be our guide even unto death, for the LORD will work for each type of data it is applied to...
    3. Re:White Noise? by poopdeville · · Score: 2, Insightful

      Notice that you require a random sorting of frequencies and samples. You'd need a random number generator to come up with one of those.

      Even if you had one of those, this wouldn't increase the entropy of your data set. The problem is that in slicing and dicing your recording, you'd be creating discontinuities in the function that describes the original wave form. Fourier analysis tells us that this would shift the spectrum upwards, reducing entropy since there's limited bandwidth in our channel.

      If don't believe me, record a cd of white noise and put a couple of scratches in it. It should be immediately apparent where the scratches are when you listen to it. :-)

      --
      After all, I am strangely colored.
    4. Re:White Noise? by X0563511 · · Score: 1

      No, only part of the system needs to be truly random: the radio noise. Randomly sorting and shifting frequencies avoids any patterns that may appear on a particular frequency.

      You could avoid the sudden changes by using a simple cypher as I stated, I believe. Even so, it shouldn't matter if the end use was as a cypher key.

      --
      For large sets, this will be our guide even unto death, for the LORD will work for each type of data it is applied to...
    5. Re:White Noise? by poopdeville · · Score: 1

      You said:
      How about randomly sorted slices of randomly-chosen radio frequencies?

      Then I explained why that was a bad idea. More to the point, we wouldn't need the setup you suggested if we had a source of random electromagnetic radiation! A simple low-noise reciever and analog-to-digital converter would be sufficient. But finding random terrestrial signals is nearly impossible.

      I also don't see why you sant to avoid "patterns" in the signal. All this does is lower entropy. Say we each flip a perfect coin five times. You end up with HTTHT and I end up with HHHHH. Both are random. To wit, say we make a rule that there can't be three consecutive heads in a row. Then we have more information about the pool than when we started.

      --
      After all, I am strangely colored.
    6. Re:White Noise? by X0563511 · · Score: 1

      [click] NOW I get it! That does make sense.

      As for a source of random EM radiation, why not aim a small/cheap radio telescope at the sun and use that? That should be random, right?

      --
      For large sets, this will be our guide even unto death, for the LORD will work for each type of data it is applied to...
    7. Re:White Noise? by poopdeville · · Score: 1

      [click] NOW I get it! That does make sense.

      I'm glad. :-) If you're interested in this sort of stuff, I recommend reading about Information theory before doing cryptography. The basic mathematical idea behind cryptographic functions is that they represent encodings from one alphabet to another with the property that encoding is far easier than decoding. Moreover, these encodings must be recursive (in the mathematical logic sense) and bijective. (Bijectivity might be too strong in some contexts -- characterizing all cryptographic functions is quite difficult because there are many cryptographic paradigms). In any event, recursiveness and bijectivity make the computation of such a function straightforward if one has complete information. This is why randomness plays such a vital role in cryptography. The name of the game is drawing a slip out of a hat and encoding that well enough so that it can't be reverse-engineered and using the encoded version to help us communicate.

      Anyway, I recommend Christopher Adami's Introduction to Artificial Life -- it has a bunch of tangential stuff, and doesn't go in depth in any one topic, but it has about a million great references.

      As for a source of random EM radiation, why not aim a small/cheap radio telescope at the sun and use that? That should be random, right?

      Unfortunately, I'm a math guy. While using the sun sounds plausible, but I don't know enough of the physics involved (though you'd want to use as high a quality radio reciever as possible, to avoid terrestrial interference). I do know that cosmic rays are random, and I wouldn't be surprised if some government agency put a detector on some satellite and is beaming down a stream of random numbers. Frankly, I'd be surprised if this isn't being done.

      --
      After all, I am strangely colored.
    8. Re:White Noise? by Dr.+Evil · · Score: 1

      Kind-of, I'm sure you meant to say it, but you still have characteristics in your microphone, a2d converter and the noise source which will lead toward patterns in the numbers, so you still have to do some mathematical trickery to analyze the ways in which your source is random and then exploit those random aspects and nothing else.

    9. Re:White Noise? by dcsmith · · Score: 1
      I do know that cosmic rays are random, and I wouldn't be surprised if some government agency put a detector on some satellite and is beaming down a stream of random numbers. Frankly, I'd be surprised if this isn't being done

      I don't recall which book it was, but one of the opening scenes in a Tom Clancy novel has Jack Ryan discussing a process to verify that the random numbers generated from the reception of cosmic radiation are actually random. They were planning to use this for encryption...

      --
      This has been a test. If this had been an actual Sig, you would have been amused.
    10. Re:White Noise? by Molf · · Score: 1

      Verify that it's random? I'd love to see that. "No your honour. This sequence could not have possibly been generated randomly." or maybe "Yes your honour. This sequence could only have been generated randomly." Without clarification, you make no sense.

    11. Re:White Noise? by dcsmith · · Score: 1
      Gee, and here I was thinking that without a brain, you didn't make any sense either.

      I'm pretty sure that it would be possible to convince a judge that a sequence was random to a degree of certainty that it would be admissible as evidence. Unless I missed it, we haven't fingerprinted and validated the uniqueness of individual fingerprints of the entire human race. Fingerprints are - at least on occasion - admitted as evidence.

      No, of course there would be no realistic way to prove the data were completely random, but I don't think many people except you misunderstood the intent of my comment. And for those who still have a woody over 'verifying' randomness, note the use of the word novel in the original post. F-i-c-t-i-o-n, dude. It was a story.

      Get over yourself.

      --
      This has been a test. If this had been an actual Sig, you would have been amused.
    12. Re:White Noise? by Molf · · Score: 1

      Okaaay. *Backs away slowly from the scary person* You've largely missed my point. Of course, since you provided no clarification, I shall follow suit. :P

  3. Lava Lamps for Random numbers by zhiwenchong · · Score: 2, Insightful
  4. OK. by CommanderNacho · · Score: 2, Interesting

    How about something like motherboard sensor readings?

    --
    PORN
    PORN
    PORN
    PORN
    1. Re:OK. by dotgain · · Score: 1
      You'd get more entropy out of my ashtray than the mainboard sensors. Dunno about you but the temperatures and voltages in my case stay more or less constant once it's warmed up, hardly what I'd call 256 bits of entropy per second.

  5. Mouse by elzurawka · · Score: 0

    Moving your mouse around for a minute should be enuff, sure it takes a bit, but so does setting up a mic and getting styrophome.
    IMagine how many time the mouse changes direction, and how many different spots u can hit in 60 seconds, I dont think ne1 could reproduce that. I remember Waste(http://waste.sourceforge.net/) asked me to move my mouse around to generate a 1024, or 2048 bit key, have fun cracking something that huge, takes long enuff to crack 128 bit.

    --
    -EL
    1. Re:Mouse by Anonymous Coward · · Score: 0

      Exactly!!!!!!! Thats why I use an Athlon64 3500+. It's 3496 better than a Pentium 4 (and I didn't have the money to go with a 4000+, which would've been 3996 better than the P4).

      What you say? You can't just compare the numbers together? What do you mean they don't measure the same thing? Geez. I guess I don't know anything about this at all. I should probably spend some time reading on it.

      Ok, back. From the context, it looks like you're talking about two different types of encryption: asymmetric and symmetric. The former (also called public key sometimes) uses two keys (thus the asymmetric tag); (when combined with a large number that is the two keys multiplied together in the case of the RSA algorithm) one encrypts data and the other decrypts what the other encrypts. RSA and DSA methods of public key encryption require very large numbers to be secure, usually up around 1024 bits or more (by today's standards).

      Symmetric encryption uses one key to encrypt and decrypt data. To be secure, keys in excess of 128 or so bits are required for many of the algorithms in use today. The US government standard encryption algorithm called AES offers key lengths of 128, 192, and 256 bits. More keybits in this case means more security, but even 256 bits is probably overkill. Given a computer made out of all the matter in the universe, it'd still take more time to decrypt one message than the universe is thought to have left in it. The symmetric algorithm is the strongest link in the security chain when chosen properly.

      Of course, even though 256 bits is overkill for today, a weakness in the algorithm tomorrow (or more likely an implementation error) could hand an attacker half of the keybits. With a 256 bit key, you've got time to fix your system, because a 128 bit keyspace is still huge. With a 128 bit key, you're totally boned. Whatever it was you were trying to protect will be known to your attackers within a decade.

    2. Re:Mouse by Rick+the+Red · · Score: 1
      a weakness in the algorithm tomorrow (or more likely an implementation error) could hand an attacker half of the keybits
      Heck, I can give you half of your keybits right now, for any 256 bit key:

      00000000 00000000 00000000 00000000

      00000000 00000000 00000000 00000000

      00000000 00000000 00000000 00000000

      00000000 00000000 00000000 00000000

      There you go, no charge. You wanna see the other half?

      --
      If all this should have a reason, we would be the last to know.
  6. An idea by Cyphen · · Score: 1

    For those really fancy peeps, wouldn't it be pretty "entropic" to have a device that follows the movements of gas molecules? My understanding is that it is very random what with all of the bounciness involved.

    1. Re:An idea by elzurawka · · Score: 0

      Are we not looking for a cheap alternative. For some reason, i would think u might need a microscope...some something reletivly expensive to get a machine like this running. But maybe u have a cheap way to view things at a molecular level?

      --
      -EL
    2. Re:An idea by KDan · · Score: 1

      And how exactly would you propose to track the movements of gas molecules?

      Daniel

      --
      Carpe Diem
    3. Re:An idea by wayne606 · · Score: 4, Funny

      I think there's a daemon process you can run that will do that - maxwelld I think :-)

    4. Re:An idea by commanderfoxtrot · · Score: 1

      Don't forget the alternative, browniand!

      --
      http://blog.grcm.net/
  7. Lavalamp random number generator by toybuilder · · Score: 0, Redundant
  8. Digitize Zener noise? by Futurepower(R) · · Score: 4, Informative


    Zener diode noise is random. Zener diodes cost less than a dollar. What about digitizing Zener noise? Amplify it with an op amp. Digitize it by feeding it into an Analog to Digital converter.

    1. Re:Digitize Zener noise? by Anonymous Coward · · Score: 3, Informative

      You can get manufactured units to do this for a couple hundred dollars(see http://random.com.hr/ for one). If you search around you can find plans to make things like this yourself(I've heard of using a smoke detector as a radiation source, or thermal noise from resistors, and so on). One thing to keep in mind in all of this is how fast you need your random bits. The ComScire unit(linked by the poster) claim 1 Mb/s. The homemade unit described at http://www.fourmilab.ch/hotbits/> is doing 240 b/s.

    2. Re:Digitize Zener noise? by Monkelectric · · Score: 1
      I *believe* some VIA motherboards/chipsets have an entropy source built into the hardware.

      The real problem like you say is speed. I have been doing research which requires megs of randomn data per second. However, I can't really get that, so 99% of the computation is wasted :)

      --

      Religion is a gateway psychosis. -- Dave Foley

    3. Re:Digitize Zener noise? by Anonymous Coward · · Score: 0

      "I *believe* some VIA motherboards/chipsets have an entropy source built into the hardware."

      Yes, its called the "system memory".

    4. Re:Digitize Zener noise? by Rick+the+Red · · Score: 1

      Read the post immediately above yours. If you can feed your application with random data stored on a file, then you can use a cheap but slow RNG if you buffer it's output via a simple (but huge) data file. If you go this route, then you can cut the time in half by adding another cheap but slow RNG. Halve the time and double the cost recursively until you run out of money or reach a reasonable time. The side effect of this is that you also get twice the files at half the size, which could allow you to spread the data across multiple partitions or even machines, possibly saving data storage costs. Stitch the files together at run time.

      --
      If all this should have a reason, we would be the last to know.
  9. http://www.random.org by NicoNet · · Score: 3, Informative
  10. Binary to decimal by Spock+the+Baptist · · Score: 0

    Try this:

    Flip a coin with heads = 0, and tails = 1 as many times as needed.

    First flip gives a 0 or 1 for the ones,
    Second flip gives a 0 or 1 for the twos,
    Third flip gives a 0 or 1 for the fours,
    Fourth flip gives a 0 or 1 for the eights,
    etc. etc..

    Convert from binary to decimal, and voilà! Random number!

    --
    "Oh drat these computers, they're so naughty and so complex, I could pinch them." --Marvin the Martian
  11. One URL by poopdeville · · Score: 0, Redundant
    --
    After all, I am strangely colored.
  12. Define "strong encryption key". by rjh · · Score: 5, Informative

    IAAGSSTS (I Am A Grad Student Studying This Shit).

    There are two different concerns going on here; the first is the strength of the key and the second is its lifetime. If you really desperately need a truly random 128-bit session key, then take out a quarter and start flipping; it takes about five minutes and you're done. But if you're in a situation where your applications will be changing keys every second, then you don't want rekeying to take five minutes.

    Honestly, the best advice is to look long and hard at your reasoning for trying to roll your own generator. If you can point out precise reasons why you need truly random numbers and back your reasons up with references to the literature, then great, break out a quarter. If you can point out precise reasons why existing PRNGs are all insufficient for your task, then great, try to roll your own.

    Otherwise, find a good pseudorandom number generator--and by "good", I mean "well-understood with good analysis and well-known behavior", such as the ANSI X9.17 pseudorandom number generator. Read up on its weaknesses and where it fails and how it fails. Avoid those failure modes.

    Creating good PRNGs is extraordinarily hard. Trying to roll your own generator is fraught with risk; even when experienced professionals do it, they fail more often than they succeed. If you just want to learn about PRNGs and RNGs, then sure, go for it; I'm all for that. However, be very, very careful before you put your handrolled system into production code.

    1. Re:Define "strong encryption key". by Trepalium · · Score: 2
      Flipping a coin may not be a good idea, either. " A coin is more likely to land on the same face it started out on." Tossed fairly, 51% of the time it'll land on the same face, and 49% of the time it'll land on the opposite face. Tossed unfairly, it may very predictably land on the same face it started on.

      --
      I used up all my sick days, so I'm calling in dead.
    2. Re:Define "strong encryption key". by TheCamper · · Score: 1

      Thanks for the tips. Anyway, basically, I'm not going for 128 bit, etc, keys here. The text in the original question probably wasn't specific enough. What I need truly random numbers for is a one time pad encryption program I just wrote. Because it is one time pad, I need a MASSIVE amount of TRULY random numbers to use, as my key must be the same length as any file I encrypt. Pseudo random number generators aren't good enough. Also, one time pad encryption is mathematically the strongest form of encryption, but it is only as strong as the randomness of its key.

      So basically, I was wondering if noise into my computer's microphone would be considered random enough for this application; it's easy, and I can make an unlimited amount of numbers this way. I was planning on placing a fan next to the microphone, or singing a song, etc. Thanks in advance, and good luck with your degree.

    3. Re:Define "strong encryption key". by John+Hasler · · Score: 1

      > So basically, I was wondering if noise into my
      > computer's microphone would be considered random
      > enough for this application; it's easy, and I can
      > make an unlimited amount of numbers this way.

      Use the noise to seed a good PRNG and you'll be fine.

      Or just use /dev/random on Linux. It does essentially the same thing.

      --
      Warning: this article may contain humor, sarcasm, parody, and perhaps even irony. Read at your own risk.
    4. Re:Define "strong encryption key". by JRIsidore · · Score: 1

      As for the need of massive amounts of random numbers, PRNGs will always repeat the sequence after a time. But there are ways to combine two different PRNGs in a way that this period is extended and can easily be of the order of several exa-bytes (10^18). Depending on how many random bytes you want to extract this might be sufficient.

      --
      :w!q
    5. Re:Define "strong encryption key". by Chess_the_cat · · Score: 2, Insightful

      So don't start it on its face. Hold it perpendicular to a surface and then flip it.

      --
      Support the First Amendment. Read at -1
    6. Re:Define "strong encryption key". by psykocrime · · Score: 1

      So don't start it on its face. Hold it perpendicular to a surface and then flip it.

      So then it'll just land on edge, and you'll be able to read minds for the day, until it gets knocked over..

      --
      // TODO: Insert Cool Sig
    7. Re:Define "strong encryption key". by pthisis · · Score: 1

      No. /dev/urandom does something like that (modulo carefully tracking entropy, whitening with a strong cryptographic has, etc). /dev/random will block if it runs out of entropy, rather than return pseudorandom number generated with a random key.

      --
      rage, rage against the dying of the light
  13. Operating Sytem by vga_init · · Score: 1, Informative
    Since a lot of true randomness comes from I/O--the way users interact with the computer and whatnot--I always thought that it would be a good idea to hand the task of generating random numbers over to the operating system.

    User interaction is random, be it keystrokes, program calls, etc. Other forms of input could also be monitered, such as mouse movements, or even network traffic. Just stick in a little daemon or kernel code that moniters I/O like that and then harvests randomness from it, storing it somewhere to be called upon later by software.

    1. Re:Operating Sytem by Anonymous Coward · · Score: 2, Informative
      RANDOM(4) . . . . . . . BSD Kernel Interfaces Manual . . . . . . . RANDOM(4)

      NAME
      random , urandom -- random data source devices. . . .
      DESCRIPTION
      . . . Addditional entropy is fed to the generator regularly by the SecurityServer daemon from random jitter measurements of the kernel. SecurityServer is also responsible for periodically saving some entropy to disk and reloading it during startup to provide entropy in early system operation. . . .
    2. Re:Operating Sytem by Gilk180 · · Score: 1

      I thought everyone knew about this, but the same are available in linux as /dev/random and /dev/urandom.

      random is completely random and will only give out numbers until it runs out of entropy. urandom continues to hand out numbers even if the entropy of the kernels pool has reached zero.

      Of course any use of these interfaces assumes trust that your OS hasn't been compromised (not a big deal the same is required when you use the computer to encrypt something) and that the implementors did things properly. I can't speak for the BSD implementation, but the linux implementation has been given quite a bit of thought and is well documented (of course I'm not a cryptographic expert, though).

    3. Re:Operating Sytem by elkyle · · Score: 1

      a lot of true randomness comes from I/O--the way users interact with the computer and whatnot

      PGP for Windows does this when generating a new public/private keypair - if the process of text entry of the passphrase does not produce enough random data, then it brings up a screen that instucts the user to move the mouse/pound on the keyboard/whatever until enough data has been collected.
    4. Re:Operating Sytem by John+Hasler · · Score: 4, Informative

      You just described the Linux kernel's /dev/random.

      --
      Warning: this article may contain humor, sarcasm, parody, and perhaps even irony. Read at your own risk.
  14. Some known ways to sample random noise by Tux2000 · · Score: 3, Informative

    * A AM or FM tuner tuned to an unused frequency produces noise. The problem is to find a really unused frequency. Under good weather conditions, even a sender far away may be received, thus the signal is no longer truely random. * All semiconductors produce thermal noise. The base-emitter diode of a germanium PNP transistor, operated in reverse-biasing, is said to produce very much thermal noise. Feed the signal trough an op-amp (uA 741 or similar) so that you get the noise up to line level. Both ways end in an ADC, for example in the line-in of a soundcard. * An old TV (without noise cancelling) tuned to an unused frequency is able to produce the same noise as a tuner, but it additionally offers another way to sample noise: It displays random white and black dots that change 50 or 60 times per second. Add some photo diodes and a lot of duct tape and you get a low-speed digital random noise generator. There is a simple algorithm to improve the quality of the generated noise so that it is more random: Read two bits, B1 and B2, from the raw noise source. If B1 == B2, read again. Return B1. (I don't remember where I read about this algorithm, sorry.) Tux2000

    --
    Denken hilft.
    1. Re:Some known ways to sample random noise by LWATCDR · · Score: 1

      This is what I was going to suggest. You may want to try using a band that is not often used. I call this the Tom Clancey Random number generator.

      --
      See my blog http://ilovecookes.blogspot.com/ for light hearted technical information.
    2. Re:Some known ways to sample random noise by tekiegreg · · Score: 1

      Well it's crackable if I know that you're using this, I'll just set up my little pirate radio station nearby on your frequency...dooh!

      --
      ...in bed
    3. Re:Some known ways to sample random noise by Anonymous Coward · · Score: 0
      Read two bits, B1 and B2, from the raw noise source. If B1 == B2, read again. Return B1.
      That algorithm will yield "0101010101010101[...]".
    4. Re:Some known ways to sample random noise by Anonymous Coward · · Score: 0

      He didn't say B2 was then used as B1. Each cycle uses a different set for B1 and B2.

    5. Re:Some known ways to sample random noise by Ann+Elk · · Score: 1

      Unfortunately, with hardware random number generators it is notoriously difficult to detect when they fail. Basically, the software needs to perform statistical analysis on the random stream and "cut it off" when it exceeds certain bounds.

      BTW -- The B1/B2 algorithm you describe was originally created by Alan Turing, IIRC.

  15. RFC 1750: Randomness Recommendations for Security by joelparker · · Score: 4, Informative
  16. Intel Motherboards by JacquesPinette84 · · Score: 3, Informative

    Some Intel motherboards have a hardware rnd device built-in. There's even a driver in the linux kernel to access the device, and userspace tools (rng-tools) to feed the random bits into /dev/urandom at a specified interval. Check out http://home.comcast.net/~andrex/hardware-RNG/ for more info.

  17. What's so expensive? by sakusha · · Score: 2, Interesting

    I don't understand why people think it's so expensive to make a circuit that produces truly random numbers. Radioactive decay is the absolute gold standard of randomness. I remember seeing a project in someplace like Ciarcia's Circuit Cellar that showed how to use a small radioactive source as a randomness generator, IIRC the total cost was about $25. You can buy commercial radioactive random generators for about $150, for example the RM-60 from:
    http://www.aw-el.com/
    If any hardware manufacturer wanted to incorporate this sort of feature into a chip, it would probably cost about $5 in mass quantities. But the general PC market hasn't demanded this level of true randomness.

    1. Re:What's so expensive? by Detritus · · Score: 1

      I built one of these with an RM-60, a smoke detector and an old laptop computer. It worked great, although it was a bit slow.

      --
      Mea navis aericumbens anguillis abundat
    2. Re:What's so expensive? by rjh · · Score: 2, Insightful

      Radioisotope decay isn't the gold standard of randomness; it's possible to find determinism in it. As it turns out this isn't because of any inherent determinism in whether an atom decays or not, but because of the determinism in the hardware used to measure it. When a Geiger counter trips, it has a certain (finite) refresh time before it will measure another decay event. That means during the refresh time, it will register 0 regardless of whether decay events occur during that time or not.

      A perfect Geiger counter plus a radioisotope equals a perfect random number generator. Unfortunately, perfect Geiger counters don't exist. We can get extremely good randomness from radioisotope-based RNGs, but there are limits even to them.

    3. Re:What's so expensive? by sakusha · · Score: 1

      Please elaborate on the specific mathematics of your allegation, so I can submit an application to revoke Werner Heisenberg's 1932 Nobel Prize in Physics, and have it re-awarded to you.

    4. Re:What's so expensive? by menscher · · Score: 1
      You obviously only read the first sentence, and then fired off an idiotic reply. Try reading the remainder of his post -- the answer is in there.

      Disclaimer: I'm a physicist, not a cryptographer.

    5. Re:What's so expensive? by Sparr0 · · Score: 2, Informative

      This is why no one generates 1s and 0s directly from the Geiger counter. The simplest safe method is to wait for 4 clicks, calculate the time between 1 and 2, then between 3 and 4, and output a 0 or 1 depending on which is higher (corrected for the logarithmic (inverse exponential? i forget my curves) increase in decay time over time).

    6. Re:What's so expensive? by stoborrobots · · Score: 1

      Why wouldn't you set the "reader" module (which is polling the Geiger counter) to only read in increments of 1 refresh interval? Although this reduces the bit-rate which you can get out of the generator, it means that it now fully approximates a "perfect" Geiger counter.

      It is simply a matter of knowing the limits of your system, and designing around them.

    7. Re:What's so expensive? by sakusha · · Score: 1

      I read your entire reply, and it is meaningless gibberish. You're obviously no physicist, or the concept of determinism in measuring radioactive decay would not be any part of your argument. Go study Heisenberg. And then go study some mathematics and cryptography, and come back with an explanation about why you need deterministic processes to produce randomness. Hint: you don't.

    8. Re:What's so expensive? by Ichoran · · Score: 1

      You need deterministic processes to accurately transmit a random signal. If they are not (nearly) deterministic, you can add structure--i.e. nonrandomness--to your random signal. Having nondeterministic processes that produce pure white noise is also perfectly okay, but it is hard to find a nondeterministic process with that quality. Especially when importing data into a computer for deterministic processing there, you tend to suffer from frequency rolloff, quantization error, and so on.

    9. Re:What's so expensive? by John+Hasler · · Score: 1

      Though the random numbers produced by your Geiger counter (or just about any other noise source) are not uniformly distributed they are random in that no matter how many you collect and study you cannot predict the next one.

      Use the output of the Geiger counter to seed a good PRNG and you will have uniformly distributed random numbers good enough for cryptography.

      --
      Warning: this article may contain humor, sarcasm, parody, and perhaps even irony. Read at your own risk.
    10. Re:What's so expensive? by Paul+Crowley · · Score: 1

      And here are some strategies that will safely give more bits:
      http://www.ciphergoth.org/software/unbiasing/

      Correcting for the increase in decay is practically impossible; use a long-lived source.

    11. Re:What's so expensive? by eightball · · Score: 1

      So, wouldn't be possible to configure your 'reader' to consider time in units of the 'certain (finite) refresh time'? Or some similar ways of disregarding that time, such as throwing away that amount of time after a hit. You should also probably be able to autodetect this lag delay by keeping track of the delay after the one and finding the minimum, at least to a certain degree of certainty.

    12. Re:What's so expensive? by Anonymous Coward · · Score: 0
      Disclaimer: I'm a physicist...
      Nobody's perfect.
    13. Re:What's so expensive? by HuguesT · · Score: 1

      Hello,

      Science is difficult and one may find that there doesn't exist definite answers on anything, hence it is very hard to be authoritative.

      In your case, perhaps you would benefit from reading some litterature on Random Number Machines.

      Hint: the grandparent is correct. Radioactive sources are deemed truly random according to QM, but not the way we can measure decay. This is enough to generate some autocorrelation and spoil the randomness.

      An excerpt:

      Santha, M. and U. Vazirani. 1986. Generating Quasi-random Sequences from Semi-random Sources. Journal of Computer and System Sciences. 33: 75-87.

      "Several computational applications require a source of 'random bit-sequences.'" "Unfortunately, the available physical sources of randomness (including zener diodes and geiger counters) are imperfect [9]. Their output bits are not only biased but also correlated."

      All the best.

  18. use /dev/urandom by harlows_monkeys · · Score: 4, Informative
    Your best bet is to use /dev/urandom on Linux or *BSD. If you have to use Windows, there's something equivalent in the crypto API, but I don't recall what it is called.

    These are cryptographically secure PRNGs, which means they are good enough for key generation, one time pads, etc.

    There are a very very very few situations where they aren't good enough, but the only people who are going to be doing things that hit those situations are people who know enough about this subject that they would not need to be asking on Slashdot about this stuff. :-)

    If you must generate your own random numbers, get the book "Practical Cryptography" by Niels Ferguson and Bruce Schneier, and read the section on Fortuna.

    1. Re:use /dev/urandom by Anonymous Coward · · Score: 0
      Please mod parent down, it is incorrect and misleading info - the part about /dev/urandom at least.
      When read, /dev/urandom device will return as many bytes as are requested. As a result, if
      there is not sufficient entropy in the entropy pool, the returned values are theoretically
      vulnerable to a cryptographic attack on the algorithms used by the driver. Knowledge of how
      to do this is not available in the current non-classified literature, but it is theoretically
      possible that such an attack may exist. If this is a concern in your application, use
      /dev/random instead.
      Note that most /dev/random devices still seem to fail NIST rng quality tests regardless of what their man page says.

      Some other random links: http://mathworld.wolfram.com/RandomNumber.html
  19. a nice hot cup of tea by tverbeek · · Score: 2, Funny

    OK, technically it's brownian motion, but isn't that random enough?

    --
    http://alternatives.rzero.com/
    1. Re:a nice hot cup of tea by Cuthalion · · Score: 1

      Plug the long dangly bit of your atomic vector plotter into the tea, and the small plug into your consumer of entropy, and you're good to go.

      --
      Trees can't go dancing
      So do them a big favor
      Pretend dancing stinks!
    2. Re:a nice hot cup of tea by Andy+Mitchell · · Score: 1
      OK, technically it's brownian motion, but isn't that random enough?

      In H2G2 Logic: As every object in the universe exerts an influence on every other object in the universe it is in fact possible to extrapolate all of creation from a small fairy cake. Hence it would be a simple extension of the principle used in the total perspective vortex for anyone to know the exact state of your brownian motion producer at any point so long as they have easy access to the necessary baked good.

      In the real world: I would say brownian motion is pretty damn random. Theoretically if you new the precise position and velocity of every molecule in the tea at one instant you might be able to predict where it will be at some point in the future. However, the Heisenberg Uncertainty Principle means that it is impossible to do this even if you have access to the other persons cup of tea.

  20. Someone should make a... by rekenner · · Score: 3, Funny

    d1,00,000,000 for this...

  21. "Truly Random" by Johnny+Mnemonic · · Score: 1

    Philosophical question: what's meant by truly random? Everything can be predicted if you know the variables that go into it's creation; you could predict the roll of a die, for instance, if you could precisely measure it's velocity when hitting the table and the amount of friction that results.

    So while the OP wants to draw a distinction between "pseudo-random" and "truly random", at what point does a generator change from one to the other?

    That said, I would suppose that a "truly random" generator would involve, for instance, isotope degeneration--not that there is no reason that an isotope decays or not, but it is beyond our (current) understanding of quantum physics to predict it. But surely it must still be the effect of some cause, even if the cause is as yet imperceptible...

    --

    --
    $tar -xvf .sig.tar
    1. Re:"Truly Random" by alienw · · Score: 2, Insightful

      Apparently, you haven't heard of quantum mechanics and Heisenberg's uncertainty principle, which states that it is impossible to know the exact position AND velocity of an electron, thus making the motion of one unpredictable. There are quite a few sources like this -- radioactive decay, various noise sources. In fact, you could probably have a decent random number generator just by sampling the noise on an unused input on a soundcard (the crappier the soundcard, the better).

    2. Re:"Truly Random" by Malor · · Score: 2, Informative

      As I understand it, true randomness only comes from measuring effects at the quantum level, like radioactive decay. (mentioned in other threads here). As nearly as we can determine, individual quantum events are absolutely random and completely unpredictable. We can make fairly precise predictions about groups of events, but we can't predetermine when, say, a given atom will decay. We can tell you about how many will decay in any given second, and this prediction will become more and more precise as events accumulate over time, but we can't tell ANYTHING about an individual event until after it happens. True random number generators depend on this.

      A step up from that are events derived from things believed to be random, like user input. However, they are always mediated by other factors, like the circuitry and response time in the keyboard or mouse, for instance. This is probably pseudo-random data at least some of the time. The numbers are still pretty random, but in theory, skilled cryptographers might be able to tease patterns out of the bitstreams. This could potentially allow them to successfully mount mathematical attacks on encrypted data.

      Another method of generating numbers is with an algorithm... given a seed number, it will produce a stream of 'random' numbers. If the seed and the algorithm are known, many of these streams can be cracked. Because they aren't really random, but have many of the features of true random numbers, they're called pseudo-random. With a strong enough algorithm, at least in theory, encryption based on pseudo-random numbers should be just about as difficult to crack as encryption based on REAL random numbers.

      But even if we can't easily detect it, any number stream generated by an algorithm DOES have a pattern. We may not be smart enough to find it yet, but there's a good chance we may someday be that smart (or have that much computing power). Encryption based on truly random numbers should be crackable only by brute force; no analysis should ever reveal a pattern, since by definition there will be no pattern to find. (If we ever DID find consistent patterns in true random numbers, this would shake our understanding of the universe right down to the foundations... just about to the point of having to start over from scratch.)

      Also note that a number stream generated by a Random Number Generator(RNG) can't be *too* random... if the chaos is too perfect, it becomes order, and is attackable. (weird, eh?)

      I'm neither a cryptographer nor a mathematician. This is how I understand things to be, but I'm just a layperson and could easily be wrong. Pay attention to replies.

    3. Re:"Truly Random" by JRIsidore · · Score: 1

      Slight nitpick: the motion of the electron is fully deterministic, as are the laws of quantum mechanics. If you know the initial state of an electron you can exactly say how it will behave in the future. The randomness comes in when we measure things, i.e. if we disturbe the electron to get its position for example. The outcome of this measurement is not predictable, only the probability of a result can be given.

      --
      :w!q
    4. Re:"Truly Random" by pthisis · · Score: 1

      That said, I would suppose that a "truly random" generator would involve, for instance, isotope degeneration--not that there is no reason that an isotope decays or not, but it is beyond our (current) understanding of quantum physics to predict it. But surely it must still be the effect of some cause, even if the cause is as yet imperceptible

      Surely not. You're positing that the universe is deterministic, which seems like Einstein vainly trying to argue that "God does not play dice" with the universe.

      The current belief is that it's not simply that we don't understand the laws of the universe well: the universe is not, in fact, deterministic and at a quantum level things do behave probablistically.

      --
      rage, rage against the dying of the light
    5. Re:"Truly Random" by Johnny+Mnemonic · · Score: 1

      the universe is not, in fact, deterministic and at a quantum level things do behave probablistically.

      If that's in fact true, I'm afraid it blows my mind. I guess I have good company.

      That an isotope will not decay one moment, but will the next, for truly no reason at all...if there is no reason that precipitates the decay, then why does it at all?

      Well. I guess it'd take more math than I know to have it proved to me, but I can see why it made Einstein uneasy. It's almost like ascribing a will to quantum components.

      --

      --
      $tar -xvf .sig.tar
    6. Re:"Truly Random" by pthisis · · Score: 1

      It's almost like ascribing a will to quantum components.

      In fact, some modern philosophers (e.g. Roger Penrose, The Emperor's New Mind) have quantum randomness as a defense of free will. Although it may (as, e.g., Dennet) by more of a proof of random will.

      --
      rage, rage against the dying of the light
    7. Re:"Truly Random" by Flaming+Foobar · · Score: 1
      In fact, you could probably have a decent random number generator just by sampling the noise on an unused input on a soundcard (the crappier the soundcard, the better).

      I would expect a bad quality soundcard to have all sorts of filters to improve its noise and distortion characteristics (instead of higher-quality components). Wouldn't this make it less than ideal?

      --
      while true;do echo -e -n "\033[s\n\033[u\134_\033[B";done
    8. Re:"Truly Random" by Anonymous Coward · · Score: 0

      Nope.

    9. Re:"Truly Random" by Intron · · Score: 1

      What is freedom other than the ability to act in a non-deterministic manner?

      --
      Intron: the portion of DNA which expresses nothing useful.
    10. Re:"Truly Random" by pthisis · · Score: 1

      What is freedom other than the ability to act in a non-deterministic manner?

      Well, if you can agree on definitions then the whole argument collapses on one obvious solution. Which one depends on the definitions that you agree on.

      Suppose that I'm presented with a choice between vanilla and chocolate ice cream. Imagine the following 3 possibilities:
      1. The universe is completely deterministic. Everything leading up to that point will cause me to pick vanilla.
      2. The universe has is not deterministic. The total of the quantum randomnesses in the universe will lead me to pick vanilla 50% of the time and chocolate 50% of the time (or whatever percentages)
      3. There's consciousness inside me but outside of physics that has preference, moral judgement, etc and will steer (either completely or probablistically) my judgement toward one choice or the other.

      Choices in (3) are non-deterministic within the universe, but not simply random. Of course, whether or not (3) makes any sense depends on the details of the exact theory. But there is at least a good argument that "free will" doesn't traditionally mean making random choices, but actually means there is some consciousness that can act against the way the world is shoehorning it. Whether or not such a thing actually exists is another thread.

      --
      rage, rage against the dying of the light
    11. Re:"Truly Random" by Intron · · Score: 1

      Good formulation of what I meant. Free will then requires the supernatural. Neither the LaPlacian world nor quantum uncertainty has enough room to accomodate it. My personal preference, however, is Javaberry [coffee ice cream + raspberry sherbet swirl].

      --
      Intron: the portion of DNA which expresses nothing useful.
    12. Re:"Truly Random" by Anonymous Coward · · Score: 0

      Actually cryptographers don't want truly random. They want maximum entropy. That cuts out a small percentage of the possible options, which means it is definitely not random, but it cuts out all the weak/dangerous keys and leaves the effective, nasty ones.

      As other people have pointed out in this discussion, flipping a coin 100 times and getting 100 heads is a random result. But it would suck as a private key because of the methods humans generally use to crack codes.

  22. Why not hardware by delirium+of+disorder · · Score: 2, Interesting
    If you want to go through the effort to get good randomness, why not use a method that is fairly simple and proven secure under some testing? This looks like an easy apparatus to make that also could be pretty secure.
    http://www.willware.net:8080/hw-rng.html/
    There are schematics for lots of other HRNGs on the web.

    On the other hand, your choice of a random data source might not matter much at all. Although I'm sure none of this is proven in the formal sense of the word, I strongly suspect that any source of entropy that has some original indeturminability (due to true randomness in the physical world*, complexity of the data's origin, or lack of a human means to measure the source of the data's origin**) is as good a source as any other. Computers can extract entropy from a mix of ordered and disordered data. The data compression WinZIP and bzip2 do is a good example of this. Therefore, I suspect that the security of an RNG rests less or the inherent entropy of the source then on the quality of the algorithm used to amass usable random numbers from the source data.
    *if that exists at all
    **think Heisenberg uncertainty principle

    --
    ------ Take away the right to say fuck and you take away the right to say fuck the government.
  23. So... by Ayanami+Rei · · Score: 1

    Do you, at decrypt time, specify a source file and a pad file stored on a CD you keep locked in a safe when not in use?

    Do you use offsets into a pad and just specify the (secret) offset?

    --
    THIS THING CAN TURN ON A DIME, MACROSSZERO STYLE ALSO FUCK BETA, ~NYORON
    1. Re:So... by TheCamper · · Score: 1

      Do you, at decrypt time, specify a source file and a pad file stored on a CD you keep locked in a safe when not in use?

      Actually, yes. I only store the key file on CD/DVD, and it is (obviously) in system memory during encryption/decryption. The key is never written to hard disk.

      Do you use offsets into a pad and just specify the (secret) offset?

      The program allows you to use an offset, so you can use the unused portions of a key file. As of right now, I have no plans of keeping this offset value secret, as doing so would not add to security.

    2. Re:So... by La+Camiseta · · Score: 1

      it is (obviously) in system memory during encryption/decryption. The key is never written to hard disk.

      Until it consumes too much memory and gets written to swap during extended operations (and if this is on Windows, everything gets preemptively written to swap regardless of memory usage to speed up operations).

  24. VIA mobos by Down8 · · Score: 1

    http://www.via.com.tw/en/initiatives/padlock/hardw are.jsp

    Hardware, and cheap. And, built-in.

    -bzj

    --
    .sig
  25. Why not /dev/random by quickbasicguru · · Score: 1

    Why not /dev/random ?

    It is more random than /dev/urandom

    1. Re:Why not /dev/random by rjh · · Score: 4, Interesting

      /dev/random only has a finite number of bits. It harvests believed-random data from events on the PC. When you exhaust /dev/random, you're out of random data until you get more system events. This is potentially a Really Bad Idea if there are other apps on your machine which also need extremely high-quality believed-random numbers.

    2. Re:Why not /dev/random by harlows_monkeys · · Score: 2, Informative
      Why not /dev/random ?

      With /dev/random, you have to worry about what to do if it blocks, and you have to worry about causing others to block.

      If you really need actual random numbers, as opposed to cryptographically secure random numbers, then yes, you should use /dev/random, but for almost all applications, cryptographically secure random numbers are all that you need, and so using /dev/urandom is sufficient, without the hassle of dealing with blocking.

    3. Re:Why not /dev/random by Anonymous Coward · · Score: 0

      Isn't it always "a Really Bad Idea" to use a blocking device in code that assumes non-blocking behavior?

  26. ob. dilbert by syrinx · · Score: 5, Funny

    Accounting troll: "That's our random number generator."

    RNG: "nine. nine. nine. nine. nine. nine."

    Dilbert: "Are you sure that's random?"

    Accounting troll: "That's the problem with randomness; you can never be sure."

    --
    Quidquid latine dictum sit, altum sonatur.
  27. LavaRnd by kinema · · Score: 2, Interesting

    If you need entropy on the cheap check out LavaRnd. LavaRnd uses a low cost off the shelf "webcam" with it's lens cap in place as a random number generator.

  28. When it comes to security . . by Leroy_Brown242 · · Score: 1

    . . . It's never random enough.

  29. Not good enough? by Psychor · · Score: 1

    Why exactly are pseudo randomly generated (e.g. /dev/urandom) numbers not good enough for your purpose? I can't think of a situation where these numbers, when generated from a suitably random state (for example after some random mouse movements etc.) would not be sufficient. Much as geeks like to discuss ridiculously impractical ways of generating randomness, I really can't see a situation where this would be required. If anyone knows differently and has an example of how a code was cracked due to problems with a cryptographically strong PRNG, I'd be interested to hear it.

    1. Re:Not good enough? by Anonymous Coward · · Score: 0
    2. Re:Not good enough? by Anonymous Coward · · Score: 0
  30. BOFH by Fritzed · · Score: 1

    The BOFH covered this topic yesterday. I think the method he decided on was very secure. -> Fritz

    --
    Spooooon!!!!!
    1. Re:BOFH by Fritzed · · Score: 1

      Oh yeah, I forgot the link.

      -> Fritz

      --
      Spooooon!!!!!
  31. Analog input is good, *IF* by wowbagger · · Score: 3, Informative

    Analog input is a good source of randomness, *IF*.

    IF the input source of the analog converter has a low autocorrelation - in other words, what has gone before has little or no bearing on what is happening now. Crinkling cellophane into a mic *by itself* is a poor choice for randomness because of the relatively long periods of quiet, and because the microphone and input circuits will "color" the signal (specifically, the signal will be low passed by the input circuits and bandpassed by the microphone's response curve, both of which increase the autocorrelation of the signal).

    IF after getting the signal, you then run the signal through a process that will increase the entropy of the signal - like most compression algorithms will (although compression algorithms will still add some non-randomness to the signal in the form of the framing data for the algorithm).

    Most modern motherboard chipsets include a noise diode RNG in them - this is a device which uses the thermal noise of a diode to create real, genuine random numbers. Why are you messing around with your sound card if you have one of these?

    As others have pointed out, under Linux and *BSD you have a great source of good random numbers, /dev/random - and /dev/urandom if you need random-ish number in greater quantities than /dev/random spits them out. /dev/random pulls its entropy from network events, keystrokes, disk access, hardware RNGs (like the afore-mentioned noise diode sources), and many other sources, and applies very strong entropy increasing algorithms to them.

    So why do you wish to re-invent the wheel, when you can get a nice one already made?

    1. Re:Analog input is good, *IF* by forkazoo · · Score: 1
      IF the input source of the analog converter has a low autocorrelation - in other words, what has gone before has little or no bearing on what is happening now. Crinkling cellophane into a mic *by itself* is a poor choice for randomness because of the relatively long periods of quiet, and because the microphone and input circuits will "color" the signal (specifically, the signal will be low passed by the input circuits and bandpassed by the microphone's response curve, both of which increase the autocorrelation of the signal).


      It is traditional to just take the lowest order bit(s) from an analog source. The DAC on your sound card almost certainly doesn't have 16 real bits of precision. So, make some measurements to verify it doesn't have some systematic error (more likely to be a one or a zero), and sample at relatively "long" intervals, like every quarter second, so that there is no particular corellation between the samples. Do a little testing to verify that something tragic isn't happening, and you should be all set. No real need to crinkle the cellophane, since you are using the noise of the DAC, not the sound itself, but whatever floats your boat...
  32. my favorite random number generator by coaxial · · Score: 0

    I always enjoyed the SGI's use of lava lights. There's an open source implementation available, that was mentioned previously.

  33. Anybody want my Araneus Alea I by Eunuch · · Score: 1

    It's a USB hardware RNG about the size of a thumb drive. 100 kb/sec. It's cool but I don't use it much. Linux friendly, and if Java ever gets around to a USB API it will work well with that.

    --
    Transcend Humanity. Please.
  34. Here: by boring,+tired · · Score: 2, Funny

    84213475436342364273642 There's your random number. Use that.

  35. Re:RFC 1750: Randomness Recommendations for Securi by Anonymous Coward · · Score: 0

    ffs! mod this up! its a bloody rfc and answers every question!

    well done Joel! ;)

  36. Re: maxwelld by Anonymous Coward · · Score: 0

    Ha! Bravo.

    What I wouldn't give for a mod point today. Funniest thing I've heard in weeks.

  37. old (nerd) school analog random number generators by imperious_rex · · Score: 1

    Polyhedral dice by the handful!

    Sheeesh, and you call yourselves geeks...

  38. When is pseudo-random enough? by dtfinch · · Score: 2, Informative

    All you need is a large enough seed to produce a pseudo-random stream that will never be broken. A 128 bit key is strong enough to bet your life on and still sleep easy, Take what we can break now, and do it 2^56 times. You might as well use a 256 bit key though, since computers are fast, and you seem a little paranoid.

    The only real question is what stream cipher (cryptographic PRNG) to use. They all strive to produce output that's random enough for cryptography, but they also try to do it as fast as possible. If you're concerned that they data will not be random enough, you can just trade speed for quality by combining the output of several completely different stream ciphers.

  39. Re:old (nerd) school analog random number generato by proverbialcow · · Score: 1

    Polyhedral dice by the handful! ...unless you want to choose a number from a set of three or less, in which case a polyhedron is overkill (and for which a normal six-sided die will work). =)

    --
    The only surefire protection against Microsoft infections is abstinence. - The Onion
  40. Mix PNG and RNG by Sara+Chan · · Score: 4, Informative
    A method that I've used is to download true random bits from
    http://www.fourmilab.ch/hotbits/
    --you can get 16384 bits at a time. Then I use the Muddle-Square method (of Blum, Blum, and Shub: described by Knuth, Art of Computer Programming, ch. 3) to expand those bits.

    For example, manually retrieve 10 Mbits from HotBits (takes a few hours), and then expand those by a factor of 50 via Muddle-Square. That's 500 Mbits that are essentially indistinguishable from true random.

    It's free, and you get to learn a bit about random numbers from reading Knuth.

  41. Biased coins -- not good enough. by cryptor3 · · Score: 4, Interesting

    One (semi) interesting talk I went to recently brought up the point the scheme described isn't random if the coin is biased.

    And this is a reasonable possibility, because you don't know if the coin weighs exactly the same on both sides, or maybe you're really good at flipping heads.

    In order to get unbiased results, there's a simple protocol that will guarantee a non-biased random result. Suppose the probability of heads is p. Then the probability of tails is (1-p).

    Flip the coin twice.
    a. If it comes up heads the 1st time and tails the 2nd, call it a 1.
    b. If it comes up tails the 1st time and heads the 2nd, call it a 0.
    c. If it comes up heads both times or tails both times, re-run the trial until you get one of the first two.

    If the coin flips are assumed to be independent, then the probability of events a and b are p*(1-p) and (1-p)*p, which are equal.

    There are improvements on this scheme which output more random bits per trial (it reduces/removes the probability of the outcome c where your result is inconclusive).

    1. Re:Biased coins -- not good enough. by Anonymous Coward · · Score: 0
      One (semi) interesting talk I went to recently brought up the point the scheme described isn't random if the coin is biased.

      After flipping, you eat the coin.

    2. Re:Biased coins -- not good enough. by cryptor3 · · Score: 1

      After flipping, you eat the coin.

      That was certainly random.

    3. Re:Biased coins -- not good enough. by tjlsmith · · Score: 1
      Not bad - but what you do THEN is make N (a power of two) of these bits and XOR them together.

      If the prob of a head is (1 + Epsilon) / 2 then the prob of a head becomes (1 + Epsilon to the power of N) / 2.

      As Epsilon must be less than one this diminishes towards zero with remarkable speed, and the prob of a head approaches .5 just as fast.

      --
      Mumia Abu-Jamal is *laughably guilty*. Check the evidence.
    4. Re:Biased coins -- not good enough. by cryptor3 · · Score: 1

      No, I think you're mistaken.

      The output of the system I described produces a Bernoulli RV with p precisely equal to 0.5. There are no epsilons about it. It may be some amount of trials before the system produces any output at all, but when it does, the bias on the random variable is guaranteed to be fair, right from the start.

      There is no need to try to "average out" the results by performing more trials. The system you describe may make the difference between your RV and an unbiased RV "insignificant" after enough trials, but it will never be equal.

      For more information, feel free to wade through this paper.

    5. Re:Biased coins -- not good enough. by KillerCow · · Score: 1

      See section 5.2 of rfc1750 for more techniques to remove skew.

    6. Re:Biased coins -- not good enough. by Rick+the+Red · · Score: 1
      Wow! This gives me an idea:

      Transform the output of any psudo-random noise generator into a stream of 8 bit bytes. If a byte is between 0 and 127, call it "heads"; if it's between 128 and 255, call it "tails". Run that stream of "heads" and "tails" through your protocol and I think you've got a true random number generator. It's essentially a filter for a psudo-random number generator that removes the non-random bits, leaving the truly random bits. The cost is that at best, with a truly random input, it takes 32 input bits to get one output bit.

      IANAM (I am not a mathematician), but I believe this may be a true random noise generator. I can't be the first person to think of this. What's wrong with this proposal? What am I overlooking?

      --
      If all this should have a reason, we would be the last to know.
    7. Re:Biased coins -- not good enough. by Rick+the+Red · · Score: 1

      Nevermind. It didn't take long to figure out where I made my mistake, but it took longer than it took me to post the above nonsense. Sorry.

      --
      If all this should have a reason, we would be the last to know.
    8. Re:Biased coins -- not good enough. by toad3k · · Score: 1

      I'm no scientist, but why not instead of counting 1-127 heads and 128-255 tails, instead count odd number of 1's head, even number of 1's tail.

      You may be able to find patterns in the original noise, but to find patterns in the oddness of bits in noise seems extremely unlikely to me.

  42. True Random Numbers by Ed+Almos · · Score: 4, Funny

    Female reasoning, that should be random enough but you might have problems converting the actions of a woman into a series of 32 bit numbers.

    Ed Almos
    Budapest, Hungary

    --
    The more corrupt the state, the more numerous the laws. - Tacitus, 56-120 A.D.
  43. /dev/random and /dev/urandom fail uniformity tests by chongo · · Score: 1
    The /dev/random and /dev/urandom generators appear to not cryptographically strong nor do they appear to be cryptographically sound. In our billion bit test suite (based on the NIST Statistical Test Suite based on the Revised NIST Special Publication 800-22): various /dev/random and /dev/urandom generators showed uniformity flaws in every implementation that we tested. We tested a few other /dev/random and /dev/urandom implementations not listed on the test result table and found a similar level of uniformity failures.

    As rjh also pointed out, the ANSI-X9.17 pseudo-random number generator (a 3-DES based PRNG) is a high quality PRNG. So if you lack a good hardware random source, or if your hardware random source cannot deliver quality values fast enough for your purposes, then the ANSI-X9.17 might be your next best choice.

    --
    chongo (was here) /\oo/\
  44. Re:old (nerd) school analog random number generato by fbjon · · Score: 1
    I was thinking about this the other day..

    How to get untraceable random numbers:

    1. Build soundproof, lightproof, disconnected room in the middle of nowhere.
    2. Enter room with nothing but some wood, tools, paper and pen. Seal room from inside.
    3. Make a number of dice out of wood.
    4. Jumble dice, pick one and throw it.
    5. Congrats, your first random number!
    6. Repeat until finished.
    7. Chop all dice into pieces, incinerate.
    8. Exit room.
    Since the dice-making process and number generating process cannot be observed, and the bias of the dice cannot be determined, what you have is random numbers.

    Also, the bias of individual dice is reduced by the use of several dice, so any bias in the final output could either be because all the dice happened to have the same bias, or just by accident. Either way, it's impossible to know since the dice are hand-made on the spot.

    Also, building of room might not be necessary in all cases.

    --
    True confidence comes not from realising you are as good as your peers, but that your peers are as bad as you are.
  45. Online Random number generator by Anonymous Coward · · Score: 0
  46. Random.org by Anonymous Coward · · Score: 0

    Ok, it's Pseudo-random, but it's not bad :

    " Entropy = 7.999805 bits per character.

    Optimum compression would reduce the size
    of this 1048576 character file by 0 percent.

    Chi square distribution for 1048576 samples is 283.61, and randomly
    would exceed this value 25.00 percent of the times.

    Arithmetic mean value of data bytes is 127.46 (127.5 = random).
    Monte Carlo value for PI is 3.138961792 (error 0.08 percent).
    Serial correlation coefficient is 0.000417 (totally uncorrelated = 0.0). "
    (from http://www.random.org/essay.html )

  47. audio-entropyd and video-entropyd by flok · · Score: 1

    For the situations where /dev/random can't feed enough random-data there are 2 tools for seeding the kernel PRNG: audio-entropyd (which I'm maintaining) and video-entropyd (which I developed myself).
    Audio-entropyd takes a stereo audio-device and calculates random bitstreams of what it 'hears' and feeds that to the kernel. video-entropyd is the same altough it retrieves images from a video4linux-device and feeds that (after processing) to the kernel.

    --

    www.vanheusden.com - home of Multitail, HTTPing, CoffeeSaint, EntropyBroker, rsstail, bsod, listener, nagcon, nagi
  48. OpenBSD by grub · · Score: 1

    OpenBSD makes use of the hardware PRNGs on various hardware cards (and are cheap) and gets entropy from a number of sources.

    --
    Trolling is a art,
  49. random.org by Anonymous Coward · · Score: 0
  50. if you need things like this by XO · · Score: 1

    ...the odds are you are way too paranoid.

    either that, or you're probably doing something you shouldn't be doing.

    --
    "Champagne for my real friends - and real pain for my sham friends!" http://ericblade.postalboard.com/
  51. /dev/random by Mark_MF-WN · · Score: 1

    Unfortunately, IO monitoring is generally somewhat bounded in terms of how much entropy you can gather. There are only so many interrupts per second, only so many context switches per second, etc. I don't know how quickly /dev/random can be exhausted, but I was quite surprised to discover that Java's SecureRandom class can be exhausted if you request as few as 2500 bytes from it at once. Of course, SecureRandom only uses thread-switching behaviour as a source of entropy, so /dev/random can certainly provide more -- but a limit certainly exists, probably up around a few hundred megabytes.

    1. Re:/dev/random by Dr.+Evil · · Score: 1

      /dev/random is pretty slow, if exhausted, would it just spew data more slowly?

  52. Re:old (nerd) school analog random number generato by proverbialcow · · Score: 1

    But say a lack of uniformity in the materials (it's wood, after all) caused one die to be chosen more often than the others in the jumbling process. Or even if the dice are chosen with equal frequency, that the bias on each individual die causes a certain number to be rolled more often for that specific die. Patterns, however slight, would emerge over time.

    Nope, radioactive decay is the way to go. I say you construct a Schrodinger's Cat apparatus and write down a '1' if the cat's still living when you check on it, and a '0' otherwise. Sure, that's a lot of cats (depending on how many bits you need), but you can reuse the cats until you get a 0, and there are a lot of ex-girlfriends out there that need revenging upon.

    --
    The only surefire protection against Microsoft infections is abstinence. - The Onion
  53. Yet another method... by suitepotato · · Score: 1

    Take a picture with a digital camera, pointing it in any direction. Take the bitmap as one large binary number. Truncate at whatever size you wish.

    --
    If my grammar and spelling are off, I am [distracted/tired/careless] (take your pick)
  54. Re:old (nerd) school analog random number generato by fbjon · · Score: 1
    It doesn't matter which die is chosen, since their bias cannot be known. Having several dice is merely a precaution against lack of uniformity in a single die which might become apparent with large amounts of produced randomness. It's only necessary if your handicraft skillz aren't perfect. Any lack of uniformity that might be inherent in the wood itself can't really affect the die making process either. Suppose you make 6 dice. What's the likelihood that all of them get the same bias from the wood? In any case, since you choose yourself where you write the numbers on the dice, make sure you make one dice for every possible number pattern (according to wood grains etc.). Note that the numbers should be written, not carved. Use same amount of ink on all sides.

    Wood is a good material because anyone can handle it. Of course, if you have a portable laser cutter and some metal lying around, go ahead and use them and eliminate all material bias. :)

    --
    True confidence comes not from realising you are as good as your peers, but that your peers are as bad as you are.
  55. Use and Entropy Pool RNG by kentborg · · Score: 2, Informative

    Historically, there are two kinds of random number generators. Pseudo
    random number generators (PRNGs) and hardware random number
    generators.

    The PRNGs started out terrible and ended up being, essentially,
    cryptography. Supply them with a good (and unknown!) seed, and they
    produce excellent output.

    The "true" RNGs are, indeed, random, but frequently have biases (like
    the purported coin that might land 51% of the time on the starting
    face--it has a bias, but it is otherwise a valid random number
    source), these RNGs will need some post processing to clean up these
    biases.

    But you don't really want to use either of them.

    Rather, a modern RNG uses a hybrid "entropy pool" model. The pool is
    the unknown seed, and is used to feed a PRNG algorithm. If the pool
    starts out unknown, the PRNG algorithm will produce good output. On
    the other end, a hardware entropy source is used to mix the pool in on
    going basis. Go ahead and feed biased coin tosses into the pool, the
    PRGN algorithm will remove any biases.

    Where can you get such an RNG? The Linux /dev/urandom works really
    well. Feed your favorite entropy sources into /dev/urandom, pull as
    much random data as you want out of /dev/urandom. I think BSD has a
    similar feature.

    Religious note: /dev/random will block when it computes it is out of
    entropy, /dev/urandom will continue producing output. Some will say
    you must use /dev/random, others will point out that the entropy
    estimation is really hard to do, and /dev/random will block at the
    wrong time and open you up to a denial of service risk. I say use /dev/urandom, but make up your own mind.

    -kb

    1. Re:Use and Entropy Pool RNG by Stonent1 · · Score: 1

      I think I need a random number generator to determine which to use!

    2. Re:Use and Entropy Pool RNG by Anonymous Coward · · Score: 0

      others will point out that the entropy estimation is really hard to do

      It is not a religous issue nor is (p)rng quality evaluation hard to do - see some other comments here for the test suites involved and how even /dev/random still rates poorly on those tests. People who are serious about the quality of their random numbers evaluate their prng output continuously with multiple statistical tests. See the VIA documents which evaluate the entropy per bit for their onchip hardware rng system.

      And the quality of one's prng code can have real world consequences Do you think that Sun, Cisco, SGI, BIND et al intended to create code that looked so spectactularly lame in the plots and output such easily guessable sequences? Developing high quality rng related code is not easy and the code must be tested to determine the quality.

  56. random.org by Anonymous Coward · · Score: 0

    Try here

  57. Stock Market by Dr.+Evil · · Score: 1

    Tap the fluctuations of the stock market.

    If anyone breaks your product due to lack of randomness, get a detailed description and laugh all the way to the bank.

    1. Re:Stock Market by Anonymous Coward · · Score: 0

      Best. Idea. Ever.

  58. Tests by flymolo · · Score: 1

    Volume two of the "Art of Computer Programming" by Knuth has tests for randomness. If the source passes the tests then it is random enough not to be overly prone to cracking by analysis. Random number theory is relatively young though. There may be attacks not yet developed.

    --
    "Sometimes it's hard to tell the dancer from the dance." --Corwin Of Amber in CoC
  59. Re:/dev/random and /dev/urandom fail uniformity te by Anonymous Coward · · Score: 0

    Thank god. Please mod parent up, so people will stop suggesting /dev/*random.

    Can you comment on a few other random topics?

    Have you used the Diehard tests and if so, how do you feel they compare to the 800-22 tests you used.

    What do you think of the tests attempting to show anomalies in random number generation around the time of significant (to humans) events?

    Do you think the type of test used on prngs in this paper could add any value to the tests you are already using?

  60. Slow by Mark_MF-WN · · Score: 1

    Yes, that's what I mean. It would presumably slow down to a crawl as it slowly gathered more entropy. Of course, it might deliberately stop functioning, as an entropy daemon in such a state is almost certainly more open to manipulation.

    Speaking from experience, Java's SecureRandom slows down a few bytes a second, because it has to wait for sufficient context switches to take place within the JVM.

  61. How to verify random number streams by dananderson · · Score: 1
    To verify a stream of random numbers is truely random, pump the random stream (/dev/random) into gzip and look at the byte distribution. If the count of each byte value (0x00 - 0xff) is even, it should be random. If it is not "even", there may be a problemo.

    For example, Linux has a good PRNG distribution based, but *BSD has (or used to have last year--hopefully it is fixed) a poor distribution. The high 2 bytes of are god, but the 2 low bytes are not good (not evenly distributed).

  62. Quantum mechanics: remedial reading by shani · · Score: 1

    Well, the people who discovered quantum mechanics didn't agree with you. This is known as the Copenhagen interpretation.

    Wikipedia kicks ass, by the way. There is a whole article discussing alternate interpretations of quantum mechanics, if you don't happen to agree with Mr. Bohr and his colleagues.

    1. Re:Quantum mechanics: remedial reading by JRIsidore · · Score: 1

      What I described is the Copenhagen interpretation, though maybe I used different terms. What I meant with "motion of the electron" and "the initial state" was the electron's wavefunction, which evolves according to the Schroedinger equation (and thus fully deterministic). The square of the amplitude of the wave function at a certain position x gives the probability to find the electron exactly there if we measure its position. The measurement (however you define this) brings in the probability, but the wave function itself is deterministic.

      --
      :w!q
  63. AU1550 Security Engine by oo7tushar · · Score: 1

    In addition to the aforementioned Intel chips there are also AMD MIPS based solutions that you may look into.
    The Au1550 Security Engine runs seperately from the processor (albeit using the same memory) and has a RNG built in. The RNG uses entropy by letting enough noise build up in a pair of ring oscillators and then querying from them.
    The throughput for the RNG is also fairly high and you can get 412.5K words per second.

    More info.
    http://www.amd.com/us-en/ConnectivitySolutions/Pro ductInformation/0,,50_2330_6625_10509,00.html