30
R1100
124d

There is a function for creating random numbers.
So with the same inputs , I must get the same output.
So it is somewhat predictable.
So it is not actually random!

Am I tight?

Comments
  • 4
    A random number generator function does not take any inputs...
  • 3
    @olback so how does it work?
    Based on time?
  • 2
    @R1100 time is not random. I don't know how they work.
  • 6
    Those are not random number generator but pseudo random number generators

    If you don't know the input you can't predict the output
  • 6
    I don't exactly know what your point is but yes, software can only generate pseudo-random numbers and the distribution of RNG isn't even perfectly uniform.
    That's why physically generated random data is actually needed sometimes
  • 6
    @SanitizedOutput lava lamps to the rescue! 😂
  • 0
    If you need true randomness, this is what you need: https://en.m.wikipedia.org/wiki/...
  • 2
    @R1100 most take a seed (often based on time) an initial input and take the last generated number as the next input
  • 3
    @SanitizedOutput whell
    Many ciphers use random numbers to secure the text.
    If the number is predictable,
    The cipher is broken
  • 4
    @R1100 are there ciphers that directly involve randomness in their algorithm? Wouldn't that make it undecryptable?

    Of course, keys and salt are generated randomly and if you know the seed and algorithm used to generate those, you could recreate them. That's just not more practical than brute-forcing, i guess
  • 2
    @R1100 it's not. As I've said, you can't know the result unless you know the key(input).
  • 3
    @SanitizedOutput exactly
    But i think it will help reduce the brute force time
  • 3
    @R1100 im not an expert in breaking ciphers but I think that would require you to know in which exact microsecond the key was generated with which exact piece of software
  • 3
    @SanitizedOutput a simple script would do that
  • 1
    @SanitizedOutput that's super easy. There are not that many milliseconds and.. You know... You can use computers to do the calculations :)
  • 3
    @irene it probably won't fully break it but it can help reduce the required time
  • 2
    @netikras there are specialized cryptographic RNGs, so it is definitely something to consider when designing software involving crypto, but it all depends on how many possible seeds you have to try.

    Also, i don't mean micro/miliseconds as in "the few digits behind the decimal point".. it's probably a hash value form microseconds since epoch or something more complex
  • 1
    First of all, I think you're tight.

    Second, people who don't believe rng is pseudo should read a bit about it, it's easier that way.

    Third, I'd like to see a truly random generator implementation that is pure software.
  • 1
    afaik linux initializes its random pool, amongst many different sources, from the nanoseconds certain boot events or interrupts took
    from then on the following randomness is generated based upon the previous one until some new randomness is available from the sources
  • 1
    The key is that the rand() function is not idempotent because it has side effects.
  • 2
    Yeah, you doing it right
  • 1
    @ravijojila software random generator is impossible with digital technology. Quantum technology might be able to support true random generation
  • 1
    @irene we don't need quantum computers. Just use an ADC and exploit thermal noise.
  • 1
    @olback that’s not true; the polynomial used needs a seed. Random generator are polynomials with a good distribution, they’re not random wat all but look random enough for most purposes.
  • 2
    @Fast-Nop that's not pure software. It's using some hardware beyond the CPU.
  • 1
    @irene there is no hardware involved in the random generator. It is simply a mathematical function with well distributed output. If you put the same seed (starting point), you get the same output of 'random' numbers. So systems will usually use the system time and a few other variables to get the seed. You can find a lot of different polynomials source code online that will show you how it works.

    It's called a pseudo random generator because it is not random at all, but for most intents and purposes, it looks random.
  • 1
    @thomasd3 have you read the comments besides last one? I know what prng is. The last topic was a software rng (not prng).
  • 1
    @irene ADCs are perfectly normal in some CPUs. Besides, there is no such thing as digital on physical level. If 0 is exceptionally big, it's nearly as big as a small 1.
  • 2
    @Fast-Nop so there are analog to digital converters for temperature?
  • 2
    @irene For randomness, it's only the noise that's relevant. The LSB of an ADC is usually noisy anyway, no matter what you attach.

    Of course, you get even better noise if you use an op amp to amplify the thermal noise of a resistor and then shift that to half the voltage range of the ADC. I remember USB devices which did exactly that, dunno whether they are still available.

    Temperature measurement (where noise isn't the goal) is usually done with a resistor that has a well defined temperature curve, then driving a constant current through that and digitising the voltage across the resistor.
  • 1
    @irene you cannot have a true software rng because it is debatable is random really exists as a thing in the first place: What makes an event random is simply the lack of information about its cause; the moment you can explain it, it is not random anymore. A prng is not random, but measuring external events is not as well. One reply mentions the low bit of an ADC, but at a low level, there is nothing random about it. So you can call anything random if you don't look at the information related to it. Bus schedules can appear random to the person that doesn't know what time is (or anyone that lives in Malta); prng appear random for most purposes, but there is certainly no 'true' random possible in software since it is at a much higher level of understanding than some complex physics events we can already explain are not random.
  • 1
    @thomasd3 we are not talking about philosophy here 😐
  • 1
    @thomasd3 that's not entirely true because thermal noise is random. If you go down to the really micro level for examining causes, you'll only hit Heisenberg's uncertainty principle. That means it's not a question of better measurement equipment, but a basic physical principle.

    The world is not a deterministic clockwork of cause and effect - Newton's take on that got put to rest a 100 years ago.
Your Job Suck?
Get a Better Job
Add Comment