Professional Documents
Culture Documents
UNIT-II:
Introduction to Modern Symmetric
Key Ciphers
Solution
We need a straight P-box with the table [4 1 2 3 6 7 8 5].
The relative positions of input bits 1, 2, 3, 6, 7, and 8 have not
been changed, but the first output takes the fourth input and
the eighth output takes the fifth input.
1 2 3 4 5 6 7 8
9 10 11 12 13 14 15 16
17 18 19 20 21 22 23 24
25 26 27 28 29 30 31 32
33 34 35 36 37 38 39 40
41 42 43 44 45 46 47 48
49 50 51 52 53 54 55 56
57 58 59 60 61 62 63 64
4 1 2 3 6 7 8 5
12 9 10 11 14 15 16 13
20 17 18 19 22 23 24 21
28 25 26 27 30 31 32 29
36 33 34 35 38 39 40 37
44 41 42 43 46 47 48 45
52 49 50 51 54 55 56 53
60 57 58 59 62 63 64 61
Compression P-Boxes
4 1 2 3 6 7 8 5 4 2 3 6 7 5
12 9 10 11 14 15 16 13 12 10 11 14 15 13
Example of a
20 17 18 19 22 23 24 21 20 18 19 22 23 21
64 × 48
28 25 26 27 30 31 32 29 permutation 28 26 27 30 31 29
36 33 34 35 38 39 40 37 table 36 34 35 38 39 37
44 41 42 43 46 47 48 45 44 42 43 46 47 45
52 49 50 51 54 55 56 53 52 50 51 54 55 53
60 57 58 59 62 63 64 61 60 58 59 62 63 61
Expansion P-Boxes
4 1 2 3 6 7 8 5 1 4 1 2 3 6 7 8 5 8
12 9 10 11 14 15 16 13 9 12 9 10 11 14 15 16 13 16
20 17 18 19 22 23 24 21 17 20 17 18 19 22 23 24 21 24
Example of a
28 25 26 27 30 31 32 29 64 × 80
25 28 25 26 27 30 31 32 29 32
36 33 34 35 38 39 40 37 permutation 33 36 33 34 35 38 39 40 37 40
44 41 42 43 46 47 48 45 table 41 44 41 42 43 46 47 48 45 48
52 49 50 51 54 55 56 53 49 52 49 50 51 54 55 56 53 56
60 57 58 59 62 63 64 61 57 60 57 58 59 62 63 64 61 64
P-Boxes: Invertibility
Position 1 2 3 4 5 6
Plain text 0 1 1 0 0 1
Permutation key 6 3 4 5 2 1
Cipher text 1 1 0 0 1 0
Position 1 2 3 4 5 6
Cipher text 1 1 0 0 1 0
Inverted
6 5 2 3 4 1
Permutation key
Plain text 0 1 1 0 0 1
Example:
Position 1 2 3 4 5 6
Plain text 1 1 0 0 1 1
Permutation key 3 6 1 4 2 5
Cipher text 0 1 1 0 1 1
Position 1 2 3 4 5 6
Cipher text 0 1 1 0 1 1
Inverted
3 5 1 4 6 2
Permutation key
Plain text 1 1 0 0 1 1
PT CT CT PT
010 111 111 010
110 001 001 110
101 010 010 101
011 100 100 011
Exclusive-Or
An important component in most block ciphers is the
exclusive-or operation.
PT key CT CT key PT
010 010 000 000 010 010
110 010 100 100 010 110
101 010 111 111 010 101
011 010 001 001 010 011
Exclusive-Or (Continued)
Diffusion
The idea of diffusion is to hide the relationship between
the ciphertext and the plaintext.
Confusion
The idea of confusion is to hide the relationship between
the ciphertext and the key.
Rounds
Diffusion and confusion can be achieved using iterated
product ciphers where each iteration is a combination of
S-boxes, P-boxes, and other components.
A product cipher made of two rounds
Diffusion
and
confusion in
a block
cipher
Two Classes of Product Ciphers
Modern block ciphers are all product ciphers, but they
are divided into two classes.
1. Feistel ciphers
2. Non-Feistel ciphers
Feistel Ciphers
Feistel designed a very intelligent and interesting cipher
that has been used for decades. A Feistel cipher can have
three types of components: self-invertible, invertible, and
noninvertible.
Non-Feistel Ciphers
A non-Feistel cipher uses only invertible components. A
component in the encryption cipher has the
corresponding component in the decryption cipher.
The first thought in Feistel cipher design
Solution
Key processing:
The function extracts the first and third bits to get 11 in
binary or 3 in decimal. The result of squaring is 9, which is
1001 in binary.
Improvement of the previous Feistel design
L1 R1
f(R2,K)
L2 R2
Plaintext: 011100
f(R2,K) Split with L1:f(R
0113,K)
R1: 100
Key: 101
R2=R1: 100
F(R1,K): 100 ⊕101: 001
L3 R3 L2=L1 ⊕ F(R1,K): 011 ⊕ 001: 010
Ciphertext: 010100
Improvement of the previous Feistel design
2nd Round:
Plaintext: 010100 2nd Round: (Invertible Round 1)
Split with L2: 010 R2: 100 Ciphertext: 011100
Key: 101 Split with L3: 011 R3: 100
R3=R2 = 100 Key: 101
F(R2,K) = 100 ⊕101= 001 R3=R2: 100
L3=L2 ⊕ F(R2,K) = 010 ⊕ 001 = 011 F(R3,K): 100 ⊕101 = 001
Ciphertext: 011100 L2=L3 ⊕ F(R3,K) = 011 ⊕ 001 = 010
After this round: 010100
Final design of a Feistel cipher with two rounds
Block Cipher Design Principles:
Input block is partitioned into two halves, L
and R i-
1 i-1
In round i,
i
L =R
i-1
R = L F(K , R )
i i-1 i i-1
Substitution followed by permutation
Multiple rounds
Feistel Cipher Design Parameters/Features
Block size
Increasing size improves security, but slows cipher
Key size
Increasing size improves security, makes exhaustive key searching harder,
but may slow cipher
Number of rounds
Increasing number improves security, but slows cipher
Round function
Greater complexity can make analysis harder, but slows cipher
the subkeys Ki in reverse
order
F need not be a
reversible function