要编码的RSA最大块大小是多少? [英] What is the RSA max block size to encode?

查看:102
本文介绍了要编码的RSA最大块大小是多少?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可以在一个周期内加密的RSA最大块大小是多少?

What RSA max block size which I can encrypt in one cycle?

具有4096位密钥大小的RSA算法的最大速度是多少?

And what is the maximum speed of the RSA algorithm with a 4096 bit key size?

推荐答案

根据Lenstra更新的公式,该站点上的>,将4096位RSA密钥的安全级别与至少248位长的加密哈希(例如SHA-256)匹配.

According to Lenstra's updated equations available on this site, the security level of a 4096 bit RSA key is matched by a cryptographic hash which is at least 248 bits long, for instance SHA-256.

(如果应该使用)RSA OAEP,则最多可以加密的数据量因此是模量大小-2-2 *哈希大小,即446字节.

If you use RSA OAEP (and you should), the amount of data you can encrypt at most is therefore modulus size - 2 - 2*hash size, which is 446 bytes.

使用RSA PKCS#1 v1.5,您最多可以加密模数大小-11 个字节,但是RSA PKCS#1 v1.5提供的安全性较低(它不是可证明的安全性,并且最小随机填充字节数应扩展为至少16个字节.

With RSA PKCS#1 v1.5 you can encrypt at most modulus size - 11 bytes, but RSA PKCS#1 v1.5 provides less security (it is not provably secure, and the minimum number of random padding bytes should be extended to at least 16 bytes).

如果您需要加密更多数据,则不要简单地将其切碎并在每个块上多次使用RSA.那是一个安全漏洞.您必须采用另一种方法,更精确地说:

If you need to encrypt more data you should not simply chop it up and use RSA multiple times on each block. That is a security flaw. You must take a different approach, more precisely:

  1. 选择一个随机的128位对称密钥.
  2. 使用经过身份验证的操作模式来加密您的数据(例如AES-128 GCM).
  3. 使用RSA OAEP加密对称密钥.

RSA加密(与解密不同)非常快速,但是时间实际上取决于库和所使用的平台.有关参考,请参见 cryptopp库的网站.

RSA encryption (unlike decryption) is pretty speedy, but the time is really dependent on the library and on the platform you use. For some reference, see cryptopp library's website.

这篇关于要编码的RSA最大块大小是多少?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