TDEA和CBC模式?
我正在尝试掌握加密图和 TDEA(三重 DES)的窍门。我知道 TDEA 看起来像这样:
ciphertext = EK3(DK2(EK1(plaintext)))
我也知道链块密码使用 IV 来播种加密和加密之前的纯文本,然后输出是一个块加密后,新的 IV 由第一个块的密文的输出形成。正确的?
这意味着 CBC 模式下的 TDEA 的流程如下:
纯文本 -->四——> TDEA加密-->新四 -->密文
下一个块是:
纯文本 -->新四 --> TDEA加密-->新新四 -->密文
这会持续 n 个块。这是正确的还是我不明白它是如何工作的?
I am trying to get the hang of encryption diagrams and TDEA (Triple DES). I understand TDEA looks something like this:
ciphertext = EK3(DK2(EK1(plaintext)))
I also know a chain block cipher uses an IV to seed the encryption and the plain text before encrypting, and then the output is a block that is ciphered and the new IV is formed from the output of the first block's cipher text. Correct?
This means a TDEA in CBC mode would flow something like this:
Plain Text --> IV --> TDEA encryption --> NEW IV --> Cipher Text
The next block is:
Plain Text --> NEW IV --> TDEA encryption --> NEW NEW IV --> Cipher Text
This continues on for n number of blocks. Is this correct or am I not getting how it works?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您对 CBC 如何运作的概念似乎有缺陷(或者至少我不明白您是如何说您相信事情有效的)。特别是,您显示的是
纯文本 -> IV
,但 IV不(以任何方式)依赖于纯文本。您使用的密码算法基本上与 CBC 本身的工作方式正交(除此之外,它适用于块密码,而不是流密码)。在伪代码中,CBC 看起来像这样:
Your conception of how CBC works seems to be flawed (or at least I don't understand how you're saying you believe things work). In particular, you're showing
Plain Text -> IV
, but the IV does not depend (in any way) on the plain text.The cipher algorithm you use is basically orthogonal to how CBC itself works (beyond the fact that it's for block ciphers, not stream ciphers). In pseudo-code, CBC looks something like this: