0% found this document useful (0 votes)
265 views12 pages

Simplified Data Encryption Standard (S-DES)

The document describes the Simplified Data Encryption Standard (S-DES) algorithm. S-DES is a smaller version of the DES algorithm with an 8-bit block size and 10-bit key. It uses two rounds of encryption/decryption and two subkeys generated from the main key. The encryption process involves initial and final permutations along with two rounds of substitution and permutation functions.

Uploaded by

karmaelgendy04
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
265 views12 pages

Simplified Data Encryption Standard (S-DES)

The document describes the Simplified Data Encryption Standard (S-DES) algorithm. S-DES is a smaller version of the DES algorithm with an 8-bit block size and 10-bit key. It uses two rounds of encryption/decryption and two subkeys generated from the main key. The encryption process involves initial and final permutations along with two rounds of substitution and permutation functions.

Uploaded by

karmaelgendy04
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 12

THE SIMPLIFIED DATA ENCRYPTION

STANDARD (S-DES) ALGORITHM


The Simplified Data Encryption Standard (S-DES) algorithm is a smaller
version of the DES Algorithm. The S-DES algorithm has fewer parameters
than DES. It was made for educational testing purposes so that examining
the understanding and knowledge of DES would become simpler.

The S-DES is a block cipher that converts a plaintext block into ciphertext.
The block size of the S-DES algorithm is 8 bits. Like DES, it is a symmetric
key cipher. It uses the same key for both encryption and decryption
operations. The key size of the S-DES algorithm is 10 bits. The S-DES
algorithm’s encryption and decryption consists of 2 rounds; thus, it uses
two different subkeys. Fig. 1 depicts the structure of the S-DES algorithm’s
encryption, decryption, and key expansion processes.

Points that should be remembered about the S-DES algorithm are as


follows:

• It is a block cipher.
• It has an 8-bit block size of plaintext or ciphertext.
• It uses a 10-bit key size for encryption and decryption.
• It is a symmetric cipher.
• It has Two Rounds.

According to Fig. 1, the encryption process involves the following five


steps:

1- Initial permutation (IP).


2- A function labeled fK involves permutation and substitution
operations and depends on a subkey input.
3- A swap function (SW) that swaps the two halves of the data.
4- The function fK again.
5- Inverse of the initial permutation (IP-1).

Page 1 of 12
Figure 1: The S-DES Algorithm Structure.

THE S-DES ALGORITHM ENCRYPTION:

1- THE INITIAL PERMUTATION (IP):

The output of the Initial Permutation (IP) of the input 8-bit plaintext
is obtained according to Table 1. The numbers in Table 1 represent
the placement indexes of the input plaintext bits (the first bit’s index
is 1). This permutation retains all the 8 bits of the plaintext but mixes
them up.

Page 2 of 12
Table 1: The Initial Permutation (IP).

IP
Input 1 2 3 4 5 6 7 8
Output 2 6 3 1 4 8 5 7

2- THE f K FUNCTION:
Before applying the output of the IP to the fK function, the 8 bits are
split into two halves (L and R), each of which is a 4-bit block. Fig. 2
depicts the steps involved in the fK function.

The fK function is considered the most complex component of the


S-DES algorithm, which consists of a combination of permutation and
substitution functions. The fK function can be expressed
mathematically as follows:

• Let L and R be the leftmost 4 bits and the rightmost 4 bits of


the 8-bit input to fK, respectively. Let another function F be a
mapping from 4-bit strings to 4-bit strings, which takes the
right half (R) and the round’s subkey as its input. Then the
output of the fK function is:

𝒇𝒇𝑲𝑲 (𝑳𝑳, 𝑹𝑹) = (𝑳𝑳 ⊕ 𝑭𝑭(𝑹𝑹, 𝑺𝑺𝑺𝑺) , 𝑹𝑹)

SK is the subkey of the corresponding round and ⊕ is a bit-by-


bit XOR operation.

Now, let’s explore the involved steps in the F mapping. The F


mapping consists of the following steps:

a. Expanded Permutation (EP).


b. S-Boxes. The S-DES algorithm has only 2 S-Boxes (S0 and S1).
c. Permutation P4.

Page 3 of 12
L R

Figure 2: The fK function structure.

Page 4 of 12
A. EXPANDED PERMUTATION (EP):

It takes a 4-bit input and converts it into an 8-bit output using the
bits’ placement indexes, as depicted in Table 2.
Table 2: The Expanded Permutation (EP).

EP
Input 1 2 3 4 - - - -
Output 4 1 2 3 2 3 4 1

The output of the EP is XORed with the first subkey K1 and the
output of the XOR operation will be split into two halves each of
which consists of 4 bits. The two 4-bit halves are input to the S-
Boxes, S0 and S1, respectively.

B. S-BOXES (S 0 AND S 1 ):

It is a basic component of a symmetric key algorithm that


