Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Exercise 3 S-DES Usage

Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 3

ID

Exercise 2

AN EXAMPLE OF USING S-DES ALGORITHM

Plaintext (8 bits = 1 byte)


0 1 1 1 1 0 1 1

Key (10 bits)


1 1 0 0 1 1 1 0 1 1

Bit’s operations
(A) permutation P10:
(3 5 2 7 4 10 1 9 8 6)
(B) LS-1 = left shift by 1 for each of 5 bit block separately
(5 2 7 4 3 1 9 8 6 10)
(C) Reducing permutation P8
(6 3 7 4 8 5 10 9)
(D) LS-2 = left shift by 2 for each of 5 bit block separately
(7 4 3 5 2 8 6 10 1 9)

GENERATING THE K1 SUBKEY: operations (A) + (B) + (C)

Operation (A)
0 1 1 1 0 1 1 1 0 1

Operation (B)
1 1 1 0 0 1 1 0 1 1

Operation (C) = subkey K1


1 0 1 0 0 1 1 1

GENERATING THE K2 SUBKEY: operations (A) + (B) + (D) + (C)

Operation (A)
0 1 1 1 0 1 1 1 0 1

Operation (B)
1 1 1 0 0 1 1 0 1 1

Operation (D)
1 0 0 1 1 0 1 1 1 1

Operation (C) = subkey K2


1 0 1 0 0 1 1 1

ENCRYPTION

(1) operation IP (initial permutation) on the plaintext


2 6 3 1 4 8 5 7
1 0 1 0 1 1 1 1

(2) function FKey1() = (() XOR f(, Key1), ())

but f(, Key1) means:


(A’) operation E/P8 (extending permutation) on the first argument of function f
4 1 2 3 2 3 4 1
1 1 1 1 1 1 1 1
(B’) operation (A’)  Key1 (XOR)
0 1 0 1 1 0 0 0
(C’) Convert consecutive pairs of bits to decimal numbers. The first pair read as a decimal
specifies the row of table S0, and the third - the row of table S1. The second and fourth binary pairs
analogously determine the column number of tables S0 and S1, respectively. The decimal numbers
read from the tables are again converted to binary notation, obtaining a sequence of 4 bits.
0 1 0 1

Example: we enter (C ') with the bit string 00011100, which converted to decimal numbers give
0, 1 for S0 and 3, 0 for S1. The output produces the string shown in four yellow cells below.

(D’) operation P4 (straight permutation)


2 4 3 1
1 1 1 0
FKey1() = (() XOR (), ())

(3) operation SW (switching halves)


5 6 7 8 1 2 3 4
0 1 0 0 1 1 1 1

(4) function FKey2 () = (() XOR f(, Key2), ())


but f(, Key2) means:
(A’) operation EP (extending permutation) on the first argument of function f
1 1 1 1 1 1 1 1
(B’) operation (A’)  Key2 (XOR)
1 0 1 0 0 1 1 1

(C’) do exactly the same as in case of Key1


0 1 1 1

(D’) operation P4 (straight permutation)


2 4 3 1
1 1 1 0
FKey2() = (() XOR (), ())
0 1 0 1 1 0 0 0
(5) operation IP-1 (inverse permutation) = ciphertext
4 1 3 5 7 2 8 6
0 0 0 2 0 0 0 0

You might also like