【问题标题】:Seed to java.security.SecureRandom on Windows os在 Windows 操作系统上播种到 java.security.SecureRandom
【发布时间】:2018-11-27 09:38:40
【问题描述】:

我对@9​​87654323@ 和java.security.SecureRandom 课程感兴趣。我发现Random 使用系统时钟来生成种子,SecureRandom 使用/dev/random/dev/urandom 但这些文件在Linux 上,而在Windows 上它使用一些mistic CryptGenRandom。即使这是超级安全的功能,我们是否知道它从哪里获取值?产生种子的地下室是什么?

【问题讨论】:

标签: java windows random seed secure-random


【解决方案1】:

类 java.security.SecureRandom 使用 OS 主机提供的系统 API。每个操作系统都有自己的进程来生成随机数。

在 Windows 中,SecureRandom 使用方法 CryptGenRandom,它是 WinCrypt Windows 库的一部分(包含在 Windows 系统库的 Advapi32.dll 中)。

有关 Windows 功能的所有文档都可以在CryptGenRandom 的 Microsoft 文档中找到

【讨论】:

  • 好的,谢谢!这就是我要找的东西:To form the seed for the random number generator, a calling application supplies bits it might have—for instance, mouse or keyboard timing input—that are then combined with both the stored seed and various system data and user data such as the process ID and thread ID, the system clock, the system time, the system counter, memory status, free disk clusters, the hashed user environment block. This result is used to seed the pseudorandom number generator (PRNG).
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2023-02-04
  • 1970-01-01
  • 2011-01-15
  • 2023-03-08
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多