实现Rijndael解密时是否可以不使用IV?

编程入门 行业动态 更新时间:2024-10-28 16:22:43
本文介绍了实现Rijndael解密时是否可以不使用IV?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我正在使用Rijndael算法实现密文解密.不幸的是,我无法访问数据的加密,只获得了密码(用于生成密钥)和算法类型.

I am implementing a decryption of ciphertext using Rijndael's algorithm. Unfortunately, I have not got access to the encryption of the data and have only been provided with a password (to generate the key with) and the type of algorithm.

我没有盐(似乎还可以),也没有静脉注射.现在,我的问题是我是否绝对必须具有IV才能执行解密?我怀疑编写加密的开发人员没有使用盐或IV(如果可能的话).

I do not have a salt (which seems to be ok), and I do not have the IV. Now, my question is whether I absolutely have to have the IV in order to perform decryption? I suspect the developers who wrote the encryption made no use of salt, or IV (if this is even possible).

我试图将IV设置为null,没有运气,并且生成Rijndael实例会创建一个默认IV,这会使解密后我的纯文本的前16个字符失真.

I have tried to set the IV to null, with no luck, and generating a Rijndael instance creates a default IV, and this is distorting the first 16 characters of my plaintext after decryption.

有什么方法可以抵消IV的影响吗?还是需要尝试掌握加密中使用的IV?

Is there any way to negate the effect of the IV? Or do a need to try and get hold of what IV was used in the encryption?

推荐答案

如果该密码已用于CBC模式下的加密(是默认),那么您必须了解IV,无法解决它.

If the cipher has been used to encrypt in CBC mode (which is the default) then you have to know the IV, there's no way around it.

但是,由于IV的目的与密码的目的不同,因此有时您会在加密数据之前找到IV(以便接收者在解密时可以轻松获取它以供使用).

However, since the purpose of the IV is not the same as the purpose of the password, sometimes you find the IV prepended to the encrypted data (so that the recipient can easily grab it to use when decrypting).

更多推荐

实现Rijndael解密时是否可以不使用IV?

本文发布于:2023-06-05 20:23:41,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/527637.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:Rijndael   IV

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!