performs substitution. As in the DES algorithm, the value of the
outer 2 bits of the input to any of the S-Boxes selects the row,
while the value of the inner 2 bits selects the column. The
intersection of the row and column selected refers to the decimal
value of the output of each S-Box. The output of S0 and S1 is 2 bits
each according to the values in Table 3 (for S0) and Table 4 (for
S1).

Table 3: The S-Box S0

Row Column 0 1 2 3
0 1 0 3 2
1 3 2 1 0
2 0 2 1 3
3 3 1 3 2

Page 5 of 12
Table 4: The S-Box S1

Row Column 0 1 2 3
0 0 1 2 3
1 2 0 1 3
2 3 0 1 0
3 2 1 0 3

The two 2-bit outputs of the S-Boxes are then combined to form a
4-bit block, as shown in Fig. 2. This 4-bit block forms the input to
the permutation P4.

C. THE PERMUTATION P4:

The permutation P4 takes the 4-bit block generated by the


S-Boxes S0 and S1 to perform a further permutation based on
Table 5. The output of P4 is the output of the F mapping, as
shown in Fig. 2.
Table 5: The Permutation P4

P4
Input 1 2 3 4
Output 2 4 3 1

The output of the F mapping is then XORed with the left half input to
the fK function L. The 4-bit output of this XOR operation is then
combined with the right half input to the fK function R to form the 8-
bit output of the fK function, as shown in Fig. 2.

3. THE SWAP FUNCTION (SW):


The output of the function fK is fed into the swap function (SW) that
interchanges the left and right 4-bit halves, as shown in Fig. 2.

Page 6 of 12
The two halves output of the SW function is fed once again to another
instance of the fK function, as depicted in Fig. 1. However, this second fK
function uses the subkey K2. The 8-bit input to the second fK function
undergoes the same steps described above.

The output of the second fK function is then fed into the Inverse Initial
Permutation (IP-1) function.

4. THE INVERSE INITIAL PERMUTATION (IP -1 ):


The Inverse Initial Permutation (IP-1) function takes the output of the
second fK function and performs a final permutation step, as shown in
Table 6. Under the hood, the IP-1 function reverses the effect of the
first IP function discussed before.
Table 6: The Inverse Initial Permutation (IP-1)

IP-1
Input 1 2 3 4 5 6 7 8
Output 4 1 3 5 7 2 8 6
Finally, the 8-bit output block of the IP-1 function is the ciphertext
obtained for the corresponding 8-bit input plaintext block.

THE S-DES ALGORITHM KEY EXPANSION:

The S-DES algorithm is a symmetric key cryptosystem that uses a 10-bit


key shared between sender and receiver. From this key, two 8-bit subkeys
(K1 and K2) are produced for use in the two rounds of the algorithm during
the encryption and decryption operations.

This section demonstrates the steps involved in the S-DES algorithm’s key
expansion (generation) process, as depicted in Fig. 3. According to Fig. 3,
three functions are used to achieve the key expansion of the S-DES
algorithm as follows:

1. The permutation P10.


2. Left shift operation (applied two times).
3. The permutation P8.

Page 7 of 12
Figure 3: The key expansion (generation) process of the S-DES algorithm

1. THE PERMUTATION P10:

The role of the P10 function is to permute the 10-bit input


symmetric key to a different order. The permutation is performed
based on the bit indexes listed in Table 7. The output of P10 is split

Page 8 of 12
into two halves (5 bits each), as shown in Fig. 3, and sent to the left
shift (LS) operations.
Table 7: The Permutation P10

P10
Input 1 2 3 4 5 6 7 8 9 10
Output 3 5 2 7 4 10 1 9 8 6

2. THE LEFT SHIFT (LS1 AND LS2) OPERATION:

Each half of the two 5-bit halves output of the P10 operation
undergoes a one-bit left circular shift that is achieved by the LS1
function, as shown in Fig. 3. The output of LS1 is again two 5-bit
blocks.

To generate the 8-bit subkey K1, the two 5-bit output blocks of LS1
are combined before going directly to the permutation P8 function,
as shown in Fig. 3.

However, to generate the 8-bit subkey K2, each block of the two 5-bit
output blocks of LS1 undergoes another two-bit left circular shift
that is done by the LS2 function, as shown in Fig. 3. Next, the two 5-
bit output blocks of LS2 are combined before going to the
permutation P8 function, as shown in Fig. 3.

3. THE PERMUTATION P8:

The permutation P8 function takes a 10-bit input block and


generates an 8-bit output block. The output 8-bit block is generated
by removing bits at the indexes 1 and 2, then permuting the
remaining 8 bits according to Table 8.
Table 8: The Permutation P8

P8
Input 1 2 3 4 5 6 7 8 9 10
Output 6 3 7 4 8 5 10 9 - -

Page 9 of 12
THE S-DES ALGORITHM DECRYPTION:

The steps of the S-DES algorithm decryption are the same as the steps
involved in the encryption and are performed in the same order.

