Data Encryption Standard

Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1of 29

DATA ENCRYPTION STANDARD

• DES features
• It is a block cipher algorithm.
• DES is a symmetric key algorithm.
• Key length of 64 bit.
• Block size of 64 bit.(plaintext)
• DES encryption algorithm. (steps)
• Initial permutation.
• Iteration (16 round).
• Key transformation .
• 32 bit swap.
• Inverse permutation.
Iteration

• The 64 bit input is divided into two equal portion denoted by L


and R.
• The output generates two 32 bits block L and R.
• The left part of the output is equal to the right part of the input.
• The right part of the output is derived from the bitwise XOR
of the left part of the input and the function of the right part of
the input and the key at the given iteration.
Key generation
• DES uses a 56 bit key. Actually the initial key consist of 64 bit key.
• Before the DES process starts every eight bit of the key discarded
to produce a 56 bit key.
• That is bit position 8,16,24,32,40,48,56 and 64.are discarded.
• Thus discarding of every eight bit of the key produces a 56 bit key
from the original 64 bit key.
• DES based on confusion and diffusion.
• DES based on 16 rounds.
• Such a round perform the steps of substitution and transposition.
Steps in DES
• In the first step initial permutation (IP) on 64 bit plain text.
• IP produces two permuted block LPT and RPT.
• Each LPT and RPT goes through 16 rounds of encryption
process each with its own key.
• At the end LPT and RPT are rejoined and final permutation
(FP) is performed on the combined block. The result produces
• 64 bit ciphertext.
Initial permutation

• IP happens only once and it happens before the first round.


• It suggest how the transposition is obtained in IP
• Ex. IP replaces the first bit of the plaintext block with the
• 58th bit of the original palintext block.
• The second bit with 50th bit of the original plaintext block and
so on.
• This is nothing but the jugglery of bit position of the original
plaintext block.
• IP
58 50 42 34 26 18 10 2
60 52 44 36 28 20 12 4
62 54 46 38 30 22 14 6
64 56 48 40 32 24 16 8
57 49 41 33 25 17 9 1
59 51 43 35 27 19 11 3
61 53 45 37 29 21 13 5
63 55 47 39 31 23 15 7
• After IP the resulting 64 bit permuted block is divided into
two half block.
• Each half block consist of 32 bit i.e LPT and RPT.
• Now 16 rounds performed on this block.
Round in DES

• Each of the 16 rounds consist of the following steps.


• key transformation
• Expansion permutation
• S-box substitution
• P-box permutation
• XOR and swap.
• Key transformation : from the 56 bit key 48 bit key is
generated in each round using a process called key
transformation.
• For this 56 bit key is divided in to two parts 28 bit each.
• This two parts circularly shifted by one or two position,
depending on the round . For ex. If the round number is
1,2,9,16 the shift is done by one position. For other round the
circular shift is done by two position .
• round 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15

No 1 1 2 2 2 2 2 2 1 2 2 2 2 2 2
of
key
bit
shift
ed
• After an appropriate shift 48 of the 56 bits are selected .
• After the shift bit number 14moves into the first position , bit
no. 17 moves into second position and so on .
• The table contains only 48 bit , bit no. 18 is discarded , like 7
others to reduce 56 bit key to 48 bit.
• The key transformation involves permutation as well as
selection of 48 bit subset of the original 56 bit key is called
compression permutation.
• Because of this compression permutation technique a different
subset of key is used in each round. That makes DES not so
easy to crack.
Compression permutation
14 17 11 24 1 5
3 28 15 6 21 10
23 19 12 4 26 8
16 7 27 20 13 2
41 52 31 37 47 55
30 40 51 45 33 48
44 49 39 56 34 53
46 42 50 36 29 32
Expansion permutation

• After IP the 32 bit LPT and RPT.


• During EP the RPT is expanded from 32 bits to 48 bits.
• Besides increasing the bit size from 32 to 48, the bits are also
permuted as well hence the name expansion permutation.
• The 32 bit RPT is divided into eight blocks,with each block
consisting of eight bits.4bit block is then expanded into 6 bit block.
• As the key transformation process compress the 56 bit key to 48 bit
key. Then EP expands the 32 bit RPT to 48 bits. Now the 48 bit
key is XOR with 48 bit RPT and the resulting output is given to the
next step S-box substitution.

