我应该使用初始化向量(IV)以及我的加密吗? [英] Should I use an initialization vector (IV) along with my encryption?

查看:158
本文介绍了我应该使用初始化向量(IV)以及我的加密吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

建议我使用初始化向量加密/解密我的数据?它会使事情更安全吗?是否需要根据具体情况进行评估?

Is it recommended that I use an initialization vector to encrypt/decrypt my data? Will it make things more secure? Is it one of those things that need to be evaluated on a case by case basis?

为了将其置于实际的上下文中,Win32加密函数 CryptSetKeyParam 允许在加密之前设置密钥上的初始化向量/解密。其他API也允许这个。

To put this into actual context, the Win32 Cryptography function, CryptSetKeyParam allows for the setting of an initialization vector on a key prior to encrypting/decrypting. Other API's also allow for this.

通常推荐什么,为什么?

What is generally recommended and why?

推荐答案

当相同的密钥可能被用于加密多个消息时,必需的。

An IV is essential when the same key might ever be used to encrypt more than one message.

原因是因为在大多数加密模式下,使用相同密钥加密的两条消息可以一起分析例如,在简单的流密码中,XORing使用相同密钥加密的两个密文导致两个消息的异或,可以使用传统的密码分析技术轻松地提取明文。

The reason is because, under most encryption modes, two messages encrypted with the same key can be analyzed together. In a simple stream cipher, for instance, XORing two ciphertexts encrypted with the same key results in the XOR of the two messages, from which the plaintext can be easily extracted using traditional cryptanalysis techniques.

弱IV是使WEP易碎的一部分。

A weak IV is part of what made WEP breakable.

IV基本上将一些独特的非秘密数据混合到密钥中,以防止相同的密钥被使用两次。

An IV basically mixes some unique, non-secret data into the key to prevent the same key ever being used twice.

这篇关于我应该使用初始化向量(IV)以及我的加密吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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