gpt4 book ai didi

c# - RSACryptoServiceProvider - 在哪里生成种子数据?

转载 作者:太空宇宙 更新时间:2023-11-03 22:29:30 26 4
gpt4 key购买 nike

我有以下使用 RSA 生成公钥和私钥的代码。

// generate RSA 1024
using (var rsa = new RSACryptoServiceProvider(1024))
{
var publicString = RSACryptoService.ExportPublicKeyNoHeaderFooter(rsa);
var privateString = RSACryptoService.ExportPrivateKey(rsa);

rsaKey = Convert.FromBase64String(publicString);
}

My question is on how does RSACryptoServiceProvider generates everytime a random one, does it uses kind of a seed that is based on hardware or on timestamp?

最佳答案

how does RSACryptoServiceProvider generate a random seed? is it based on hardware or on timestamp?

这取决于可用的硬件和您运行的操作系统。如果您在 Windows 上运行,种子的熵可能来自多个来源:

关于c# - RSACryptoServiceProvider - 在哪里生成种子数据?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58738080/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com