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

查看:1008
本文介绍了我应该使用初始化向量(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?

推荐答案

原因是因为在大多数加密模式下,使用相同密钥加密的两封邮件可以是一起分析。在简单流密码中,例如,对使用相同密钥加密的两个密文进行异或导致两个消息的异或,从中可以使用传统的密码分析技术容易地提取明文。

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天全站免登陆