assignment 7 computer science 349 spring 2004cs.wellesley.edu/~crypto/ps/ps7.pdf · assignment 7...

5
Assignment 7 Computer Science 349 Spring 2004 Due: Start of class on Thursday April 8 Reading: Stinson §1.1.7, 2.7, 3.1, 3.2 Exercise 7.1. This picture was made with a technique developed by scientists at Bell Telephone laboratories many years ago. It is a portrait of a very famous American. 1 Who is it? 2 Figure 7.1. A mysterious, but strangely familar stranger. Exercise 7.2. Refer to the slide in our notes that depicts key generation for S-DES. (a) How important is the initial P10 permutation function? (b) How important are the two LS-1 shift functions? Exercise 7.3. Using S-DES, decrypt the string (10100010) using the key (0111111101) by hand. Show intermediate results after each function (IP, F K , SW, F K , IP -1 ). then 1 No, it is not your instructor.

Upload: duongthu

Post on 30-Apr-2018

217 views

Category:

Documents


2 download

TRANSCRIPT

Assignment 7Computer Science 349

Spring 2004Due: Start of class on Thursday April 8

Reading: Stinson §1.1.7, 2.7, 3.1, 3.2

Exercise 7.1. This picture was made with a technique developed by scientists at BellTelephone laboratories many years ago. It is a portrait of a very famous American.1Who is it?2

Figure 7.1. A mysterious, but strangely familar stranger.

Exercise 7.2. Refer to the slide in our notes that depicts key generation for S-DES.(a) How important is the initial P10 permutation function?(b) How important are the two LS-1 shift functions?

Exercise 7.3. Using S-DES, decrypt the string (10100010) using the key (0111111101)by hand. Show intermediate results after each function (IP, FK, SW, FK, IP-1). then 1No, it is not your instructor.

Assignment 7 Page 2Cryptography

decode the first 4 bits of the plaintext string to a letter and the second 4 bits to anotherletter where we encode A through P in case 2 (i.e., A = 0000, B = 0001m ,,,m P = 1111).Hint: As a midway check, after the application of SW, the string should be (00010011).

Exercise 7.4. Show that S-DES decryption is, in fact, the inverse of S-DES encryption asillustrated in Figure 7.2.

Figure 7.2. Simplified DES scheme

Exercise 7.4. With the ECD mode of DES, if there is an error in a block of thetransmitted ciphertext, only the corresponding plaintext block is affected. However, inthe CBC mode, this error propagates. For example, an error in the transmitted C1 (Figure7.3) obvious corrupts P1 and P2.(a) Are any blocks beyond P2 affected?(b) Suppose that there is a bit error in the source version of P1. Through how manyciphertext blocks is this error propagated? What is the effect at the receiver?

Assignment 7 Page 3Cryptography

Figure 7.3. Cipher block chaining (CBC) mode

Exercise 7.5. The DES scheme is essentially a block cipher technique that uses 64-bitblocks. However, it is possible to convert DES into a stream cipher (introduced wayback in Section 1.1.7 of the Stinson text), using the either the cipher feedback (CFB) orthe output feedback (OFB) mode. A stream cipher eliminates the need to pad a messageto be an integer number of blocks. It also can operate in real time. Thus, if a characterstream is being transmitted, each character can be encrypted and transmitted immediatelyusing a character-oriented stream cipher.

One desirable property of a stream cipher is that the ciphertext be of the samelength as the plaintext. Thus, if 8-bit characters are being transmitted, each charactershould be encrypted using 8 bits. If more than 8 bits are used, transmission capacity iswasted.

Figure 7.4 depicts the CFB scheme. In this figure, it is assumed that the unit oftransmission is j bits; a common value is j = 8. As with CBC, the units of plaintext arechained together, so that the ciphertext of any plaintext unit is a function of all thepreceding plaintext.

Assignment 7 Page 4Cryptography

Figure 7.4 J-bit cipher feedback mode (CFB).

First, first consider encryption. The input to the encryption function is a 64-bit shiftregister that is initially set to some initialization vector (IV). The leftmost (mostsignificant) j bits of the output of the encryption function are XORed with the first unit ofplaintext P1 to produce the first unit of ciphertext C1, which is then transmitted. Inaddition, the contents of the shift register are shifted left by j bits and C1 is placed in therightmost (least significant) j bits of the shift register. This process continues until allplaintext units have been encrypted.

For decryption, the same scheme is used, except that the received ciphertext unitis XORed with the output of the encryption function to produce the plaintext unit. Notethat it is the encryption function that is used, not the decryption function. Explain whythis scheme correctly decrypts the ciphertext.

Exercise 7.6. The output feedback (OFB) mode illustrated in Figure 7.5 is similar instructure to that of the cipher feedback mode described in the previous exercise. As canbe seen, it is the output of the encryption function that is fed back to the shift register inOFB, whereas in CFB the ciphertext unit is fed back to the shift register.What advantages does OFB have over CFB? Does it suffer any additional disadvantages.

Assignment 7 Page 5Cryptography

Figure 7.5. J-bit output feedback (OFB) mode.