S Des

Download as pdf or txt
Download as pdf or txt
You are on page 1of 5

Updated Course Material

Simplified DES

Simplified
algorithm takes an 8-bit block of ciphertext and the same 10-bit key used to produce
that ciphertext as input and produces the original 8-bit block of plaintext.

The encryption algorithm involves five functions:


• an initial permutation (IP);
• a complex function labeled fK, which involves both permutation and substitution
operations and depends on
• a key input;
• a simple permutation function that switches (SW) the two halves of the data;
the function fK again;
• finally a permutation function that is the inverse of the initial permutation (IP–1).

The function fK takes as input not only the data passing through the encryption
algorithm, but also an 8-bit key. The algorithm could have been designed to work
with a 16-bit key, consisting of two 8-bit subkeys, one used for each occurrence of fK.
Alternatively, a single 8-bit key could have been used, with the same key used twice
in the algorithm
In this case, the key is first subjected to a permutation (P10). Then a shift operation is
performed. The output of the shift operation then passes through a permutation
function that produces an 8-bit output (P8) for the first subkey (K1). The output of the
shift operation also feeds into another shift and another instance of P8 to produce the
second subkey (K2).

The encryption algorithm can be expressed as:

S-DES Key Generation:

Following is the key generation process:


S-DES depends on the use of a 10-bit key shared between sender and receiver. From
this key, two 8-bit subkeys are produced for use in particular stages of the encryption
and decryption algorithm. Figure C.2 depicts the stages followed to produce the
subkeys. First, permute the key in the following fashion. Let the 10-bit key be
designated as (k1, k2,k3, k4, k5, k6, k7, k8, k9, k10). Then the permutation P10 is
defined as:

P10
3 5 2 7 4 10 1 9 8 6

Next, perform a circular left shift (LS-1), or rotation, separately on the first
five bits and the second five bits. LS-1 is a circular left shift of 1 bit position, and
LS-2 is a circular left shift of 2 bit positions.

Apply P8, which picks out and permutes 8 of the 10 bits according to the following
rule:
P8
6 3 7 4 8 5 10 9

S-DES Encryption:
Initial and Final Permutations
The input to the algorithm is an 8-bit block of plaintext, which we first permute using
the IP function:
S
Encryption:
\

IP is the initial permutation and IP-1 is its inverse.


IP
2 6 3 1 4 8 5 7

IP-1
4 1 3 5 7 2 8 6

The Function fK
The most complex component of S-DES is the function fK, which consists of a
combination of permutation and substitution functions. The functions can be
expressed as follows. Let L and R be the leftmost 4 bits and rightmost 4 bits of the
8-bit input to fK, and let F be a mapping (not necessarily one to one) from 4-bit
strings to 4-bit strings. Function fK consists of a combination of permutation and
substitution functions.
fK(L, R) = (L  F(R, SK), R)
where SK is a subkey and ! is the bit-by-bit exclusive-OR function. For example,
suppose the output of the IP stage in Figure C.3 is (10111101) and F(1101, SK) =
(1110) for some key SK. Then fK(10111101) = (01011101) because (1011) ! (1110) =
(0101).

The mapping of F.:


The input is a 4-bit number (n1n2n3n4). The first operation is an
expansion/permutation operation:
E/P is an expansion permutation, with the following rules:
E/P
4 1 2 3 2 3 4 1

It is clearer to depict the result in this fashion:


The first 4 bits (first row of the preceding matrix) are fed into the S-box S0 to produce
a 2- bit output, and the remaining 4 bits (second row) are fed into S1 to produce
another 2-bit output.
These two boxes are defined as follows:

The S-boxes operate as follows. The first and fourth input bits are treated as a 2-bit
number that specify a row of the S-box, and the second and third input bits specify a
column of the Sbox. The entry in that row and column, in base 2, is the 2-bit output.
For example, if (p0,0 p0,3) = (00) and (p0,1p0,2) = (10), then the output is from row 0,
column 2 of S0, which is 3, or (11) in binary. Similarly, (p1,0p1,3) and (p1,1p1,2) are
used to index into a row and column of S1 to produce an additional 2 bits.
Next, the 4 bits produced by S0 and S1 undergo a further permutation as follows:

And P4 would be another permutation.


P4
2 3 4 1

The output of P4 is the output of the function F.

The Switch Function


The function fK only alters the leftmost 4 bits of the input. The switch function (SW)
interchanges the left and right 4 bits so that the second instance of fK operates on a
different 4 bits. In this second instance, the E/P, S0, S1, and P4 functions are the same.
The key input is K2.

You might also like