c# - C# RSACryptoServiceProvider Encrypt() 方法如何工作?

标签 c# encryption cryptography rsa

我很好奇,因为 RSA 不是分组密码,但 Encrypt() 方法可以采用任意数量的数据进行加密。

是否使用AES+RSA混合加密?或者它只是简单地(错误地)使用 RSA 作为分组密码?

最佳答案

yet the Encrypt() method can take an arbitrary amount of data to encrypt

根据 MSDN不能

Maximum Length of rgb Parameter
Modulus size -2 -2*hLen, where hLen is the size of the hash.

它甚至有一个 CryptographicException,内容为“rgb 参数的长度大于允许的最大长度。”。

关于c# - C# RSACryptoServiceProvider Encrypt() 方法如何工作?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6442191/

相关文章:

go - 如何从文件中读取 RSA key

c# - 为什么在创建哈希时要将文本转换为字节

c# - 如何向我的 C# Web 应用程序添加文件上传按钮?

c# - .NET MailMessage 和 AlternativeViews 中的 DKIM

c# - 根据条件以编程方式更改 ImageBrush 图像源 (WPF)

c# - 使用公钥解密

java - 这是如何返回 "Given final block not properly padded"的?

c# - 是否有可用的 C#/asp.net 安全库?

php - 无法比较/解密密码 (PHP/Android)

c# - .NET 加密类的线程安全性?