Network Security: CS432 - Dr. Naif Almuslem
Network Security: CS432 - Dr. Naif Almuslem
Network Security: CS432 - Dr. Naif Almuslem
• Breakable by exhaustive search on 56-bit key size for known plaintext, chosen plaintext and chosen
ciphertext attacks
• Security: computational complexity of computing the key under the above scenarios (22 hours)
• DES no longer considered secured. The National Institute of Standards and Technology (NIST) initiated in
1997 an initiative for a new encryption standard to replace DES. But in these efforts take a lot of time.
What should we do in the mean time? Response: 3DES!
• Problem of DES: Key too short
• Triple/3 DES uses 3 successive iteration of DES with 3 keys (K1, K2, K3) making an effective key length of
168-bits
Simplified-DES
•
Encryption Decryption
Encryption-S-DES
Key
generation:
k1,k2
Key Generation-S-
DES
S-DES Example (Step by Step)
The required permutations, substitutions and shifts for S-DES encryption algorithm are given below:
⮚ P10 (permutation)
• 3 5 2 7 4 10 1 9 8 6
⮚ P8 (permutation)
• 6 3 7 4 8 5 10 9
⮚ P4 (permutation)
• 2431
⮚ E/P (expand and permutate)
• 41232341
⮚ IP (Initial permutation)
• 26314857
⮚ LS-1 (left shift on position)
⮚ LS-2 (left shift two positions)
S-box
S-DES: Steps of Generating Keys
• Assume input 10-bit key, K, is: 1010000010
• A. Generating keys: the two 8-bit round keys, K1 and K2
1. Rearrange K using P10: 1000001100
2. Left shift by 1 position both the left and right halves: 00001 11000
3. Rearrange the halves with P8 to produce K1: 10100100
4. Left shift by 2 positions the left and right halves: 00100 00011
5. Rearrange the halves with P8 to produce K2: 01000011
• K1 and K2 are used as inputs in the encryption and decryption stages
S-DES: Steps of Encryption
• Assume a 8-bit plaintext P: 01110010, then the steps for encryption are:
1. Apply the initial permutation, IP, on P: 10101001
2. Assume the input from step 1 is in two halves, L and R: L0=1010, R0=1001
L1= R-1=R0
R1=F(L0,R0)=(L0 XOR F(R0 XOR K1), R0)
Computing Round Function (step 3 - 7)
3. Expand and permutate R using E/P: 11000011
4. XOR input from step 3 with K1: 10100100 XOR 11000011 = 01100111
5. Input left halve of step 4 into S-Box S0 and right halve into S-Box S1:
a. For S0: 0110 as input: b1,b4 for row, b2,b3 for column
b. Row 00, column 11 -> output is 10
c. For S1: 0111 as input:
d. Row 01, column 11 -> output is 11
S-DES: Steps of Encryption(Cont.)
6. Rearrange outputs from step 5 (1011) using P4: 0111
7. XOR output from step 6 with L0 from step 2: 0111 XOR 1010 = 1101
8. Now we have the output of step 7 as the left half and R0 as the right half. Switch the halves and
move to round 2: 1001 1101
9. E/P with right half: E/P(1101) = 11101011
10. XOR output of step 9 with K2: 11101011 XOR 01000011 = 10101000
11. Input to s-boxes:
a. For S0, 1010
b. Row 10, column 01 -> output is 10
c. For S1, 1000
d. Row 10, column 00 -> output is 11
S-DES: Steps of Encryption(Cont.)
12. Rearrange output from step 11 (1011) using P4: 0111
13. XOR output of step 12 with left halve from step 8: 0111 XOR 1001 = 1110
14. Input output from step 13 and right halve from step 8 into inverse IP
So our encrypted result (ciphertext) of plaintext 01110010 with key 1010000010 is:
01110111
Homework
• Given that plaintext: 11010101; key: 0111010001, find the following for S-DES
encryption algorithm:
2. Ciphertext.
Questions?