Cryptography: Theory and Practice:The Data Encryption Standard

cryptography: theory and practice Cryptography: Theory and Practice
by Douglas Stinson
CRC Press, CRC Press LLC
ISBN: 0849385210   Pub Date: 03/17/95
  

Previous Table of Contents Next


3.4.1 DES Modes of Operation

Four modes of operation have been developed for DES: electronic codebook mode (ECB), cipher feedback mode (CFB), cipher block chaining mode (CBC) and output feedback mode (OFB).

ECB mode corresponds to the usual use of a block cipher: given a sequence x1x2 . . . of 64-bit plaintext blocks, each xi is encrypted with the same key K, producing a string of ciphertext blocks, y1y2 . . ..

In CBC mode, each ciphertext block yi is x-ored with the next plaintext block xi+1 before being encrypted with the key K. More formally, we start with a 64-bit initialization vector IV, and define y0 = IV. Then we construct y1, y2, . . . from the rule yi = eK(yi-1xi), i ≥ 1. The use of CBC mode is depicted in Figure 3.4.


Figure 3.4  CBC mode


Figure 3.5  CFB mode

In OFB and CFB modes, a keystream is generated which is then x-ored with the plaintext (i.e., it operates as a stream cipher, cf. Section 1.1.7). OFB is actually a synchronous stream cipher: the keystream is produced by repeatedly encrypting a 64-bit initialization vector, IV. We define z0 = IV, and then compute the keystream z1z2 . . . from the rule zi = eK(zi-1), i ≥ 1. The plaintext sequence x1x2 . . . is then encrypted by computing yi = xizi, i ≥ 1.

In CFB mode, we start with y0 = IV (a 64-bit initialization vector) and we produce the keystream element zi by encrypting the previous ciphertext block. That is, zi = eK (yi-1), i≥ 1. As in OFB mode, yi = xizi, i ≥ 1. The use of CFB is depicted in Figure 3.5 (note that the DES encryption function eK is used for both encryption and decryption in CFB and OFB modes).

There are also variations of OFB and CFB mode called k-bit feedback modes (1 ≤ k ≤ 64). We have described the 64-bit feedback modes here. 1-bit and 8-bit feedback modes are often used in practice for encrypting data one bit (or byte) at a time.

The four modes of operation have different advantages and disadvantages. In ECB and OFB modes, changing one 64-bit plaintext block, xi, causes the corresponding ciphertext block, yi, to be altered, but other ciphertext blocks are not affected. In some situations this might be a desirable property. For example, OFB mode is often used to encrypt satellite transmissions.

On the other hand, if a plaintext block xi is changed in CBC and CFB modes, then yi and all subsequent ciphertext blocks will be affected. This property means that CBC and CFB modes are useful for purposes of authentication. More specifically, these modes can be used to produce a message authentication code, or MAC. The MAC is appended to a sequence of plaintext blocks, and is used to convince Bob that the given sequence of plaintext originated with Alice and was not tampered with by Oscar. Thus the MAC guarantees the integrity (or authenticity) of a message (but it does not provide secrecy, of course).

We will describe how CBC mode is used to produce a MAC. We begin with the initialization vector IV consisting of all zeroes. Then construct the ciphertext blocks y1, . . . , yn with key K, using CBC mode. Finally, define the MAC to be yn. Then Alice transmits the sequence of plaintext blocks, x1 . . . xn, along with the MAC. When Bob receives x1, . . . xn, he can reconstruct y1, . . . , yn using the (secret) key K, and verify that yn is the same as the MAC that he received.

Note that Oscar cannot produce a valid MAC since he does not know the key K being used by Alice and Bob. Further, if Oscar intercepts a sequence of plaintext blocks x1 . . . xn, and changes one or more of them, then it is highly unlikely that Oscar can change the MAC so that it will be accepted by Bob.

It is often desirable to combine authenticity and secrecy. This could be done as follows: Alice first uses key K1 to produce a MAC for x1 . . . xn. Then she defines xn+1 to be the MAC, and she encrypts the sequence x1 . . . xn+1 using a second key, K2, yielding y1 . . . yn+1. When Bob receives y1 . . . yn+1, he first decrypts (using K2) and then checks that xn+1 is the MAC for x1 . . . xn using K1.

Alternatively, Alice could use K1 to encrypt x1 . . . xn, obtaining y1 . . . yn, and then use K2 to produce a MAC yn+1 for y1 . . . yn. Bob would use K2 to verify the MAC, and then use K1 to decrypt y1 . . . yn.


Previous Table of Contents Next

Copyright © CRC Press LLC



Cryptography. Theory and Practice
Modern Cryptography: Theory and Practice
ISBN: 0130669431
EAN: 2147483647
Year: 1995
Pages: 133
Authors: Wenbo Mao

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net