High entropy random data creating functions?

ぐ巨炮叔叔 提交于 2019-12-25 08:59:22

问题


Are there functions which produce "infinite" amounts of high entropy data? Moreover, do functions exist which produce the same random data (sequentially) time after time?

I kind of know that they exist, but do they have a specific name?

Use case examples:

  • Using the function to generate 100 bits of random data. (Great!) But while maintaining high values of entropy.
  • Using the same function to generate 10000 bits of random data. (The first 100 bits generated are the same as the 100 bits of random data generated before). And while still maintaining high values of entropy

Further, how would I go about building these functions myself?


回答1:


You are most likely looking for Pseudo-Random Number Generators.

  • They are initialized by a seed, thus taking in a finite amount of entropy.
  • Good generators have a decent entropy coming out, supposing you judge it only from its output (thus you ignore the seed and/or the algorithm to generate the numbers, otherwise the entropy is obviously 0).

    Most PRNG algorithms produce sequences which are uniformly distributed by any of several tests. It is an open question, and one central to the theory and practice of cryptography, whether there is any way to distinguish the output of a high-quality PRNG from a truly random sequence without knowing the algorithm(s) used and the state with which it was initialized.

  • All PRNGs have a period, after which a generated sequence will restart.

    The period of a PRNG is defined thus: the maximum, over all starting states, of the length of the repetition-free prefix of the sequence. The period is bounded by the number of the states, usually measured in bits. However, since the length of the period potentially doubles with each bit of "state" added, it is easy to build PRNGs with periods long enough for many practical applications.

Thus, to have two sequences of different lengths where one is the prefix of the other, you just have to run a PRNG with the same seed both times.

Building them yourself would be pretty tricky, but a rather good and simple one is the Mersenne Twister, which dates back to only 1998 and defined in a paper by Matsumoto and Nishimura [1].

A trivial example would be a linear congruential generator.

[1] Matsumoto, M.; Nishimura, T. (1998). "Mersenne twister: a 623-dimensionally equidistributed uniform pseudo-random number generator". ACM Transactions on Modeling and Computer Simulation 8 (1): 3–30. doi:10.1145/272991.272995.



来源:https://stackoverflow.com/questions/28056965/high-entropy-random-data-creating-functions

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!