Lab Practices-III Fourth Year Computer Engineering
Information and Cyber Security
Assignment No.5
W C D V T Total
Sign/Remark
(4) (4) (4) (4) (4) (20)
5.1 Title:
Implementation of S-DES (Data Encryption Standard)
5.2 Problem Definition:
Implementation of S-DES
5.3 Prerequisite:
Basics of Computer networking and Python
5.4 Software Requirements:
Python 3
5.5 Hardware Requirements:
PIV, 2GB RAM, 500 GB HDD
5.6 Learning Objectives:
Learn Data Encryption Standard Algorithm (DES)
5.7 Outcomes:
After completion of this assignment students are able to understand the Data Encryption Standard.
5.8 Theory Concepts:
Data Encryption Standard (DES)
The Data Encryption Standard (DES) is a Symmetric-key block cipher issued by the national
Institute of Standards & Technology (NIST).
DES is an implementation of a Feistel Cipher. It uses 16 round Feistel structure. The block size is
64-bit. Though, key length is 64-bit, DES has an effective key length of 56 bits, since 8 of the 64
bits of the key are not used by the encryption algorithm (function as check bits only). General
Structure of DES is depicted in the following illustration −
Lab Practices-III Fourth Year Computer Engineering
Figure 5.1: General Structure of DES
Since DES is based on the Feistel Cipher, all that is required to specify DES is −
• Round function
• Key schedule
• Any additional processing − Initial and final permutation
5.8.1 Initial and Final Permutation
Lab Practices-III Fourth Year Computer Engineering
The initial and final permutations are straight Permutation boxes (P-boxes) that are inverses of each
other. They have no cryptography significance in DES. The initial and final permutations are shown
as follows
Figure 5.2 initial and final permutations
5.8.2 Round Function
The heart of this cipher is the DES function, f. The DES function applies a 48-bit key to the
rightmost 32 bits to produce a 32-bit output.
Figure 5.3 Round Functions
Lab Practices-III Fourth Year Computer Engineering
5.8.3 Expansion Permutation Box
Since right input is 32-bit and round key is a 48-bit, we first need to expand right input to 48 bits.
Permutation logic is graphically depicted in the following illustration:
Figure 5.4 Permutation logic
The graphically depicted Permutation logic is generally described as table in DES specification
illustrated as shown:
Table 5.1 Permutation logic
5.8.4 XOR(Whitener)
After the expansion permutation, DES does XOR operation on the expanded right section and the
round key. The round key is used only in this operation.
5.8.5 Substitution Boxes
Lab Practices-III Fourth Year Computer Engineering
The S-boxes carry out the real mixing (confusion). DES uses 8 S-boxes, each with a 6-bit input and
a 4-bit output. Refer the following illustration –
Figure 5.5 S-Boxes
The S-box rule is illustrated below –
Figure 5.6 S-Box Rules
There are a total of eight S-box tables. The output of all eight s-boxes is then combined in to 32
bit section.
5.8.6 Straight Permutation − The 32 bit output of S-boxes is then subjected to the
straight permutation with rule shown in the following illustration:
Table 5.2 Straight Permutation
Lab Practices-III Fourth Year Computer Engineering
5.8.7 Key Generation
The round-key generator creates sixteen 48-bit keys out of a 56-bit cipher key. The process of key
generation is depicted in the following illustration −
Figure 5.7 the process of key generation
The logic for Parity drops, shifting, and Compression P-box is given in the DES description.
5.8.8 DES Analysis
The DES satisfies both the desired properties of block cipher. These two properties make cipher
very strong.
• Avalanche effect − A small change in plaintext results in the very great change in the
cipher text.
• Completeness − Each bit of cipher text depends on many bits of plaintext.
During the last few years, cryptanalysis has found some weaknesses in DES when key selected are
weak keys. These keys shall be avoided.
Lab Practices-III Fourth Year Computer Engineering
DES has proved to be a very well designed block cipher. There have been no significant
cryptanalytic attacks on DES other than exhaustive key search.
Oral Questions
1. Explain structure of DES
2. Explain Initial permutation steps in DES
3. Draw and explain the internal structure of single round of DES
4. Explain Double DES
5. Explain Triple DES