Standard Block Cipher Modes of Operations - Data Encryption Algorithms - Introduction To Network Security: Theory And Practice (2015)

Introduction To Network Security: Theory And Practice (2015)

Chapter 2. Data Encryption Algorithms

2.5 Standard Block Cipher Modes of Operations

Let image be the block size of a given block cipher (e.g., image for DES and image for AES). Let image be a plaintext string. Divide image into a sequence of blocks:

equation

such that the size of each block image is image (using padding for the last block if necessary). There are several methods to encrypt image. Such methods are referred to as block cipher modes of operations. The following are the standard block cipher modes of operations:

1. electronic-codebook mode (ECB),

2. cipher-block-chaining mode (CBC),

3. cipher-feedback mode (CFB),

4. output-feedback mode (OFB), and

5. counter mode (CTR).

2.5.1 Electronic-Codebook Mode

The ECB mode encrypts each plaintext block independently. Let image be the imageth ciphertext block. Table 2.5 lists the encryption and decryption steps under the ECB mode.

Table 2.5 ECB mode

ECB encryption steps

ECB decryption steps

image,

image,

image.

image.

ECB is often used to encrypt short plaintext messages image.

2.5.2 Cipher-Block-Chaining Mode

When the plaintext message image is long, the possibility that image for some image will increase. When this happens, their corresponding cipher blocks image and image are identical under the ECB mode, which will be disclosed to the eavesdropper. The use of the cipher-block-chaining mode can overcome this weakness. Under the CBC mode, the previous ciphertext block is used to encrypt the current plaintext block. At the beginning, CBC uses an initial image-bit block image, referred to as an initial vector. Table 2.6 lists the encryption and decryption steps under the CBC mode.

Table 2.6 CBC mode

CBC encryption steps

CBC decryption steps

image,

image,

image.

image.

CBC is commonly used in practice.

2.5.3 Cipher-Feedback Mode

Under the ECB and CBC modes, the receiver must wait for the entire ciphertext block to arrive before decryption can be started. There are several drawbacks in these schemes:

1. If the ciphertext block is too long, it would hinder the receiver from reading the entire plaintext message image continuously.

2. If padding is used when dividing image into blocks, the actual number of transmitted bits in ciphertext blocks will be larger than the number of bits in image.

3. If a bit error occurs in a ciphertext block during transmission (i.e., a bit is flipped during transmission), it would affect the readability of the plaintext block after decryption because of the effect of diffusion.

The use of CFB mode can overcome these drawbacks. CFB does not divide image into blocks. Instead, it encrypts each basic code one at a time. Let image be the length of the basic code in a given code set. For example, image for ASCII code and image for Unicode. Note that image can also be set to other values, as long as the length of the block is divisible by image. Let

equation

where each image is an image-bit binary string, and image is divisible by image.

Under CFB mode, the sender and the receiver share the same image-bit initial vector image. Encryption begins by encrypting image to produce a ciphertext block image. Let image represent the image-bit prefix of image, and image the image-bit suffix of image. The encryption procedure calculates image. It then shifts image image bits to the left and fills in the image bits on the right with image. Repeat this until image is obtained. Table 2.7 lists the encryption and decryption steps under the CFB mode.

Table 2.7 CFB mode

CFB encryption steps

CFB decryption steps

image

image

image

image

image

image

image

image

image

image

image

image

CFB is a common method to turn a block cipher algorithm into a stream cipher algorithm.

2.5.4 Output-Feedback Mode

If during the transmission of a CFB cipher string image a bit error occurs, then this error not only will affect the correctness of image, but also will affect the correctness of image. This is because image will be removed from image only after image iterations. Output feedback mode can overcome this drawback. OFB is similar to CFB. The only difference is that OFB does not place image in image. Table 2.8 lists the encryption and decryption steps under the OFB mode.

Table 2.8 OFB mode

OFB encryption steps

OFB decryption steps

image

image

image

image

image

image

image

image

image

image

image

image

OFB is also a common method to turn a block cipher algorithm to a stream cipher algorithm. It is commonly used in error-prone environments.

2.5.5 Counter Mode

CTR produces block ciphers. It uses an image-bit counter Ctr, which starts from an initial value and increases by 1 each time. Adding 1 to image resets Ctr to image. In other words, image. We use image to denote the initial value of Ctr and image to denote image.