AES 及其密码模式
我尝试使用 AES 进行加密/解密,然后尝试了 CBC 和 AES。欧洲央行模式 我从这三个中得到了相同的加密输出!事情就是这样吗?
这可能没有错,但我只是不知道会发生什么。如果它们都产生相同的密码,那么拥有模式又有什么意义呢?是时间复杂度还是性能复杂度?
您能解释一下 AES 及其密码模式之间的区别吗?默认的密码模式是什么?或者如果你能给我任何参考资料,因为MSDN不够清楚,
谢谢
I was trying encryption/decryption with AES then I tried the CBC & ECB modes
I got the same encrypted output from all three ! is this how it goes?
it's may not be wrong but I just don't know what to expect . and what's the point of having modes if they all produce the same cipher ? is it time or performance complexity ?
can you explain the difference between AES and its cipher modes ? what's the default cipher mode ? or if you can give me any references cuz MSDN is not clear enough
thank you
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
CBC 和 ECB 模式是在加密大于一个块(AES 中为 128 位)的数据时使用对称加密算法的方法。因此,如果您要加密适合一个块的数据,那么 CBC 和 ECB 模式将产生相同的密文(假设您在使用 CBC 模式时使用空 IV)。如果您加密的数据大小大于一个块,或者您使用的 IV 不为空,并且您看到相同数据的 CBC 和 ECB 加密结果相同,则说明您的代码中出现了错误。
这在维基百科条目中得到了很好的解释。
http://en.wikipedia.org/wiki/Block_cipher_modes_of_operation
CBC and ECB modes are ways to use symmetric encryption algorithms when you are encrypting data that is larger than one block (128 bits in AES). So, if you are encrypting data that fits into one block then CBC and ECB modes will result in the same ciphertext (assuming you are using a null IV when using CBC mode). If you are encrypting data greater in size than one block, or you are using an IV that is not null, and you are seeing CBC and ECB encryptions of the same data come out the same, you're doing something wrong in your code.
This is explained very well in the Wikipedia entry.
http://en.wikipedia.org/wiki/Block_cipher_modes_of_operation