为了保证随机数生成器的诚实,我们的想法是,如果用户愿意,可以验证该数字实际上是从公共(public)熵源生成的。这使系统能够向用户确保服务器无法选择随机数。
$entropy = "what_do_you_think";
$md5 = md5($entropy);
/*take the first 10 hex characters of the md5 hash*/
$hex = substr($md5, 0, 9);
/*convert the hex to decimal*/
$dec = hexdec($hex);
/*use this decimal as a seed*/
srand($dec);
/*pick a random number between 0 and 9, ultimately seeded by the entropy*/
$rand = rand(0,9);
我的问题是:有哪些好的公共(public)熵源(最好是不可变的和困惑的),并且绝对可引用,可以在一个字符串中连接在一起并输入 md5?一些想法是特定的股票价格、温度(来自诚实的来源)、比特币区 block 链中包含的哈希...
最佳答案
查看 xkcd 的 geohashing 算法。我想这正是您要找的。p>
http://wiki.xkcd.com/geohashing/Implementations
geohashing 算法使用 DOW Jones 作为熵源。本页讨论通过网络获取道琼斯指数开盘价的方法。 http://wiki.xkcd.com/geohashing/Dow_Jones_Industrial_Average
但我认为可以在比特币交易数据库中找到公开的、不可变的和可验证的熵的最佳来源。它分布广泛,不断验证,并具有明确的协议(protocol)。
关于php - 网络上的熵源,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12274005/