IMT4531 Introduction to Cryptology Exercise 3 – Block ciphers 1. Suppose that we have a 3-bit block cipher with 2 bits of key and that, given a fixed key, the permutation is (5,2,7,1,8,6,4,3). Determine the vectorial Boolean functions for encipherment and decipherment. Check encipherment of the plaintext 001 and decipherment of the ciphertext originating from this plaintext. 1 đ=( 5 2 3 4 5 2 7 1 8 6 7 8 ) 6 4 3 This means that the binary value of 1-1 (upper row) goes to the address 5-1, binary value of 2-1 goes to the address 2-1, binary value of 3-1 goes to the address 7-1, etc. Vectorial Boolean function for encipherment: Address (decimal) Address (binary) Value 0 000 011 1 001 001 2 010 111 3 011 110 4 100 000 5 101 101 6 110 010 7 111 100 For decipherment, we need the inverse permutation P-1. 1 2 3 4 5 6 7 8 đ−1 = ( ) 4 2 8 7 1 6 3 5 This means that the binary value of 1-1 (upper row) goes to the address 4-1, binary value of 2-1 goes to the address 2-1, binary value of 3-1 goes to the address 8-1, etc. Vectorial Boolean function for decipherment: Address (decimal) Address (binary) Value 0 000 100 1 001 001 2 010 110 3 011 000 4 100 111 5 101 101 6 110 011 7 111 010 Encipherment of the plaintext 001: E(001)=001 Decipherment of the ciphertext that corresponds to enciphering of the plaintext 001 E-1(001)=001 Enciphering and deciphering of some other inputs: E(110)=010, E-1(010)=110 E(000)=011, E-1(011)=000 2. We are given a 4-bit block cipher with 5 bits of key. Suppose that the permutation that corresponds to a fixed key is (16,12,8,11,1,9,15,6,5,2,13,4,3,7,10,14). Construct the vectorial Boolean functions for encipherment and decipherment. 1 đ=( 16 2 3 4 5 12 8 11 1 6 7 8 9 10 11 12 13 14 15 16 ) 3 7 10 14 9 15 6 5 2 13 4 This means that the binary value of 1-1 (upper row) goes to the address 16-1, binary value of 2-1 goes to the address 12-1, binary value of 3-1 goes to the address 8-1, etc. Vectorial Boolean function for encipherment: Address (decimal) Address (binary) Value 0 0000 0100 1 0001 1001 2 0010 1100 3 0011 1011 4 0100 1000 5 0101 0111 6 0110 1101 7 0111 0010 8 1000 0101 9 1001 1110 10 1010 0011 11 1011 0001 12 1100 1010 13 1101 1111 14 1110 0110 15 1111 0000 For decipherment, we need the inverse permutation P-1. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 đ−1 = ( ) 5 10 13 12 9 8 14 3 6 15 4 2 11 16 7 1 This means that the binary value of 1-1 (upper row) goes to the address 5-1, binary value of 2-1 goes to the address 10-1, binary value of 3-1 goes to the address 13-1, etc. Vectorial Boolean function for decipherment: Address (decimal) Address (binary) Value 0 0000 1111 1 0001 1011 2 0010 0111 3 0011 1010 4 0100 0000 5 0101 1000 6 0110 1110 7 0111 0101 8 1000 0100 9 1001 0001 10 1010 1100 11 1011 0011 12 1100 0010 13 1101 0110 14 1110 1001 15 1111 1101 3. A Feistel 8-bit block cipher has the 1st round function (for a fixed round key K1) f1(x) given by the following table: x f1(x) 0000 0001 0001 0010 0010 0011 0011 0100 0100 0101 0101 0110 0110 0111 0111 1000 1000 1001 1001 1010 1010 1011 1011 1100 1100 1101 1101 1110 1110 1111 1111 0000 Given the 8-bit input to the first round 11010001, determine the output of the first round. The Feistel structure of a round (example with 64-bit input from the lecture): Since the 8-bit input in our case is 11010001=(L,R), we have L=1101 and R=0001. Then L’=R=0001 and R’=Lī f1(R)=1101ī f1(0001)=1101ī 0010=1111. So the 8-bit output of the first round is (L’,R’)=00011111.