我把我的RSA加密方法带到了MonoDevelop项目中。它已经在起作用了,但用的是一体式
函数ExportParameters()需要4-5分钟。我不能理解。谢谢你的帮助。
RSACryptoServiceProvider rsa = new RSACryptoServiceProvider();
RSAParameters rsaPar = rsa.ExportParameters(false);发布于 2014-04-28 11:01:48
您可以在RSACryptoServiceProvider源代码类中找到答案:
public RSACryptoServiceProvider ()
: this (1024)
{
// Here it's not clear if we need to generate a keypair
// (note: MS implementation generates a keypair in this case).
// However we:
// (a) often use this constructor to import an existing keypair.
// (b) take a LOT of time to generate the RSA keypair
// So we'll generate the keypair only when (and if) it's being
// used (or exported). This should save us a lot of time (at
// least in the unit tests).
}如您所见,ExportParameters()方法正在执行RSA生成,这是一项耗时的操作。它实际花费的时间取决于所使用的PRNG类型,以及您的系统上是否有足够的熵来启动它。
https://stackoverflow.com/questions/23338084
复制相似问题