是否有与QUOT;好" PRNG生成值,而隐藏状态? [英] Is there "good" PRNG generating values without hidden state?

查看:162
本文介绍了是否有与QUOT;好" PRNG生成值,而隐藏状态?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要一个可以计算就像从previous输出纯函数没有任何国家的藏身一些很好的伪随机数发生器。在好我的意思是:

I need some good pseudo random number generator that can be computed like a pure function from its previous output without any state hiding. Under "good" I mean:

  1. 我必须能够参数化发电方式使得运行它 2的n次方迭代与任何参数(或与他们的一些大的子集)应盖之间 0 键,全部或几乎全部值 2 ^ N - 1 ,其中 N 是产值的位数。

  1. I must be able to parametrize generator in such way that running it for 2^n iterations with any parameters (or with some large subset of them) should cover all or almost all values between 0 and 2^n - 1, where n is the number of bits in output value.

组合发电机输出位必须覆盖所有或与 0 几乎所有的价值观和 2 ^(N + P) - 1 如果用完它 2的n次方迭代的每一个可能的组合,其参数,其中 P 是位的参数个数。

Combined generator output of n + p bits must cover all or almost all values between 0 and 2^(n + p) - 1 if I run it for 2^n iterations for every possible combination of its parameters, where p is the number of bits in parameters.

例如, LCG 可以计算像一个纯粹的功能,它能够满足第一个条件,但它不能满足第二个。再说了,我们有32位LCG, M = 2 ^ 32 ,这是不变的,我们的 P = 64 (两个32位的参数 A C ), N + P = 96 ,所以我们必须从输出时有三个整数偷看的数据,以满足第二个条件。不幸的是,条件不能因为输出奇数和偶数整数严格交替的序列满足。为了解决这一问题,隐藏状态必须出台,但使功能并不纯,打破了第一个条件(长期隐匿期)。

For example, LCG can be computed like a pure function and it can meet first condition, but it can not meet second one. Say, we have 32-bit LCG, m = 2^32 and it is constant, our p = 64 (two 32-bit parameters a and c), n + p = 96, so we must peek data by three ints from output to meet second condition. Unfortunately, condition can not be meet because of strictly alternating sequence of odd and even ints in output. To overcome this, hidden state must be introduced, but that makes function not pure and breaks first condition (long hidden period).

编辑:严格地说,我想家人通过 P 位,以全状态的N参数化功能位,每生成点+ N 独特的randomish位的方式,而不仅仅是不断递增( P + N)比特INT。所需的参数化选择的独特的方式。

Strictly speaking, I want family of functions parametrized by p bits and with full state of n bits, each generating all possible binary strings of p + n bits in unique "randomish" way, not just continuously incrementing (p + n)-bit int. Parametrization required to select that unique way.

我是想太多了?

推荐答案

您可以使用任何分组密码算法,具有固定的关键。为了产生下一个数字,解密当前,增加它,并重新加密。由于分组密码是1:1,他们将必然通过在输出域中的每个号码重复之前迭代

You can use any block cipher, with a fixed key. To generate the next number, decrypt the current one, increment it, and re-encrypt it. Because block ciphers are 1:1, they'll necessarily iterate through every number in the output domain before repeating.

这篇关于是否有与QUOT;好" PRNG生成值,而隐藏状态?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