gpt4 book ai didi

encryption - 密文的接收者如何知道用于加密的 IV?

转载 作者:行者123 更新时间:2023-12-01 09:09:41 27 4
gpt4 key购买 nike

如果在加密明文时使用随机IV,那么密文的接收者如何知道IV是什么以对其进行解密?
这是对上一个关于 IVs here. 的 stackoverflow 问题的回复的后续问题

The IV allows for plaintext to be encrypted such that the encrypted text is harder to decrypt for an attacker. Each bit of IV you use will double the possibilities of encrypted text from a given plain text.

The point is that the attacker doesn't know what the IV is and therefore must compute every possible IV for a given plain text to find the matching cipher text. In this way, the IV acts like a password salt. Most commonly, an IV is used with a chaining cipher (either a stream or block cipher). ...

So, if you have a random IV used to encrypt the plain text, how do you decrypt it? Simple. Pass the IV (in plain text) along with your encrypted text.


等待。你刚才说IV是随机生成的。那么为什么将它作为纯文本与加密文本一起传递呢?

最佳答案

你引用的答案是错误的。因此,如果它对您没有意义,请不要担心。
IV 不会使破解密文变得更加困难。 IVs 通常只是在密文前面加上,因此潜在的攻击者知道。

使用 IVs 的主要原因是随机化密文。如果您使用相同的 key 对相同的明文加密两次,但使用不同的 IV,则密文应该不同。理想情况下,攻击者不应该能够判断两个密文对应于相同的明文还是相同长度的不同明文。更正式地说,使用 IV 以便加密具有 ciphertext indistinguishability .

关于encryption - 密文的接收者如何知道用于加密的 IV?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2436656/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com