c# - 如何在 Azure 辅助角色中生成安全随机数?

标签 c# azure random cryptography azure-worker-roles

我知道使用 RNGCryptoServiceProvider,但是我需要做什么特殊的事情来确保它不会每次都使用相同的种子(例如在启动时)?我需要在初始化时从外部来源提取一些数据吗?或者系统会为我做这件事吗?

最佳答案

很棒的 Microsoft 文档,找不到有关算法或种子的任何内容。

Wikipedia to the rescue :

Windows developers have several alternative means of accessing the CryptGenRandom functionality; these alternatives invoke the same algorithm and share the same security characteristics, but may have other advantages.

...

Using RNGCryptoServiceProvider

Programmers using .NET should use the RNGCryptoServiceProvider Class

请注意,维基百科似乎已经过时,有关更多最新信息,请查看 the Microsoft pages of the CryptGenRandom function

<小时/>

请注意,只有当您实际获得使用 CryptGenRandom 函数的 Microsoft CSP 时,此答案才有效。如果您使用的是非 Windows 平台,或者您引用的是不同的 CSP,请检查这些特定的运行时配置。

关于c# - 如何在 Azure 辅助角色中生成安全随机数?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23620465/

相关文章:

c# - NEST 7.X DateHistogram Interval已过时,建议使用替代返回400

C# 和 SQLite : Resource to Array

c# - csv特殊字符的问题

azure - Http 触发器 Azure Function v2 (python) 按预期执行整个逻辑,但在 Web 请求 4 分钟后给出 504 网关超时

sql - 从oracle中选择随机样本时两个查询之间的区别

带有 OpenMP 线程安全随机数的 C++

c# - 当前上下文中不存在名称 xxx

azure - 关于Azure表设计

azure redis 执行 EVAL 超时

perl - RSA 和 Perl - 如何实现随机性?