从长远来看,RSA 保护的数据安全
我正在使用 .net 3.5 和 vb.net。我对下面提到的每种加密的内部工作原理知之甚少。我只使用 .net 类库中提供的类。
我有一条信息,已使用 TripleDes、Rijndael、最后是 RC2 算法进行加密。这些算法的所有 KEY 和 IV 均已分别使用 1024 密钥大小通过 RSA 进行加密。
目前和长期认为这安全吗?
因为我听说RSA加密只有在某些年份才能被认为是安全的。例如,在本文中 768 位 RSA 已破解,1024 位安全(目前)
我应该将 RSA 密钥大小增加到 2048 或更多吗?
更新:
这里的保险箱意味着长期和非常重要的秘密
I'm using .net 3.5 and vb.net. I know little about the inner working of each encryption mentioned below. I just use classes provided in .net class library.
I have a piece of information that have been encrypted with TripleDes, then Rijndael and finally RC2 algorithms. And all KEYs and IVs of those algorithms have been encrypted with RSA using 1024 keysize respectively.
Is that consider safe for now and for long term?
Because I heard that RSA encryption can be considered safe only for certain years. For example, in this article 768-bit RSA cracked, 1024-bit safe (for now)
Should I increase the RSA keysize to 2048 or more?
UPDATE:
The safe here means for long term and for very important secret
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
以下是不同加密算法的密钥长度的列表:http://www.keylength.com。本网站列出的数字被视为标准。如有疑问,请检查那里。 Ecrypt II 方法是最新发布的方法。您可以在此处找到 PDF:http://www.ecrypt.eu.org/documents/D .SPA.13.pdf。即使您对密码学了解不多,它也会是一本有趣的读物,并且看起来相当容易理解(尽管我不能确定,因为我在该领域工作)。
至于用不同的算法多次加密你的原始数据:这是没有用的,只要你使用强大的加密算法。我的建议是使用事实上的标准 AES (= Rijndael)。
至于对称密钥长度,如果您坚持使用 AES,则三个选项中的任何一个(128、192 或 256 位)都可以。事实上,某些针对 256 位 AES 的攻击在 128 位版本上不起作用(由于密钥调度)。不管怎样,到目前为止,已发布的 AES 攻击都没有任何实际用途,所以选择你想要的。
如果您想确保您的密钥不会被解密,可以使用 RSA-2048。顺便说一句,正如您在此表中看到的:http://www.keylength.com/en/3/, AES-128 的强度与 RSA-3248 相同。
[编辑] 但有一个问题:为什么要加密密钥?实际上,您必须将 2048 位 RSA 密钥存储在安全位置才能解密您的 128 位 AES 密钥。我不明白有什么意义。您不妨将 128 位密钥存储在安全的地方并使用它。或者您是否使用多个 RSA 密钥来建立对称密钥?
此外,IV 应该是公开的,没有用隐藏/加密它们,这实际上使它们成为第二个密钥。你已经有钥匙了。所以不用费心去加密它们。
Here is a list for how long keys for different encryption algorithms should be: http://www.keylength.com. The numbers listed on this site are regarded as the standard. When in doubt, check there. The Ecrypt II method is the most recent publication. You can find a PDF here: http://www.ecrypt.eu.org/documents/D.SPA.13.pdf. It makes for an interesting read and seems fairly accessible even if you don't know much about cryptography (although I can't be sure, since I work in the field).
As for encrypting your original data multiple times with different algorithms: this is of no use, as long as you use an encryption algorithm that is strong. My suggestion would be to use the de-facto standard AES (= Rijndael).
As for your symmetic key lenght, if you stick with AES, any of the three options (128, 192 or 256-bit) is fine. In fact, there are certain attacks on 256-bit AES that don't work on the 128-bit version (due to key scheduling). Anyway, none of the published attacks on AES are of any practical use so far, so pick whatever you want.
If you want to be very sure your key won't be decrypted, yes, use RSA-2048. Btw, as you can see in this table: http://www.keylength.com/en/3/, AES-128 is equal in strength to RSA-3248.
[Edit] One question though: why are you encrypting your keys? You effectively will have to store a 2048-bit RSA key in a secure location to be able to decrypt your 128-bit AES key. I don't see the point. You might as well store the 128-bit key somewhere secure and be done with it. Or are you using multiple RSA keys to establish a symmetric key?
Also, IVs are supposed to be public, no use in hiding/encrypting them, that effectively makes them a 2nd key. You already have a key. So don't bother encrypting them.
这实际上取决于您存储的内容以及是否有人可以通过破解它来获得有价值的东西。对于大多数不涉及财务数据或国家机密的内容来说,1024 位加密应该没问题。
但是,如果您希望编写代码并且十多年都不需要再回来编写代码(假设没有错误 ^_^),那么请选择更高位的加密。只要确保您始终记住,没有任何加密是牢不可破的,并且高位加密只能保证很长时间。
这是一个 有趣的链接,讨论如何通过降低处理器的功率来破解 1024 位加密。我认为这也可以扩展到更复杂的加密方案。
此参考似乎也不错。页面上的图形显示 RSA 的解密时间是指数级的。
这是另一篇文章,直接来自 RSA 实验室,其中讨论了需要多长时间才能实现某些大小的密钥被认为不太安全。
底线:如果您正在寻找可以长期使用的东西,一定要选择 2048 位加密。它现在可以工作,尽管您的服务器将花费更多时间来加密(并且解密需要更长的时间),并且将来也可以工作。
It really depends on what you're storing and if anyone has something of great value to gain by cracking it. 1024 bit encryption should by fine for most stuff that isn't dealing with financial data or national secrets.
However, if you're looking to write your code and not have to come back to it for more than a decade (assuming no bugs ^_^) then go for the higher bit encryption. Just make sure you always remember that no encryption is unbreakable, and high-bit encryption is only secure for so long.
Here's an interesting link that talks about how 1024 bit encryption can be cracked by lowering the power given to the processor. I assume this would be scalable to more sophisticated encryption schemes as well.
This reference seems good too. The graphic on the page shows that decryption time for RSA is exponential.
Here's one more article, straight from RSA Laboratories that talks about how long until certain sized keys are deemed less secure.
Bottom Line: If you're looking for something that will work longterm, definitely go with the 2048 bit encryption. It will work now, although your server will take a bit more time to encrypt (and waaay longer to decrypt), and will work in the future.