52 Things - Number 18: Draw a diagram (or describe) the ECB, CBC and CTR modes of operation
52件事-第18件:绘制(或描述)ECB、CBC和CTR的操作模式 This is the latest in a series of blog posts to address the list of '52 Things Every PhD Student Should Know' to do Cryptography: a set of questions compiled to give PhD candidates a sense of what they should know by the end of their first year.这是一系列博客文章中的最新一篇,旨在解决“每个博士生都应该知道的52件事”做密码学:这是一组问题,旨在让博士生在第一年结束时了解他们应该知道什么。
Week 18's task is to draw a diagram (or describe) the ECB, CBC and CTR modes of operation. Someone on Wikipedia has already gone a good job of drawing some nice diagrams, so for the purposes of this blog post I'll stick to explaining the rationale behind them, providing links where appropriate.
第18周的任务是绘制(或描述)ECB、CBC和CTR的操作模式。维基百科上的一些人已经很好地绘制了一些漂亮的图表,所以为了这篇博客文章的目的,我将坚持解释它们背后的原理,并在适当的地方提供链接。
Modes of operation: the security provided by a block cipher applies to the encryption or decryption of a single fixed-length plaintext "block". When the encryption or decryption of messages longer than a block is required (as is typical), we use a mode of operation to link together the encryption of multiple blocks of plaintext. As we will see, the approach used to chain multiple blocks together is important.
操作模式:分组密码提供的安全性适用于单个固定长度明文“块”的加密或解密。当需要对长于一个块的消息进行加密或解密时(这是典型的),我们使用一种操作模式将多个明文块的加密链接在一起。正如我们将看到的,用于将多个块链接在一起的方法很重要。
Electronic Codebook (ECB) mode. (Encryption) (Decryption). ECB mode is the most straightforward approach---the plaintext is divided into m blocks, where each block is encrypted separately using the same key. The inherent problem with ECB mode is that repeated plaintext blocks produce the same ciphertext blocks. The best illustration of this problem is with the encryption of images, where repeated patterns in the original image reappear in the encrypted image. See, for example, the source image and the corresponding ECB encrypted image.
电子代码簿(ECB)模式。(加密)(解密)。ECB模式是最直接的方法——明文被划分为m个块,其中每个块都使用相同的密钥单独加密。ECB模式的固有问题是重复的明文块产生相同的密文块。这个问题的最好例证是图像的加密,其中原始图像中的重复图案在加密图像中重新出现。例如,请参见源图像和相应的ECB加密图像。
Cipher-block chaining (CBC) mode. (Encryption) (Decryption). CBC mode takes away the limitations of ECB mode. Each plaintext is XORed with the previous ciphertext before being encrypted, where the first plaintext block is XORed with a random initialisation vector (IV). The repeated patterns in the ciphertext blocks produced by ECB mode encryption are removed by the randomness and error propagation supplied through the XOR operation and initial IV. CBC is most commonly used mode in practice.
密码块链接(CBC)模式。(加密)(解密)。CBC模式消除了ECB模式的局限性。每个明文在被加密之前与先前的密文进行异或,其中第一明文块与随机初始化向量(IV)进行异或。ECB模式加密产生的密文块中的重复模式通过XOR运算和初始IV提供的随机性和误差传播而被去除。CBC是实践中最常用的模式。
Counter (CTR) mode. (Encryption) (Decryption). Counter mode differs from ECB and CBC in that it in some sense it acts like a stream cipher. CTR mode generates a keystream by repeatedly encrypting a successive values of a "counter", which is initially set using an initialisation vector. Incrementing the counter for successive encryptions can be a simple as incrementing the initial counter by 1. Each encryption of the counter is, like a stream cipher, XORed with the next plaintext block to produce the next ciphertext block.
计数器(CTR)模式。(加密)(解密)。计数器模式与ECB和CBC的不同之处在于,在某种意义上,它的作用就像流密码。CTR模式通过重复加密“计数器”的连续值来生成密钥流,该计数器最初是使用初始化矢量设置的。为连续加密增加计数器可以简单地将初始计数器增加1。计数器的每次加密都像流密码一样,与下一个明文块进行异或,以产生下一个密文块。
Further reading: some modes of operation guarantee the authenticity of a plaintext in addition to its confidentiality. See AEAD modes for more.
进一步阅读:一些操作模式除了保证明文的机密性外,还保证明文的真实性。有关更多信息,请参阅AEAD模式。 标签:CBC,Draw,加密,ECB,CTR,模式,mode From: https://www.cnblogs.com/3cH0-Nu1L/p/18106094