DES(S-box & P-box).
Des has been a cryptographic algorithm over three decade
Des has been found vulnerable against very powerful attack.
It has been a landmark for cryptographic algorithm.
Des Aim to learn des
Data encryption standard
Understand Des
To dissect and understand real life problem.
Useful for understanding other algorithm of
cryptographic
ECB Electronic Code block.
Des uses CBC Cipher Block Chaining mode.
CFB Cipher Feed Back
How DES works ?
Type :- BLOCK
For encryption DES
For decryption DES with minor
• 64 bit data difference.
DATA block
Key length used key is 56bit.
• Apply Des
DES algorithm
• Encrypted
ENCRYPTE text 64bit
D DATA block.
Conceptual working of Des
64 bit plain 64 bit plain 64 bit plain
text block text block text block
key DES key DES key DES
64 bit cipher 64 bit cipher 64 bit cipher
text text text
Block 1 Block 2 Block n
How we get 56 bit key.
• 64
Des key bitkey
• Discard
Discard every 8th
8th bit bit
• 56th bit
Des key key
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
Discarded key
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
Substitution (Confusion)
Transpositions (diffusion)
Des is based Consist of 16 rounds
on two Each round contain
Substitution (Confusion)
fundamental Transpositions (diffusion)
Steps for Des algorithm
step1 Plain text 64bit
step2 Initial permutation
step3 LPT RPT
step4 key 16rounds 16rounds key
step5 Final permutation
step6 Cipher text 64 bit
Step 1 Plain text
Plain text is the simple text , information or msg to be send from sender to receiver.
Plain text may be very much confidential to user thus provide an encryption technique to provide
safety during transaction and storage format.
Step 2 Initial permutation.
Initial Data. Here conversion take
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 place as follows.
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 1 58
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 2 50
49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 3 40
4 34
Initial Permutation. 5 26
6 18
58 50 42 34 26 18 10 2 60 52 44 36 28 20 12 4
7 10
62 54 46 38 30 22 14 6 64 56 48 40 32 24 16 8
8 2
57 49 41 33 25 17 9 1 59 51 43 35 27 19 11 3
9 60
61 53 45 37 29 21 13 5 63 55 47 39 31 23 15 7
.
.
58 4 62 7 32bit 32bit
.
LPT RPT
Always read from left to right .
64 7
Always read from top to bottom.
Step 3 16 Rounds
Key Transformation
Expansion and Permutation
S-Box Substitution
P-box Substitution
XOR and SWAP
Step 1 of 3 key Transformation.
56bit key
28bit 28bit
rounds 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
No of 1 2 1 1 1 2 1 2 1 2 1 1 1 1 1 1
bits
shifted
For each round different subset of the key is used that make not easy to
crack.
Here in each of the round the bits are shifted randomly.
Step 2 of 3 Expansion Permutation
Initial Permutation
32bit
LPT RPT 4bit 4bit 4bit 4bit
16rounds 16rounds 1st block 2nd block 3rd block 4th block
4bit 4bit 4bit 4bit
Initial Permutation
5th block 6th block 7th block 8th block
32bit 32bit
Now we will talk about these 8 block of 4bit each in next slide.
These 4bit block are then expand to 6 bit block in a particular manner.
1 2 3 4 5 6 7 8 29 30 31 32
6bit * 8 bit = 48 bit key generation.
Until now
Key transformation 56 bit 48 bits
Expansion permutation 32bit RPT 48bit RPT
Now 48 bit RPT XOR 48 bit key output S-box substitution
Step 3 0f 3 S-box Substitution
0
1
2
3
.
Key Transformation .
48bit key
56 bits 48 bits .
XOR .
Expansion .
48bit RPT after
permutation .
Rounds
32 bits 48 bits
.
44
45
46
47
0
0
1 6bit sbox1 4bit
1
2
6bit sbox2 4bit 2
3
3
. 6bit sbox3 4bit
.
. Input to p box
6bit sbox4 4bit .
. Permutation
.
.
6bit sbox5 4bit .
.
28
. 6bit sbox6 4bit
29
.
44
6bit sbox7 4bit 30
31
45 6bit sbox8 4bit
46
47
8 no of
Sbox
48bit 6bit
data block
1st bit 2nd bit 3rd bit 4th bit 5th bit 6th bit
b1 b2 b3 b4 b5 b6
b2 b3 b4 b5
How S-box 4bits Represent column no
from (0)0000 to (15th)0000
works
b1 b6
4bits Represent row no from
(0)00 to (3)11 ie four row of s-
box
S-box 1
• Map the data in s-box located from row no bit
b1b6 and column no bit b2b3b4b5
• Note* : start counting row and column from 0
• Get the data from the sbox.
• Here we are substituting the 4bit from the s-
box
• Convert the no from the s box into decimal
digit.
• Repeat for each s-box with each 6bit block.
Step 4 0f 3 P-box permutation
S-box
output
1bit 2bit 3bit . … …. …… … 30 31
Permutated using
P-box
Step 5 0f 3 XOR and Swap
Original 64 bit plain-text Block
32 bit LPT Block 32 bit RPT Block
16 Rounds
XOR
32 bit LPT Block 32 bit RPT Block
64 bit Block
Step5 Final Permutation.
64 bit Block
Final permutation
Random exchange of data
Final
permutation
64 bit Encrypted Block
Cipher text the text that is encrypted.
Though DES is later known as vulnerable which require the
revolution of des as double and Triple des but they were also fail
Step 6 cipher due to slow speed and more computation.
text Des algorithms are easily encode able with the help of cluster
computing.
However these algorithm can be used for decryption also by using
the same keys generated in the 16 rounds.
This presentation is heavily inspired by the book Information and
Thankyou… cyber security by Author Atul Kahate