# Coursework 3

What is a meet-in-the-middle attack?

In 2DES (2 keys, running run encryption twice), a meet-in-the-middle attack is where an attacker can run the ciphertext through the encrypt function for all possible . They can store this in a table, sorted. The attacker can then run the cipher-text through the decrypt function for all possible

How many keys are used in triple-DES and why?

There are 2 keys used in 3DES. This is to maintain compatibility with standard DES.

Why is the middle portion of triple-DES a decryption rather than an encryption?

a

• Consider a block cipher that applies bit permutations (transpositions) to bit vectors length 4. i.e. the permutation cipher with alphabet and block length 4.
• Consider the key that transforms a bit vector of length 4 by shifiting it by one bit to the left i.e. permutes the bit order 1,2,3,4 to 2,3,4,1. The for example .
• Consider .

Use the ECB mode of operation to encrypt the plaintext .

1P = 101100010100101

Becomes:

1P = 1011 0001 0100 101
2P = 1011 0001 0100 1010
3
4E(K, 1011) = 0111
5E(K, 0001) = 0010
6E(K, 0100) = 1000
7E(K, 1010) = 0101
8
9C = 0111 0010 1000 0101


We pad the last block by appending a 0 (or 1 if we like).

Use the CBC mode of operation to encrypt the plaintext with , and then decrypt it.

1P = 101100010100101

Becomes:

1P = 1011 0001 0100 101
2P = 1011 0001 0100 1010

1C = 0010 0110 0100 1101

Decryption:

1C = 0010 0110 0100 1101
1P = 1011 0001 0100 1010
• Consider a block cipher that applies bit permutations (transpositions) to bit vectors of length 3, i.e., .
• Consider the key that transforms a bit vector of length 4 by shifting it one bit to the left, i.e. permutes the bit order 1,2,3,4 to 2,3,4,1.
• Consider .

Use CFB mode of operation to encrypt the plaintext .

1S = 3, therefore split plaintext into 3s.
2
3P = 101 100 010 100 101
4IV = 1010


Gives:

1C = 111 011 001 101 000

Use OFB mode of operation to encrypt the plaintext (with block length 4).

1P = 1011 0001 0100 101
2IV = 1010

1. .
2. .
3. .
4. .

Gives:

1C = 1110 1011 0001 000