Cryptography (CS F463) : BITS Pilani
Cryptography (CS F463) : BITS Pilani
6.4
BITS Pilani, Dubai Campus
History
6.5
BITS Pilani, Dubai Campus
Overview
6.6
BITS Pilani, Dubai Campus
DES STRUCTURE
6.7
BITS Pilani, Dubai Campus
General structure of DES
6.8
BITS Pilani, Dubai Campus
Initial and Final Permutations
6.9
BITS Pilani, Dubai Campus
Initial and final permutation tables
Initial Permutation : A B
Solution
6.11
BITS Pilani, Dubai Campus
Example
Prove that the initial and final permutations are the inverse of
each other by finding the output of the initial permutation if the
input is
Solution
The input has only two 1s; the output must also have only two 1s.
Using Table 6.1, we can find the output related to these two bits.
Bit 15 in the input becomes bit 63 in the output. Bit 64 in the
input becomes bit 25 in the output. So the output has only two 1s,
bit 25 and bit 63. The result in hexadecimal is
6.12
BITS Pilani, Dubai Campus
Note
6.13
BITS Pilani, Dubai Campus
Rounds
DES uses 16 rounds. Each round of DES is a Feistel
cipher.
6.15
BITS Pilani, Dubai Campus
Expansion P-box
Since RI−1 is a 32-bit input and KI is a 48-bit key, we first
need to expand RI−1 to 48 bits.
Expansion permutation
6.16
BITS Pilani, Dubai Campus
Although the relationship between the input and output
can be defined mathematically, DES uses Table 6.2 to
define this P-box.
Table 6.6 Expansion P-box table
6.17
BITS Pilani, Dubai Campus
Whitener (XOR)
After the expansion permutation, DES uses the XOR
operation on the expanded right section and the round
key. Note that both the right section and the key are 48-
bits in length. Also note that the round key is used only in
this operation.
6.18
BITS Pilani, Dubai Campus
S-Boxes
The S-boxes do the real mixing (confusion). DES uses 8
S-boxes, each with a 6-bit input and a 4-bit output. See
Figure 6.7.
6.19
BITS Pilani, Dubai Campus
S-box rule
Table 6.3 shows the permutation for S-box 1. For the rest of the boxes see the textbook.
6.20
BITS Pilani, Dubai Campus
Example
The input to S-box 1 is 100011. What is the output?
Solution
If we write the first and the sixth bits together, we get 11 in
binary, which is 3 in decimal. The remaining bits are 0001 in
binary, which is 1 in decimal. We look for the value in row 3,
column 1, in Table 6.3 (S-box 1). The result is 12 in decimal,
which in binary is 1100. So the input 100011 yields the output
1100.
6.21
BITS Pilani, Dubai Campus
Example
Solution
If we write the first and the sixth bits together, we get 00 in
binary, which is 0 in decimal. The remaining bits are 0000 in
binary, which is 0 in decimal. We look for the value in row 0,
column 0, in Table 6.10 (S-box 8). The result is 13 in decimal,
which is 1101 in binary. So the input 000000 yields the output
1101.
6.22
BITS Pilani, Dubai Campus
Straight Permutation
6.23
BITS Pilani, Dubai Campus
Cipher and Reverse Cipher
First Approach
To achieve this goal, one approach is to make the last
round (round 16) different from the others; it has only a
mixer and no swapper.
Note
6.25
Alternative Approach
Key Generation
The round-key generator creates sixteen 48-bit keys out
of a 56-bit cipher key.
6.26
BITS Pilani, Dubai Campus
Key generation
6.27
BITS Pilani, Dubai Campus
Parity-bit drop table
6.28
BITS Pilani, Dubai Campus
Key-compression table
14 17 11 24 01 05 03 28 15 06 21 10 23 19 12 04 ..... 34 53 46 42 50 36 29 32
6.29
BITS Pilani, Dubai Campus
Example 6.5
We choose a random plaintext block and a random key, and
determine what the ciphertext block would be (all in
hexadecimal):
6.30
BITS Pilani, Dubai Campus
Example 6.5
6.31
BITS Pilani, Dubai Campus
Example
6.32
BITS Pilani, Dubai Campus
DES ANALYSIS
6.33
BITS Pilani, Dubai Campus
Properties
6.34
BITS Pilani, Dubai Campus
Example
6.35
BITS Pilani, Dubai Campus
Continued
Completeness effect
Completeness effect means that each bit of the ciphertext
needs to depend on many bits on the plaintext. ( D-box
and S- box will provide strong completeness effect)
6.36
BITS Pilani, Dubai Campus
Weaknesses in Key Example 6.8
Let us try the first weak key in Table 6.18 to encrypt a block two times.
After two encryptions with the same key the original plaintext block is
created. Note that we have used the encryption algorithm two times, not
one encryption followed by another decryption.
6.37
BITS Pilani, Dubai Campus
Double encryption and decryption with a weak key
6.38
BITS Pilani, Dubai Campus
Semi weak key creates only 2 different round keys, each is
repeated 8 times. Also, round keys are the same, with different
order.
6.39
BITS Pilani, Dubai Campus
Continued
6.40
BITS Pilani, Dubai Campus
A pair of semi-weak keys in encryption and decryption
6.41
BITS Pilani, Dubai Campus
Security of DES
6.42
BITS Pilani, Dubai Campus
Brute-Force Attack
6.43
BITS Pilani, Dubai Campus
Differential Cryptanalysis
6.44
BITS Pilani, Dubai Campus
Linear Cryptanalysis
6.45
BITS Pilani, Dubai Campus
3-key Triple DES