CSCI 440 – Computer Security – DES Algorithm Encrypt a message of your choice up to 16 bits in length (2 characters as ASCII) using 2 rounds of a simplified DES. You will first create a 16 bit key (2 characters as ASCII) for the encryption/decryption process. Once encrypted trade your key and ciphertexts and decrypt the characters. πππ π πππ (π΄ππΆπΌπΌ) = πππ π πππ (π΅πππππ¦) = Step 1. Create subkeys from the 16 bit key, πΎ using the following tables for permutations and shift schedule. Eliminate the bits using the same method as DES. πΎ (π΄ππΆπΌπΌ) = πΎ (π΅πππππ¦) = ππΆ1 12 10 15 11 5 14 1 2 6 9 4 13 7 3 ππΆ1(πΎ) = Split ππΆ1(πΎ) into 2 halves and left rotation on schedule. πβπππ‘ ππβπππ’ππ Round 1 1 Round 2 3 π ππ’ππ 1 πΏπππ‘ = π ππ’ππ 1 π ππβπ‘ = π ππ’ππ 2 πΏπππ‘ = π ππ’ππ 2 π ππβπ‘ = Concatenate Round 1 Left and Right and permute using ππΆ2 to create ππ’ππππ¦1 . Do the same for ππ’ππππ¦2 using Round 2 Left and Right. ππΆ2 6 11 13 3 1 10 ππ’ππππ¦1 4 8 12 5 2 9 = ππ’ππππ¦2 = Step 2. Permute message using Initial Permutation, πΌπ. πΌπ 2 12 5 11 14 8 13 1 6 16 3 15 10 4 9 7 πΌπ π ππ π’ππ‘ = Split IP Result into left and right halves. πΏπππ‘ = π ππβπ‘ = Round 1 Step 3. Expansion and process ππ’ππππ¦1 Expansion: Expand π ππβπ‘ using Expansion table, πΈ below πΈ 8 1 2 3 4 5 4 5 6 7 8 1 πΈπ₯ππππ πππ π ππ π’ππ‘ = XOR with ππ’ππππ¦1 π 1 ⊕ ππ’ππππ¦1 = Substitution: Apply Substitution with S-boxes on each 6 bit Left and Right halves of 12-bit XORed result. π-π΅ππ₯1 (Left) 0π¦π¦π¦π¦0 0π¦π¦π¦π¦1 1π¦π¦π¦π¦0 1π¦π¦π¦π¦1 π₯0000π₯ 0100 1101 0001 0110 π₯0001π₯ 1011 0000 0100 1011 π₯0010π₯ π₯0011π₯ 0010 1110 1011 0111 1011 1101 1101 1000 π₯0100π₯ 1111 0100 1100 0001 π₯0101π₯ 0000 1001 0011 0100 π₯0110π₯ π₯0111π₯ 1000 1101 0001 1010 0111 1110 1010 0111 0π¦π¦π¦π¦0 0π¦π¦π¦π¦1 1π¦π¦π¦π¦0 1π¦π¦π¦π¦1 π₯1000π₯ 0011 1110 1010 1001 π₯1001π₯ 1100 0011 1111 0101 π₯1010π₯ 1001 0101 0110 0000 π₯1011π₯ 0111 1100 1000 1111 π₯1100π₯ 0101 0010 0000 1110 π₯1101π₯ 1010 1111 0101 0010 π₯1110π₯ 0110 1000 1001 0011 0π¦π¦π¦π¦0 0π¦π¦π¦π¦1 1π¦π¦π¦π¦0 1π¦π¦π¦π¦1 π₯0000π₯ 1101 0001 0111 0010 π₯0001π₯ 0010 1111 1011 0001 π₯0010π₯ π₯0011π₯ 1000 0100 1101 1000 0100 0001 1110 0111 π₯0100π₯ 0110 1010 1001 0100 π₯0101π₯ 1111 0011 1100 1010 π₯0110π₯ π₯0111π₯ 1011 0001 0111 0100 1110 0010 1000 1101 0π¦π¦π¦π¦0 0π¦π¦π¦π¦1 1π¦π¦π¦π¦0 1π¦π¦π¦π¦1 π₯1000π₯ 1010 1100 0000 1111 π₯1001π₯ 1001 0101 0110 1100 π₯1010π₯ 0011 0110 1010 1001 π₯1100π₯ 0101 0000 1111 0011 π₯1101π₯ 0000 1110 0011 0101 π₯1110π₯ 1100 1001 0101 0110 π₯1111π₯ 0001 0110 0010 1100 π-π΅ππ₯2 (Right) π₯1011π₯ 1110 1011 1101 0000 ππ’ππ π‘ππ‘π’π‘πππ π ππ π’ππ‘ (8-πππ‘π ) = Permutation: Permute of the ππ’ππ π‘ππ‘π’π‘πππ π ππ π’ππ‘ using π-πππ₯ π-π΅ππ₯ 6 4 7 3 5 1 8 2 π ππ π’ππ‘ = XOR π ππ π’ππ‘ with πΏπππ‘ πΆππβπππ‘ππ₯π‘ = π₯1111π₯ 0111 0010 1000 1011 Round 2 Swap πΆππβπππ‘ππ₯π‘ and π ππβπ‘. That is πΆππβπππ‘ππ₯π‘ becomes the new Right Side and π ππβπ‘ becomes the new πΏπππ‘ πΏπππ‘ = π ππβπ‘ = Repeat Expansion, Substitution and Permutation steps on π ππβπ‘ using ππ’ππππ¦2 . πΈπ₯ππππ πππ π ππ π’ππ‘ = π 1 ⊕ ππ’ππππ¦2 = ππ’ππ π‘ππ‘π’π‘πππ π ππ π’ππ‘ = πππππ’π‘ππ‘πππ π ππ π’ππ‘ = XOR πππππ’π‘ππ‘πππ π ππ π’ππ‘ and πΏπππ‘ πΆππβπππ‘ππ₯π‘ = Concatenate πΆππβπππ‘ππ₯π‘ and π ππβπ‘ π ππ π’ππ‘ = Step 4. Permute the ciphertext π ππ π’ππ‘ with πΌπ−1 πΌπ−1 14 9 12 10 1 3 4 2 11 16 13 15 8 6 5 7 π¬ππππππππ π΄ππππππ = Trade your encrypted message and your secret key with someone in class and decrypt their message using their key. What does their message say?