Step3 S-box substitution.
• The substitution is performed by eight substitution boxes.
• Each of the 8 s-boxes has 6 bit input and 4 bit output.
• The 48 bit input block is divided into 8- sub-block (6 bit
each) and given to the s-box. The sub-block transform 6-
bit input into 4 bit output.


• S1
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
0 14 4 13 1 2 15 11 8 3 10 6 12 5 9 0 7
1 0 15 7 4 14 2 13 1 10 6 12 11 9 5 3 8
2 4 1 14 8 13 6 2 11 15 12 9 7 3 10 5 0
3 15 12 8 2 4 9 1 7 5 11 3 14 10 0 6 13

• For example, for input 011011 the row is 01, that is row
1, and the column is determined by 1101, that is
column 13. In row 1 column 13 appears 5 so that the
output is 0101. the output of each S-box is combined to
form a 32 bit block which is given to P-box.
• The permutation function P yields a 32-bit output
from a 32-bit input by permuting the bits of the input
block. eg. A 16 in the first block that the bit at position
16 of the original input movs to the bit at position 1 in
the output.
• P 16 7 20 21
29 12 28 17
1 15 23 26
5 18 31 10
2 8 24 14
32 27 3 9
19 13 30 6
22 11 4 25
DES key schedule calculation -the original
key is 64 bit
PC-1 permuted choice1
57 49 41 33 25 17 9
1 58 50 42 34 26 18
10 2 59 51 43 35 27
19 11 3 60 52 44 36

63 55 47 39 31 23 15
7 62 54 46 38 30 22
14 6 61 53 45 37 29
21 13 5 28 20 12 4
• PC-2 permuted choice 2
14 17 11 24 1 5
3 28 15 6 21 10
23 19 12 4 26 8
16 7 27 20 13 2
41 52 31 37 47 55
30 40 51 45 33 48
44 49 39 56 34 53
46 42 50 36 29 32
• Iteration corresponds to left shifts:

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

9 10 11 12 13 14 15 16
1 2 2 2 2 2 2 1
XOR and swap

• We have been performing all these operations only on 32 RPT of


original 64-bit plaintext.
• The LPT was untouched so far. At this stage the LPT is XORed with
• the output produced by p-box permutation. The result of this is
become the new RPT.
• The result of this XOR operation becomes new right half.(RPT)
• The old RPT becomes new LPT in a process of swapping. As
shown in the diagram.
• Final permutation: at the end of 16 rounds the final permutation
performed only once. This is simple transposition.
• The output of the final permutation is th 64 bit encrypted block.
DES Decryption

Same algorithm used for decryption process.


The only difference between the encryption and decryption is the
reversal of key portions.
The original key K is divided into k1,k2,k3,……k16 for the 16
encryption round , for decryption the key should be used as
k16,k15,k14,k13,….. K1.
Avalanche Effect

• key desirable property of an encryption


algorithm
• where a change of one input or key bit
results in changing approx half output bits
• making attempts to “home-in” by guessing
keys impossible
• DES exhibits strong avalanche
Analyzing of DES or strength of DES

• Use of s boxes : S boxes in DES kept secret .


• Key length: any cryptographic system two important aspect :
• cryptographic algorithm
• key
• The working of DES is completely known to the general public.
• Therefore the strength of DES lies only its key which must be
secret.
• As DES uses 56 bit key. Thus it seems that the brute force attack is
impractical.

Analyzing of DES or strength of DES

• now have several analytic attacks on DES


• these utilize some deep structure of the cipher
– by gathering information about encryptions
– can eventually recover some/all of the sub-key bits
– if necessary then exhaustively search for the rest
• generally these are statistical attacks
• include
– differential cryptanalysis
– linear cryptanalysis
– related key attacks
Varations of DES

• Double DES : uses two keys for encryption i.e K1 and K2


.reverse process for decryption i.e K2, K1.
• Triple DES: triple DES with three keys. i.e k1,k2,k3.
• triple DES with two keys. i.e k1,k2,k1.

You might also like