The only difference between the S-DES algorithm encryption and


decryption processes is that, in decryption, the subkeys K1 and K2 are
applied in reverse order, i.e. the first subkey used is K2 while the second
subkey used is K1.

AN EXAMPLE OF THE S-DES ALGORITHM:

Q: Given the 10-bit secret key {1 0 1 0 0 0 0 0 1 0}, what is the


ciphertext of the plaintext {1 0 0 1 0 1 1 1}?
A:

1. First, we need to get the two subkeys K1 and K2 by performing the


key expansion step as described. The input 10-bit key is permuted
using the P10 function as in Table 7.
After P10 we the output {1 0 0 0 0 0 1 1 0 0}.
Next, we divide the key into two 5-bit halves, L = {1 0 0 0 0} and
R = {0 1 1 0 0}. Now we apply the one-bit circular left shift
operation that is done by LS1 on each half.
So, L will be {0 0 0 0 1} and R will be {1 1 0 0 0}
Now, combine both halves obtained from LS1 and permute the bits
using the P8 function as in Table 8. The output will be the first
subkey K1.
After P8, we get K1: {1 0 1 0 0 1 0 0}
To generate K2, the 2 halves output obtained from LS1 should again
undergo the process of the two-bit circular left shift operation that is
done by the LS2 function on each half.
So, after LS2, L will be {0 0 1 0 0} and R will be {0 0 0 1 1}
Next, combine both halves obtained from LS2 and permute the bits
using the P8 function as in Table 8. The output will be the second
subkey K2. After the second P8, we get K2: {0 1 0 0 0 0 1 1}
The final output of the S-DES key expansion process is:
K1 = {1 0 1 0 0 1 0 0}, K2 = {0 1 0 0 0 0 1 1}
Page 10 of 12
2. We perform initial permutation on our 8-bit plain text using the IP
shown in Table 1.
After IP, the output is {0 1 0 1 1 1 0 1}.

3. After the IP, we get an 8-bit block of text which we divide into 2
halves of 4 bits each.
L = {0 1 0 1} and R = {1 1 0 1}

4. On the right half, we perform expanded permutation using EP shown


in Table 2.
After EP, the output is {1 1 1 0 1 0 1 1}

5. We perform the XOR operation using the first key K1 with the output
of EP. Since K1 is {1 0 1 0 0 1 0 0}, so:
{1 0 1 0 0 1 0 0} ⊕ {1 1 1 0 1 0 1} = {0 1 0 0 1 1 1 1}
After the XOR operation with K1, the output is {0 1 0 0 1 1 1 1}

6. Again, we divide the output of XOR into 2 halves of 4 bits each.


L = {0 1 0 0} and R = {1 1 1 1}
For both halves, we take the first and fourth bits to select the row and
the second and third bits to select the column for the S-Boxes S0 and
S1 shown in Table 3 and Table 4, respectively.
For L = {0 1 0 0}:
Row is {00} = 0 and column is {10} = 2, so S0 = 3 = {11}
For R = {1 1 1 1}:
Row is {11} = 3 and column is {11} = 3, so S1 = 3 = {11}
After performing the first round’s S-Boxes and combining S0 and S1
outputs, the output is {1 1 1 1}

7. The 4-bit output of the S-Boxes goes to the permutation P4. Using
the P4 function, as shown in Table 5, the output of P4 is {1 1 1 1}

8. Next, we XOR the P4 output with the left half output of IP.
{0 1 0 1} ⊕ {1 1 1 1} = {1 0 1 0}
After the XOR operation with the left nibble output of the IP function,
the output is {1 0 1 0}

9. We combine both halves i.e. the right half output of the IP function
and the output of the last step. So, after combining {1 1 0 1} and

Page 11 of 12
{1 0 1 0}, the output of the first fK function will be
{1 0 1 0 1 1 0 1}.

10. Now, divide the output into two halves of 4 bits each and perform
the swap function (SW) to get the output of {1 1 0 1 1 0 1 0}
11. Using the output of the last step, we next perform the second round’s
fK function, as shown in Fig. 2, but this time we use the second
subkey K2.
The output of each step is as follows:
• After EP, the output is {0 1 0 1 0 1 0 1}
• After the XOR operation with K2, the output is {0 0 0 1 0 1 1 0}
• After doing the second S-Boxes S0 and S1, the output is {1 1 1 1}
• After P4, the output is {1 1 1 1}
• After the XOR operation with the left nibble input to the second fK
function, the output is {0 0 1 0}
• After doing the second fK function, the output is
{0 0 1 0 1 0 1 0}

12. Using the output {0 0 1 0 1 0 1 0} of the last step, we next


perform inverse initial permutation IP-1 as defined in Table 6. The
output of this step will be the required 8-bit ciphertext of the
corresponding input plaintext.
The 8-bit ciphertext output will be {0 0 1 1 1 0 0 0}

Page 12 of 12

You might also like