如何使用RSA或des,md5生成随机数生成器? [英] how to use RSA or des,md5 TO make a random number generator?

查看:219
本文介绍了如何使用RSA或des,md5生成随机数生成器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用RSA或des,md5生成随机数生成器?

how to use RSA or des,md5 TO make a random number generator?

推荐答案

我不会使用其中任何一个生成随机数生成器:它们都不产生随机的数据.看起来似乎不错,但是统计分析几乎可以肯定会显示出模式-这不是您在随机数生成器中想要的模式.

为什么不只使用随机类 [
I wouldn''t use any of them to make a random number generator: none of them generate data which is random. It may look it, but statistical analysis will almost certainly show patterns - which is not what you want in a random number generator.

Why not just use the Random class[^]?
private Random rand = new Random();
...
for(int i = 0; i < 10; i++)
   {
   Console.WriteLine(rand.Next(100).ToString());
   }

会给您10个随机数,范围在0到99之间(含0和99).

在短语这不是您想要的随机数生成器中"中插入"not"(不),我该怎么想呢?容易...-OriginalGriff [/edit]

Will give you 10 random numbers between 0 and 99 inclusive.

[edit]"not" inserted in the phrase "which is not what you want in a random number generator" How could I miss that? Easy... - OriginalGriff[/edit]


回答后续问题:

因此,这是学校的任务...在这种情况下,不要指望太多帮助.
但是,如果您从此处开始,则可以解决问题:
http://en.wikipedia.org/wiki/Random_number_generation#Computational_methods [^ ].一种算法就在此页面上.另外,请尝试按照本文档中的参考文献查找算法.

—SA
To answer the follow-up Question:

So, this is a school assignment… In this case, don''t count on much help.
However, you can solve your problem if you start from here: http://en.wikipedia.org/wiki/Random_number_generation#Computational_methods[^]. One of the algorithm is right on this page. Also, try to find the algorithms following the references from this document.

—SA


这篇关于如何使用RSA或des,md5生成随机数生成器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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