什么RSA最大块大小编码? [英] what RSA max block size to encode?

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

问题描述

什么RSA最大块大小,我可以在一个周期加密,什么最大速度的RSA算法与4096密钥大小?

what RSA max block size, which i can encrypt in one cycle, and what maximum speed of RSA algorithm with 4096 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(您应该),您可以使用的数据量因此,最多加密是$ code>模数大小 - 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天全站免登陆