四,随着密文发送,安全吗? [英] Sending IV along with cipher text, safe?

查看:131
本文介绍了四,随着密文发送,安全吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

已经有很多问题是关于四代,加密和共享发送者和接收者之间的IV,但我想做出关于发送从发送端到接收端的IV的最好办法明确岗位。

There have been many questions with regard to IV generation, encryption and sharing the IV between the sender and receiver, but I want to make an explicit post regarding the best way to send the IV from the sender to the receiver.

这一切,我到目前为止看到的帖子,我不确定是否是安全的由$ P $它ppending以密文发送IV中的纯文本。所以,第一个问题是,它是安全的这样做?

From all the posts that I've seen so far, I'm uncertain as to whether it is safe to send the IV in "plaintext" by prepending it to the cipher text. So the first question is, is it safe to do so?

其次,是有更安全的方式进行通信时,通过交换消息共享发送者和接收者之间的IV

Second, is there are safer way to share an IV between the sender and receiver when communicating by exchanging messages?

干杯

推荐答案

是的,它是安全发送IV中明确。这里的证据原因:

Yes, it is safe to send the IV in the clear. Here is the 'proof' of why:

以CBC模式,例如:

您可以看到,一个块的密文异或下一个块的明文。我们需要的IV的原因是因为第一个块上,没有previous密文中使用。如果有与具有四是秘密的安全风险,则安全风险将是present每个块后,由于密文作为IV相同的作用。

You can see that the ciphertext of a block is XORed with the plaintext of the next block. The reason we need an IV is because on the first block, there is no previous ciphertext to use. If there was a security risk with having the IV be secret, then the security risk would be present for every block after, since the ciphertext serves the same role as the IV.

也就是说,虽然说,你需要确保你的MAC它。根据你怎么办消息验证codeS,有人用四篡改可能会篡改与解密得到的明文。加密本身并不能提供消息的完整性。

That being said though, you need to make sure you MAC it. Depending on how you do message authentication codes, someone tampering with the IV could tamper with the resulting plaintext on decryption. Encryption alone does not provide integrity of messages.

此外,对于四代,它取决于你的需求。但多数情况下,你的四需为无规和非predictable。

Also, for IV generation, it depends on your requirements. But most often, your IV needs to be random and non-predictable.

这篇关于四,随着密文发送,安全吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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