gpt4 book ai didi

c# - BouncyCaSTLe,生成RSA key 对需要多长时间?

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

我正在使用 Bouncy CaSTLe(c#/vb.net 版本)并生成一个 4096 字节的 RSA key 对,以通过此例程在我的证书中使用:

Public Shared Function GenerateRSAKeypair(keylength As Integer) As AsymmetricCipherKeyPair
Dim r As New RsaKeyPairGenerator()
r.Init(New KeyGenerationParameters(New SecureRandom(), keylength))
Dim keys As AsymmetricCipherKeyPair = r.GenerateKeyPair()
Return keys
End Function

程序运行正常,但需要很长时间,最多一分钟(我使用的是 2.4ghz 奔腾双核处理器)。

由于我对 RSA 和所有这些东西没有太多经验(几乎没有),我只是想问一下生成 key 需要这么长时间是否正常,或者我做错了什么。

提前致谢!

最佳答案

在阅读了一些关于 RSA 的理论之后,我可以确认代码没有任何问题,只是需要那么长的时间来生成这么大的 key 。

关于c# - BouncyCaSTLe,生成RSA key 对需要多长时间?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10507634/

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