我正在开发一个使用 Rijndael 算法(C#、ASP.Net 4.5)的加密类,出于好奇,我想知道对字符串进行两次加密有多大好处。我的意思是用一个 key 加密字符串,然后用另一个 key 加密生成的加密结果?
这是否使它更加安全(我知道没有什么是安全的,并且我的软件中可能存在其他可被利用的漏洞)? CPU 开销是否值得(不确定这有多重,但我无法想象它会轻)?
我在网上寻找一些建议,但没有找到。有什么想法吗?
最佳答案
有几个可能对您有用的问题:
- Is there any benefit to encrypting twice using pgp?
- Is encrypting twice good or bad?
- https://crypto.stackexchange.com/questions/779/hashing-or-encrypting-twice-to-increase-security
- https://crypto.stackexchange.com/questions/5382/is-it-safer-to-encrypt-twice-with-rsa
- https://crypto.stackexchange.com/questions/2314/does-encrypting-twice-using-the-same-block-cipher-produce-a-security-weakness
总体思路似乎是这样的:
Well, think about it this way. If breaking one encryption with brute force will take longer than the lifetime of the universe, are you any safer with an encryption scheme that will take twice the lifetime of the universe? No. The first encryption cannot be broken. Adding a second encryption just adds computation overhead with no real benefit. - mikeazo
我建议在 https://crypto.stackexchange.com/ 中提出这个问题,他们可能会为您提供有关该主题的更多详细信息。
关于c# - 将字符串加密两次...好、坏还是丑?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17893164/