If you set up a pseudo-random number generator in two different locations, but with the same seed, and you assume that they are both on the same number of ticks from startup, will they output the same number?
2 Answers
Yes. This is the fundamental point of a lot of 2-factor authentication tokens. The assumption that using the same algorithm, with the same secret starting conditions will cause the mobile device to output the same as the central device, so someone can enter the value on their screen, and it'll match what the central system says.
- 1,237
- 8
- 7
Yes, as long as it is the same algorithm. Just calling the default “random number” function of a programming language, even with the same seed and number of ticks from start, may or may not produce the same result in different versions of the runtime environment, because the algorithm may become replaced. So if your program relies on this to work properly, the programming must be clarified be sure to always get the same algorithm. It would be good to have some assurance from the programming language developers also concerning future versions of the language / runtime environment.
- 123
- 4
:)– Jan 28 '16 at 07:30