Exploring DES (Data Encryption Standard)
Cryptography ~ Symmetric Cipher
Abstract:
DES (DES Encryption Standard) is a symmetric-key cryptographic algorithm used for many years and will eventually be fully replaced by AES (Advanced Encryption Standard). This article aims to break down the tutorial, provide in-depth understanding, and teach step-by-step instructions using Neso Academy’s YouTube video on DES. It includes a step-by-step guide based on the YouTube video by Neso Academy, making the learning experience comprehensive and accessible. This study will serve as a transcript, breakdown, and in-depth exploration of DES and foundational knowledge.
1. Introduction:
DES uses a symmetric key and has a short Key Length of 56-bit (Actual 64-bit but 8-bit are for redundant code), operates on a 64-bit block cipher and uses 16-round Operations. DES uses a series of 16 rounds of permutations and substitutions to encrypt data, involving complex operations like XOR, substitution boxes (S-boxes), and permutations.
2. DES Encryption Algorithm Explanation
- It takes input 64-bit plain-text and outputs 64-bit cipher-text
- 64-bit plain-text is given to the initial permutation function and the function outputs the 64-bit and there are 16 total rounds. The input of Round N is the output of the previous round (Round N-1) like Round 1 input is the initial permutation output and Round 3 input is the output of Round 2 Operation and all the output and input is 64-bit.
- After we reach round 16 we get the pre-output (similar to the Fiestel structure) and give the 64-bit output of Round 16 to the 32-bit Swap function. Now after swapping, we get again 64 bit because the right-hand side 32-bit is swapped to the left-hand side and the left-hand side 32-bit is swapped to the right-hand side. And till now the output we get is not a Cipher text but pre-output.
- Now the swapped 64-bit output is given to the inverse initial permutation which inverses and gives 64-bit that gives ciphertext.
3. Key in DES
Initially, we take a 64-bit Key which is reduced into 56-bit (8-bit as redundant code) and each 56-bit key is used as K1 up to Kn. For each round we need round key 48-bit so for round1 we have K1 up to round 16 with K16 (48-bit).
So now finally our full basic encryption algorithm figure is
4. Single Round of DES Algorithm Explanation
We’ll focus and learn on the following highlighted parts
5. Initial Permutation
Initially, it takes 64-bit plaintext as shown in the figure and the initial permutation permutates(changes) the plain–text bit position and output 64-bit.
Here 64 numbers are the 64-bit binary numbers placed in a sorted order.
If we watch the permutated part carefully the last column 2, 4, 6, 8, 1, 3 5, and 7 are placed in a way that 1 is in the middle of the 2 4 6 upper part and the lower part 3 5 7 that means
- First place 1 at the 5th cell of the last column
- And Then upper part at the uppermost part place 2
- Then the lower part placed just below the 1 place 3
- Then again place 4 just below the previously placed number 2
- Then again place 5 at the lower part just below the 3
- Repeat until all the last column 8 cells are filled
- Similarly, the bit position is changed for 2nd Row numbers 9, 10, 11, 12, 13, 14, 15, 16
6. Initial Permutated 64-bit Table
Now we obtained the permutated table. And the initial permutation for the 64-bit plain text is completed.
7. Inverse Initial Permutation
8. Swapping Function
- Divide the total 64-bit into two half 32–32-bit
- The first half will be swapped into the second half and vice versa
9. What Happens in Every Single Round?
In a single round, the total input size is 64-bit into two halves 32–32-bit. The figure is
9.1 Steps of Single Round Operation:
- In the above figure, Left Hand i -1 takes 32-bit Right Hand Side takes Half i — 1 32-bit, and the Right Hand Half Side 32-bit is given to the expansion permutation function.
- The expansion Permutation Function expands the 32-bit into 48-bits because we are getting the 48-bit key and our original input size was 64-bit.
- The Right Side 32-bit has to be converted into 48-bit so that it can be XORED with the key 48-bit
- Now if we look at the diagram the 64-bit key is also halved into the left and right 32-bit key.
5. Now the key we again received at the XORED operation is 48-bit by some operation in the key side as circled red in the step 4 figure. Now step 5 figure is
6. Again 8 S-Box reduces the input size of 48-bit to 32-bit and the output of the S-Box is given to the P-Box(Transposition). Step 6 figure is
7. P-Box changes the position of the bit and again gives to the right half i — 1 which performs the XORed Operation. Step 7 figure is
8. Now the right half i-1 32-bit is XORed with the left-hand i — 1 and the output is the 32-bit Whole Right Hand Half part. That means the figure shows the whole red bordered part output XORed with the left hand i -1 32-bit input gives the Right Half Output i. Step 8 figure is
Note: Now we get the Right Half i and the Left Hand i, these two 32-bit will be the input for another second-round operation up to 16-round operations. That means if we observe in the above figure before the expansion permutation, S-box substitution, transposition, and right half i -1 right half i — 1 is the output for left half i which will be the input for the another round operation.
Get dilli_hangrae’s stories in your inbox
Join Medium for free to get updates from this writer.
The Whole Steps of a Single Round Operation will be performed 16 times because DES uses 16 Round Operations.
Similarly for the Key also 16 Round Key operations will take place because we need 16 times Key to complete the round operations.
If we try to outline the equation of the left and right-hand sides. See the green bordered part in the figure.
L_i = R_i-1
Then if we again look at the red bordered part as Mangler Function denoted by F we get the equation as R_i = L_i-1 ⊕ F(R_i-1, K_i)
10. Mangler Function
The Mangler Function F is the F(R_i-1, K_i).
10. 1 How Does Mangler Function Work?
In the above figure 10. green colored is step 1 is 32 Bits we need to Convert it into again 48 Bits.
Now the R(32 Bit) operation is completed and we have the output of 48 bits from the R(32 Bits).
We have to perform the output of R(32 Bits) XOR with the K (48 bits) the 48 Bits come from the green part.
After the XOR again we have to send them to the S-Box a purple-colored border part box. S-box takes 8 blocks of input 6 bits and output 8 blocks of 4 bits which makes it 32 bits.
10.2 How 6-bit Input in the S-Box Block is converted into 4-Bit Block?
The figure shows all the 6-bit of 8 blocks. and this is for only S1. S1 is taking 101010 input and giving output as 0110.
The figure shows all the 6-bit of 8 blocks. and this is for only S1. S1 is taking 101010 input and giving output as 0110.
The first and last bit from the S1 = 101010 is 1 and 0 that is (10 which is a row in the table and the remaining 0101 is a column in the table).
The value corresponding to row 10 and column 0101 is 6 (0101).
In this way, we perform S-Box for all 6 S-blocks. The output 32-bit we will obtain from the S-box is again permutated.
10.3 Permutation Function Applied to the 32-bit Output from S-box
The 32-bit output positions are only changed again and shuffled.
11. Conclusion:
Hence, the Confusing DES technique is studied, understood, learned, and broken the steps. DES is now vulnerable due to its short key length and known vulnerabilities, making it susceptible to brute-force attacks. It has largely been replaced by more secure algorithms like AES (Advanced Encryption Standard). The article is like the review, transcript, summary, and self-study from the YouTube Video turning into a simplified article version.
12. Sources:
- W. Stallings, Cryptography and Network Security: Principles and Practice
- Introduction to Data Encryption Standard (DES) (youtube.com)
- Single Round of DES Algorithm (youtube.com)
- The F Function of DES (Mangler Function) (youtube.com)
Read More Articles on Dilli Hang Rai | LinkedIn
More About me: dilli822.github.io
Feedback & Review: dillihagrai.078@godawari.edu.np, dillihangrae@gmail.com









