TRANSCRIPTEnglish

Data Encryption Standard (DES) - Explained with an Example - Cryptography - CyberSecurity - CSE4003

51m 41s7,891 words1,302 segmentsEnglish

FULL TRANSCRIPT

0:10

today we are going to have a very

0:11

interesting session

0:12

we are going to learn about data

0:14

encryption standard des

0:16

before going into des let us take a look

0:19

at our

0:19

previous class concepts in our previous

0:22

class we are looking at

0:23

block cipher do you remember what is a

0:27

block cipher

0:28

the key concept in a block cipher is

0:30

whenever you have a message

0:32

that should be sent this message is

0:35

divided

0:36

into equal sized blocks so

0:39

these blocks can be of 64 bits 128 bits

0:43

or 256

0:44

bits so message gets split

0:47

into blocks and

0:50

these blocks are then given to an

0:53

encryption strategy wherein we convert

0:56

the plain text to a

0:57

cipher text so we were looking at so

0:59

many different modes of block ciphers in

1:01

our last class

1:03

this is one of the modes called

1:04

electronic code book and we looked at

1:06

another mode called the cipher

1:08

block chaining wherein we take the plain

1:10

text of 64 bits and then we

1:12

have an initialization vector of 64 bits

1:15

we perform an

1:16

xr and we feed this to an encryption

1:19

strategy

1:19

so in all the modes we are talking about

1:21

some encryption and decryption

1:23

algorithms or strategies so what is this

1:25

encryption strategy

1:26

today we are going to learn one of the

1:28

block cipher encryption strategies that

1:31

is

1:32

d e s nothing but data

1:35

encryption standard

1:39

so what is this data encryption standard

1:41

it's an encryption algorithm

1:42

that was put forward in the 1970s it was

1:45

developed in the early 1970s by

1:48

ibm and it was published as an official

1:52

information processing standard in 1976.

1:55

so let's go and take a look at what is

1:58

des

1:59

first we will take a look at the block

2:01

diagram of

2:02

des and overview of this algorithm

2:05

using a block diagram so i have taken

2:08

some time to construct this block

2:10

diagram

2:11

so let us understand this

2:14

we have messages coming in which are

2:16

divided into blocks when you talk about

2:18

block cipher

2:20

d e s is a block cipher therefore we

2:23

have messages divided into

2:25

blocks each block is of 64 bits

2:29

so this is the message that we want to

2:31

encrypt

2:33

so we'll take every block and then we

2:36

run it through our encryption algorithm

2:38

to finally get the

2:40

cipher text when you take a look at this

2:43

block diagram we have some important

2:45

phases in this diagram the very first

2:48

thing is we'll be using a key

2:50

for encryption we need a key and that

2:52

key size is 64 bit

2:54

which will be fed to the key generator

2:56

and this key generator will be

2:58

rearranging the bits in the key

3:00

and then it will generate sub keys and

3:03

this will lead to

3:04

16 sub keys you see here we are going to

3:07

generate 16 sub keys

3:09

and each sub key will be of 48 bits in

3:12

length so we'll take a 64 bit key

3:16

we'll do some permutations and we'll

3:19

reduce it to 56

3:20

from this 56 we'll employ a strategy

3:24

from which we'll be getting 16 sub keys

3:28

i will say

3:28

these are sub keys 16 sub keys

3:32

each of length 48 bits

3:36

so that is one part so once when the

3:38

keys are ready the next thing is we'll

3:40

be taking in the message

3:42

we'll be understanding what is

3:44

permutation and division of the

3:46

block of message that you are taking in

3:48

so this this is another step

3:50

once when this is done the output of

3:52

this block is given to

3:54

a block by name round so you can see

3:57

here we have almost

3:59

16 rounds

4:02

all these rounds perform the same action

4:05

but with different input and one good

4:08

thing is

4:09

all the rounds perform the same action

4:12

the only thing is

4:13

the output of one of the round will be

4:15

the input of the

4:16

next round so the output of this round

4:19

will be the input of this round

4:21

otherwise the concept behind all these

4:23

rounds is the same

4:24

only thing is the output from each round

4:28

is given to the next round

4:31

and the output just propagates like that

4:34

we complete 16 rounds

4:36

finally we'll perform some final

4:38

permutations

4:40

and then we'll be giving the ciphertext

4:42

out

4:44

so that is the overall very higher level

4:47

view of what data encryption standard

4:50

is all about we learn this algorithm

4:53

in three parts the first part

4:57

we'll take a look at this we'll take a

4:59

key

5:00

and we'll see how we are going to

5:02

generate

5:03

16 sub keys how to generate 16 sub

5:07

keys from this 64-bit key which is taken

5:11

as an

5:11

input that will be our say we'll call

5:14

that to be the first

5:16

phase of a learning after this

5:19

we'll take a block of message a 64-bit

5:22

block of message we will see

5:24

how that block is given to a permutation

5:28

and division module and what kind of

5:31

permutation happens for this block of

5:33

message

5:34

we'll understand this this can be our

5:38

phase two of the learning

5:42

so permutation is nothing but

5:43

rearranging the bits in the

5:45

blocks we'll understand how that

5:48

rearrangement really happens and what is

5:50

dividing or what is the division of bits

5:52

into

5:53

separate blocks we'll understand this in

5:56

phase two

5:58

and in phase three we'll go and

5:59

understand what is the algorithm behind

6:02

each and every round so we'll understand

6:05

what is this round what really works

6:08

behind these rounds

6:10

so once when you understand it for round

6:12

one the same concept applies for

6:14

all the 16 rounds only thing is the

6:17

output from one of the rounds will be

6:18

given as an

6:19

input to the another round so that will

6:22

be your phase

6:22

three of the learning

6:26

so once when that is done finally the

6:28

output of the

6:30

final round will be given to final

6:31

permutation right

6:33

and this will lead to a cipher text so

6:35

we will consider this to be the

6:37

phase four of our learning so we'll

6:40

understand this algorithm in

6:42

four phases first we'll see how to

6:44

generate sub keys

6:46

next we will see how to take a block of

6:47

message and how to

6:49

perform permutation and division and

6:51

then give that as an input to the round

6:54

and we'll understand the algorithm

6:56

behind around

6:57

and that algorithm is applicable for all

7:00

the rounds and we'll see how we generate

7:02

the final output from the final round

7:05

and in the last phase we'll understand

7:06

how to take this output

7:08

and perform some final permutation and

7:10

generate the

7:11

ciphertext that is the overall view

7:15

we will now start with phase one

7:16

generating sub keys

7:21

so however algorithm starts this

7:24

we have a key in exa decimal so this is

7:27

the input key

7:28

and you can very well see here we have

7:30

16 digits

7:32

of hexadecimal character here so this

7:34

leads to

7:36

a 64-bit key

7:39

so this is the 64-bit key we are going

7:41

to use

7:42

in our algorithm so the very first step

7:45

in generating sub keys is

7:47

we are going to take the key and then we

7:48

are going to apply some permutation

7:50

permutation is nothing but

7:52

rearranging the bits in this key and

7:54

also reducing the

7:56

number of bits we are going to reduce it

7:58

from 64 to 56 bits

8:00

that will be the first step and for that

8:02

we will be utilizing a

8:03

pc one table that table i have given

8:06

here

8:07

so how we are going to utilize this

8:08

table is

8:10

we will take go to the very first number

8:12

which is 57 so we have to go to the 57th

8:15

bit in this key the 57th bit is

8:21

here so this 57th bit will become the

8:24

first bit in our output

8:26

likewise we take go to the 49th bit

8:30

49th bit is here this will become our

8:33

second bit in the output like that it

8:36

travels

8:37

all the bits and then we create our

8:40

output

8:40

so i have given the output here so this

8:43

is the output that is created

8:45

by traversing all the bits and applying

8:47

it on this particular key

8:49

we'll get the output as k plus so the

8:52

number of bits in the output

8:54

is actually equal to the number of

8:56

digits in this table

8:57

so how many digits we have in

9:01

every column you see here one two three

9:03

four five

9:04

six seven eight so we have eight digits

9:08

in the column

9:09

likewise how many uh columns we have one

9:11

two three

9:12

four five six seven so seven into eight

9:15

we are going to have 56 digits in our

9:17

output

9:19

so we add 64 bits here and this 64 bits

9:23

by using this pc one table

9:25

we were able to arrive at 56 bits of key

9:29

and we have also reordered the bits in

9:32

this particular

9:33

key so that is the very first step in

9:36

generating

9:36

sub keys i hope you are able to follow

9:39

me

9:40

let us go to the next step

9:46

the next step is we are going to take

9:48

this 56 bit

9:50

key that we have attained by using pc1

9:52

table

9:53

from the previous slide and then we are

9:55

going to split this as

9:56

two halves each half having 28 bits

10:00

so we will take k plus and split it like

10:03

this that is c0

10:05

and d0 the first 28 bits

10:08

will be c0 and the next 28 bits will be

10:12

d0 we know that the size of this key is

10:15

56 bits so we are just dividing that

10:17

into two equal halves

10:20

very simple and clear

10:30

the next step is we'll take the c0 and

10:33

d0 which we obtained from the previous

10:35

slide

10:36

and we'll be using a table containing

10:39

schedule of left shifts so we'll be

10:42

using this table

10:43

in going forward with our output i tell

10:45

you how to use this table

10:47

so we'll go to iteration number one and

10:50

it says

10:50

number of left shifts is one so we'll be

10:53

applying

10:53

a circular left shift by one on this

10:56

particular

10:58

input and what will happen when you

11:00

apply a circular lift shift of one bit

11:03

this one will be pushed to the end

11:06

and all the other bits will be moved

11:08

forward

11:09

by one position because we say number of

11:12

lift shift should be one it's a circular

11:14

left shift

11:14

so that happens likewise when you do a

11:16

circular left shift for b

11:18

zero by one bit we're going to push this

11:20

zero at the end

11:22

and zero will be coming here and we push

11:24

all the bits

11:26

one position to the left so

11:29

we take c zero d zero and we go to

11:32

iteration number one we see number of

11:34

left shifts we have to do is one so we

11:37

we

11:38

do a circular left shift by one bit on c

11:40

zero and d0

11:42

the output we are going to get is c1 and

11:44

d1

11:45

so as a result of the left ship we have

11:47

received this output

11:50

now we go to iteration number 2 and we

11:53

see that we have to perform

11:54

one left ship

11:58

on this c1 and d1 so what we do is we

12:01

just push this one to the end

12:04

with a circular left shift by one digit

12:06

likewise we push this one

12:08

in d1 to the end so it's a circular left

12:11

shift by one digit

12:12

so we are going to use the schedule of

12:14

left shifts for our operations here

12:16

so once when you perform that we'll be

12:17

getting c2 and d2

12:20

c2 and d2 is nothing but the output of

12:22

that

12:24

because of the left shift we have

12:25

received this output

12:27

now we will go to iteration three

12:30

and we'll apply the number of left

12:32

shifts now it says number of left shift

12:34

should be

12:34

two so what does that mean you're going

12:37

to take

12:38

two digits from this place and then

12:40

we're going to push it to the

12:42

end and we're going to push all the

12:44

remaining

12:45

two digits to the left by

12:48

2. likewise you're going to apply that

12:51

to d22

12:52

so we are going to take two digits and

12:54

move it to the

12:55

end and we will push all the digits to

12:58

the

12:58

left so as a result of this we will be

13:02

getting

13:02

c3 d3 so for c3 d3 what you're going to

13:07

do you're going to go to the next uh

13:10

number here that is iteration number

13:13

four

13:14

and then what hominish number should be

13:17

shifted

13:17

if shifted it should be by two so again

13:21

we are going to do this we are going to

13:22

take these two zeros

13:24

push it here and then push all the

13:26

remaining digits

13:27

to the left likewise take these two

13:29

digits

13:30

push it at the end and then push all the

13:33

digis to the left

13:34

so as a result of iteration number four

13:36

on c3 d3

13:38

the output will be c4 d4 you can see

13:40

these two zeros here and zero one here

13:43

likewise you have to continue the

13:44

process till we go and reach

13:46

iteration number 16 so that we achieve

13:49

c16 and

13:50

day 16. quite hectic but the process is

13:54

very simple and

13:56

repetitive let us go with iteration

13:58

number five

13:59

we have to do a left shift by two

14:01

numbers or two digits

14:02

so you just push this zero zero here and

14:05

it goes to the end

14:06

you push zero one to the end it goes to

14:08

the end so

14:10

because of iteration number five applied

14:12

on c4 d4 we are going to get

14:14

c5 d5 next we have to take

14:18

iteration number six it says do a left

14:20

shift by two bits

14:22

so again to get c6 d6 you have to push

14:25

this to the end

14:26

and you have to push this to the end

14:28

that's it

14:30

so like this you have to continue your

14:34

hydrations till you reach iteration

14:36

number 16

14:37

and corresponding to the iterations you

14:39

have to perform

14:41

lift shifts as given here number of left

14:43

shifts

14:47

so i hope you have understood this like

14:49

this we carry on for 16

14:52

iterations and we'll be getting c6 d6 c7

14:56

d7

14:56

c8 d8 c9 d9 c10 d10

15:00

c11 d11 c12 d12 c13

15:03

d13 c14 d14 c15 d15

15:07

and c16 d16 so how did we achieve

15:10

all these things it's very simple

15:14

you just go through so many different

15:17

iterations on c0d0 which we are

15:19

attained from the key and then you do

15:22

the number of left shifts as i have told

15:23

you

15:24

this will lead you to this result

15:30

after this what we are going to do is we

15:33

are going to take

15:35

c1 d1 we have achieved from a previous

15:38

slide right we take c1 d1

15:41

we will combine that so this is nothing

15:43

but c1 d1

15:45

after combining this we are going to

15:47

rearrange the bits in this

15:49

for this we are going to use a

15:50

permutation table as usual

15:52

so this permutation table is called pc2

15:56

and this will help us in rearranging the

15:58

pitch here

15:59

so after applying pc2 the number of bits

16:03

here

16:03

will be reduced to 48 and also the order

16:06

of the bits will be

16:07

rearranged let's see how to use pc2

16:10

it's very similar like what you have

16:12

done in the initial slide by using pc1

16:15

so it says go to the 14th bit in your

16:19

input so what is the 14th bit here that

16:22

is 0

16:23

and make it the first bit in your output

16:26

likewise go to the 17th bit so 17th bit

16:30

is here

16:31

make it the second number in your output

16:34

likewise go to the 11th bit

16:37

so 11th bit is here so

16:40

you make it the third number in your

16:42

output so like that you traverse the

16:44

entire

16:45

chart you'll be you'll be getting how

16:47

many digits out

16:49

48 bits out why i say you'll get 48 bits

16:53

because you see here

16:54

one two three four five six seven eight

16:58

eight elements we have in one column

17:02

like that how many columns we have

17:06

six columns so eight into six is 48

17:10

so after you apply pc2 on c1 d1

17:13

you'll be getting an output like this

17:15

this is key one

17:26

so after applying pc2 on c1 d1 your

17:29

output will be

17:32

key k1 and what is the length of this

17:34

key

17:35

48 bits and this is the

17:38

first sub key

17:42

the block diagram we have seen 16 sub

17:44

keys should be generated each of

17:46

length 48 bits so we have attained our

17:48

first

17:49

sub key like that we have to find all

17:52

the sub keys so we know

17:53

c2 d2 we can take c2 d2

17:56

and what is the next step we have to

17:57

combine them and once we

18:00

have combined we have to use our pc2

18:03

table and this pc2 table will reduce

18:05

this 56 bits to 48 bits and it will also

18:08

rearrange the bits here

18:10

so let's go and see how to do that so go

18:13

to

18:14

the 14th bit so you go to the 14th bit

18:17

here

18:18

and you make it the first bit out

18:22

in your output likewise go to the 17th

18:24

bit

18:25

make it the first bit in your output

18:27

like that you build the output using

18:29

this table

18:30

and this table has got 48 numbers so

18:33

your output will also be 48 digits

18:36

so this is the output we have seen so we

18:39

get

18:40

key2 that is sub key2 which is 48 bits

18:47

so this is our sub key2

18:50

and for this we have used our input as

18:53

c2 d2

18:55

like that we can go and generate for c3

18:58

d3 we can take

18:59

and we can apply pc2 and c3 d3 and we

19:02

can get

19:02

k3 like that we have to continue for all

19:06

the 16 sub keys we are going to generate

19:09

so that

19:10

will finally lead us to all these 16

19:13

sub keys so all these 16 sub keys are of

19:17

length

19:18

48 bits so that's how you generate

19:22

sub keys and taking a look back at our

19:26

block diagram we have finished learning

19:28

the phase

19:29

one

19:32

now we know how to take a 64 bit key

19:35

apply some permutation

19:37

using pc1 then divide it into two blocks

19:40

so pc1 reduces that to 56 bits we divide

19:43

it into two blocks as c0 d0

19:46

each of 28 bits then we use the

19:49

iterations and we apply these 16

19:53

hydrations and we apply so many left

19:55

ships

19:56

so that we get c1 d1 c2 d2 and from that

20:00

we will use pc2

20:01

to reduce all those c1s c naught d

20:04

naught and c

20:05

one d one c two d two right so we will

20:07

reduce that c and d

20:08

and two k and keys and the pc2 helps us

20:12

in reducing the number from

20:15

56 to 48 bits and we will get all our 16

20:19

sub keys

20:22

each of length 48 bits

20:27

so our phase one is done i hope you are

20:30

all clear with

20:31

how to generate 16 sub keys now let us

20:35

go to

20:35

phase 2 what i told this phase 2 we will

20:38

take one block of message which is 64

20:40

bits

20:41

we will then apply permutation on that

20:44

block of bits

20:46

and we'll also divide those block of

20:47

bits that will be our

20:49

phase two so we'll now learn this face

20:53

we'll be working with the input message

20:56

so now let us take the message so this

20:59

is the message block

21:00

it is of 64 bits in length

21:03

and we have to achieve some permutation

21:06

on this what is permutation just

21:08

rearranging the bit cr for that we'll be

21:11

using

21:11

the initial permutation table the ip

21:14

table which is given here

21:15

what this table does is it's the same

21:17

thing go to the first number

21:19

it says go to the 58th bit and make it

21:22

the first bit in your

21:24

output so what is the 58 with 58th bit

21:27

here

21:28

this is the 58th bit and you're going to

21:31

make the

21:32

output bit 1 to be the 58th bit

21:36

likewise what is the next number 50th

21:39

bit

21:39

what is the 50th bit here

21:45

so this is the 50th bit we're going to

21:48

make that

21:49

as bit number two in our output

21:52

so like that you're going to use the

21:53

numbers here take the bits corresponding

21:56

to those numbers

21:57

and move it to our output so we will be

22:00

getting an output like this

22:04

okay this we have achieved by using our

22:07

initial

22:08

permutation

22:11

the next step will be taking this and

22:14

we'll be dividing this into

22:16

two halves each half will have 32 bits

22:19

the entire size of this is 64 bits so

22:21

we'll be dividing that as

22:23

l0 which is of 32 bits

22:26

and then r0 which is of 32 bits

22:31

so we take the permitted output from the

22:34

previous slide

22:35

and then we are going to divide it into

22:37

two equal halves as

22:38

l0 and r0 so

22:43

we have finished the phase 2 2 that is

22:45

taking a message block of 64 bits

22:48

and then applying the permutation that

22:50

is using ip1 table

22:52

applying the permutation and dividing

22:54

that into two equal halves of 32 bits

22:57

each

22:57

so this is a phase two which we have

23:00

finished right now

23:03

we've already finished understanding

23:04

phase one generation of sub keys this is

23:07

also done

23:09

and now we have to move on to the very

23:11

important phase that is

23:12

understanding the algorithm behind each

23:15

of these rounds

23:16

as i told you if you understand for

23:18

round one the same concept applies for

23:20

all the rounds

23:21

only thing is the output of a round is

23:23

given as input to the

23:24

next round

23:30

so let's take a look at all that 16

23:32

rounds we'll first understand what

23:34

happens in

23:35

round one the input to round one is

23:39

these two 32 bits

23:42

that we have achieved in phase one that

23:44

will be the input to round one

23:46

we'll go and see what happens in round

23:48

one first

23:49

so in round one this will be our input

23:51

l0 and all zero

23:53

each of 32 bits right

23:56

so this will be our input and in every

23:59

round

24:00

we are going to calculate this this is

24:03

the core algorithm behind every round

24:06

what it says ln is equal to rn minus 1

24:11

where n is the round number and rn is

24:14

equal to

24:14

ln minus 1 xor a function

24:18

which takes r n minus 1 comma k n

24:21

where k is the key

24:25

so our round is 1 so n will be 1

24:28

what we'll do is we'll go and substitute

24:31

the value for

24:32

n to be 1 in this equation

24:37

let me take an eraser it is this

24:43

so when n is equal to 1 what will happen

24:46

l 1 is equal to

24:47

r 1 minus 1 and r 1 is equal to l 1

24:51

minus 1

24:51

plus f and then this function will have

24:55

r 1 minus 1 comma k

24:56

1 so n is 1 here that's what we have

24:59

done

25:00

so this will lead to l1 is equal to r0

25:03

and r1 is equal to l0 plus f

25:06

the function will take r0 and k1

25:10

we have all the data here right we know

25:12

what is r0 r0

25:14

is the input from our previous phase

25:17

so r0 is here we know what is l0

25:20

the l0 is also here and

25:24

we should learn what this function is

25:26

what is the output of this function we

25:27

should compute this function we will be

25:29

learning

25:29

that in the coming slides we know what

25:32

is r0 r0 is already given

25:34

what is this k1 k1 is nothing but the

25:37

sub

25:38

key 1 which is 48 bits we have already

25:40

computed that do you do you remember all

25:42

the sub keys we have computed

25:44

the 16 sub keys each 48 bits right

25:48

so we are going to take k1 from there

25:51

and

25:51

we are going to use k1 here so we have

25:54

data to compute

25:55

l1 and r1 the only thing is we should

25:59

understand

26:00

what this function does what is the

26:02

output of this function

26:03

if we get the output we can go and xor

26:05

it with l0

26:06

and then we'll also have l1 and r1 so

26:09

this will be the

26:11

output what is l1 and r1 this will be

26:13

the output of

26:15

round one so output of round one will be

26:18

l1 and r1 this will be going to the next

26:21

round as an input

26:22

so this is also the input for round two

26:27

so input for round two will be l one and

26:30

r one

26:30

and round two will go and produce l2 and

26:32

r2

26:33

and round three will go and produce the

26:35

output l3 and r3

26:37

like that we'll traverse through all

26:38

these 16 rounds to finally get

26:40

l16 and r16

26:43

so before going in for the output l1 and

26:46

r1

26:47

we should know what this function does

26:49

that will be our

26:50

discussion in the next slide and

26:53

substituting for n is equal to 1 so we

26:55

have achieved what is k1 already that is

26:57

the sub key 1

26:58

we know what is l1 that is equal to r0

27:02

so r0 is given and what is r1

27:06

this is what we have to compute we know

27:07

what is l0 it's already there

27:09

whereas this function takes r0 which we

27:12

know

27:13

but k1 also we know but what this

27:15

function

27:16

does with r0 and k1 that we have to

27:18

analyze and understand

27:20

that will be our next slides concept

27:23

understanding

27:25

what is this function and how it works

27:27

in round one

27:28

with the input as r0 and k1

27:32

the very first step is we'll take r0

27:35

this is 32 bits in length actually

27:39

right and we have to expand this we will

27:42

expand this

27:43

to 48 bits in length how will we expand

27:47

this we'll be

27:48

padding some bits to this and we'll be

27:50

expanding it to 48 bits

27:52

for that we'll be using the help of this

27:55

table called

27:56

e-bits selection table this table

27:59

works in the same way that we have

28:01

understood all the

28:03

pc1 pc2 tables so what it says is

28:06

go to the 30 second bit in r0

28:09

and make it the first bit in your output

28:12

so what is the 30 second bit

28:13

zero so that will be our first

28:17

bit in our output likewise go to the

28:19

first bit in

28:20

r0 what is the first bit that is one

28:23

make it the

28:24

second bit in your output so like that

28:27

you are going to use this ebit selection

28:29

table and how many digits you have in

28:30

the selection table you see one two

28:32

three

28:33

four five six seven eight so we have

28:35

eight

28:36

numbers in one column like that you have

28:40

six columns so six into eight you're

28:42

going to get

28:43

48 bits in the output so this

28:47

output is given here

28:50

so how many bits here 48 bits

28:55

so let me erase that

28:59

in here

29:03

and this output is represented as ef r0

29:08

so you have taken r0 expanded it from 32

29:11

bits to 48 bits

29:12

and we have rearranged the bits using

29:14

this ebit selection table

29:16

and then the output is represented as e

29:18

of r0

29:19

this is the output we achieved we are

29:22

not yet done with the function

29:24

let's go to the next step in this

29:26

function

29:27

so we have computed a of r0 we know what

29:30

is e of r0 from a previous slide

29:33

next what we are going to do is we are

29:34

going to take this key

29:36

k1 and then we are going to perform an

29:39

xr

29:39

with e of r0 so

29:42

we know what is key k1 this is a sub key

29:45

which is 48 bits in length so we will

29:48

take this key

29:49

this plus symbol means we will do an xor

29:51

operation

29:52

on this result that we have achieved in

29:55

the previous slide

29:57

so that will be nothing but k1 when

30:01

xor with e of r0 this is the

30:04

result so the xor operation result is

30:07

given here

30:09

and we can take a look at this result as

30:12

48 bits

30:13

this is totally 48 bits in length or we

30:16

can say

30:17

it's eight group of six bits

30:20

so we have six bits in one group six

30:23

bits in one group

30:24

like that we have eight groups

30:27

so totally we have 48 bits

30:32

so we are still in the computation of

30:34

the output of this function

30:35

and from a previous slide we we have

30:38

taken the key we have performed an xr

30:40

with

30:40

er0 we have attained this result

30:43

i told you we had eight groups

30:47

each with six bits in length with a

30:49

purpose so let me say that

30:51

each group of six bits i will call that

30:54

as b1

30:55

so this six bits as b2

30:58

six bits here as b3 like that so we take

31:02

every group of six bits we say that is

31:04

b1 b2 b3 b4

31:06

and b5 b6 b7 b8

31:09

so with these six bits we are going to

31:11

do a very weird thing

31:13

we are going to use them as addresses in

31:15

tables called

31:17

s boxes and we are going to calculate

31:21

s1 b1 s2 b2 s3 b3

31:24

so we are going to see how to calculate

31:27

everything here s1 b1

31:28

s2 b2 s3 b3 to compute s1b1

31:32

we'll be using b1 what is b1

31:36

the 6 bits that is represented here

31:39

to compute s4 b4 we'll be using b4

31:43

but what is b4 the group of six bits

31:46

here

31:48

okay now let's understand how to compute

31:51

s1 b1

31:52

first and then we'll go to the other

31:54

computations

31:55

so we'll see how to compute this s1 b1

31:58

for

32:01

we know what is b1 what is b1 the six

32:04

bits here

32:05

that is represented here to compute s1

32:08

of b1

32:08

we have to use this s box here so since

32:12

it's s1

32:13

this box i am going to take and we are

32:16

going to compute

32:17

s1 of b1 its a weird strategy let me

32:21

tell you what is what it is

32:23

you take this bit the starting bit and

32:26

the ending bit

32:27

you write it what is this 0 0

32:30

0 0 is nothing but 0 so we go to

32:34

row number 0 here so you take the first

32:37

bit and the last bit

32:38

you determine the row in the s box so

32:41

that is row number zero

32:43

and you take the other bits in between

32:46

so what are the other bits in between it

32:47

is 1

32:48

1 0 0 this is nothing but

32:52

12 so you take this 12 and go to the

32:55

corresponding

32:56

column number so what is the column

32:58

number 12 here

32:59

the column number is 12 and the row

33:01

number is 0

33:02

what is the value you get 5 and you

33:05

represent 5 in 4 bits

33:07

0 1 0 1 so this is

33:11

actually s1 of

33:14

b1 so we have taken

33:17

these six bits b1 we have used that in

33:20

s1 what is s1 of b1 you compute that

33:24

using this s box and it's a weird

33:27

computation you

33:28

you take the six bits in b1 the first

33:31

bit and the last bit

33:33

together you find the value that value

33:35

will give you the

33:36

row number in the s box so the row

33:39

number here is

33:40

0 and likewise you take the remaining

33:43

bits

33:44

that are in between so it is 1 1 0 0

33:47

you compute the decimal value that is 8

33:50

4 2 1 right so this is 12 so 12

33:53

is nothing but the column so the column

33:56

number is 12

33:57

row number is 0 so you get 5 and

34:00

5 how it is represented in binary it is

34:03

0

34:04

1 0 1 so that is the value of s1 b1

34:09

so that's what i have given here

34:22

the value of s 1 p 1 is 0 1 0 1

34:26

that is nothing but 5 in decimal so we

34:29

finish

34:29

computing s 1 b 1 like that we should

34:32

compute s 2 b 2 b2 s3 b3

34:34

up till s8 b8 and for

34:37

each computation when i take s2 there is

34:40

a separate

34:41

sbox table called s2 for s3 we have a

34:44

separate

34:45

s box table called s3 and we know what

34:47

is b1 b2 b3

34:49

from the result here so we should go

34:51

ahead and compute

34:53

all these things little tedious

34:56

computation

34:57

but the process is very simple and keep

35:00

in mind we are still

35:01

computing the output of this function

35:03

that takes r0

35:04

and k1 as input so we finish computing

35:08

s1 b1

35:09

let us go and compute s2 b2 let's take

35:11

some practice

35:13

so s2 b2 what is b2 here the six

35:17

bits from the input

35:20

so this is b2 and to compute s2 of

35:24

b2 we need this s table or s

35:27

box s2 take the first digit

35:31

and then the last digit so it is 0 1 so

35:34

row number is nothing but

35:35

1 so we're going to go to row number 1.

35:38

so row number here

35:39

is 0 1 2 3 so we're going to go to row

35:42

number one

35:43

you take the remaining bits here what

35:45

are those remaining bits is nothing but

35:47

one zero

35:48

zero zero so this is nothing but

35:51

column number so the column number here

35:54

is eight

35:55

since we have one year so we're going to

35:57

go to column number eight so it's

35:59

column numbers we'll just write it out

36:01

zero one two

36:02

three four five six

36:06

seven and eight so it is row number one

36:09

and column number eight

36:10

so the value is 12

36:14

okay so the output of

36:17

s2 b2 is nothing but 12 12

36:20

is represented as 1 1 0 0 that is the

36:24

output so finish computing s1 b1 we

36:28

finish computing

36:29

s2 p2 is that clear

36:33

take the first bit last bit compute the

36:36

row number

36:37

take the remaining bits compute the

36:39

column number

36:41

take the row number column number find a

36:43

match in the s2

36:45

box and then you represent that value

36:48

say if you get 12 you represent that in

36:50

binary so that becomes your s2 b2

36:55

likewise we should continue with s3 b3

37:00

i know you guys are tired but let's take

37:03

another

37:03

thing s3 b3 let's understand that

37:07

b3 is nothing but these six bits

37:12

and i have given b3 here to compute s3

37:16

b3 we need

37:17

this s box s3

37:22

and how will you compute you have to

37:24

take the first bit and the last bit

37:26

that becomes the row number row number

37:28

is 0 so here row numbers are 0

37:31

1 2 3 so we are going to go to row

37:33

number 0

37:34

we take the remaining bits here what are

37:37

the remaining bits

37:38

so it is 1 1 1 1 that's nothing but

37:42

50 so you have to go to column number 15

37:46

so it's 0 1 2 3 i'm just giving the

37:49

column numbers here

37:50

5 6 7 8 9

37:54

10 11 12 13

37:58

14 15 so we have 15 columns so you go to

38:01

the 15th column

38:02

row number zero it is eight so you

38:05

represent eight in binary one

38:06

zero zero so that is the value of s3 b3

38:11

got it like that

38:15

you should continue with b4 b4 can you

38:18

try

38:20

1 and 0 so what is the row number here

38:24

4 number is 2 so you can 0 1 2 so we are

38:27

in row number 2.

38:29

you take the remaining digits what is

38:31

that 1

38:32

1 0 1

38:35

so what is this this is column number 13

38:38

so

38:39

this is column number 13 and row number

38:42

2

38:42

so the value is 2 how we represent 2 in

38:46

binary 0 0 1 0 so what is the value of

38:50

s 4 b 4 0 0 1

38:53

0 so you should not have any confusion

38:56

on how you

38:57

use the s box and compute s1

39:00

p1 to s8 b8 so i'm not going to go

39:03

through the other things it's just given

39:05

here

39:05

s5 b5 is computed like this s6 b6 is

39:08

computed

39:09

so for each one we are going to have a

39:10

separate s box table

39:12

s7 b7 will use s7 table so like that we

39:16

compute

39:16

s8 s8 is nothing but 0 1 1

39:20

so we have finished computing all these

39:22

values s1 b1 s2 b2

39:24

s3 b3 s4 b4 s5 b5 up till

39:28

s8 p8 so for each

39:32

calculation we add four bits so finally

39:36

when we write all the values the result

39:38

together

39:39

for s1 b1 till s8 b8 this is what we are

39:42

going to

39:43

achieve

39:47

there is one final stage before we get

39:49

the output of this function please

39:50

remember we are still working on the

39:52

output of this function

39:53

that is we will be taking this result

39:56

right we have just now computed using

39:58

the s boxes eight s boxes we have used

40:01

and we'll be applying a permutation for

40:03

permutation as usual we'll use a

40:05

table so this table will help us in

40:08

rearranging the bits

40:12

how it happens is you go to the 16th bit

40:15

so

40:16

this is the 16th bit make it the first

40:19

bit in your output

40:20

go to the seventh bit so this is the

40:23

seventh bit make it the second

40:25

bit in your output like that go to the

40:27

20th bit

40:28

so which is the 20th bit here this will

40:31

be the 20th

40:33

bit you make it the third

40:36

bit in your output so you use this

40:38

permutation table

40:39

and you get your output that is given

40:41

here so this is the output of this

40:44

function

40:44

that you have been computing so far so

40:47

finally we have obtained the output of

40:49

the

40:49

function what is that this is and

40:52

this is how many bits in length 32 bits

40:56

okay

41:01

so do you remember why we were computing

41:04

this function

41:05

do you remember that initial equation

41:09

where we have used this function do you

41:11

remember that so we got l0

41:13

r0 from phase one right the output to

41:17

our round one this was the out

41:19

this was the output from phase one which

41:21

is an input to a round one

41:23

and we use this formula you remember

41:26

this right

41:28

and in this formula when it is round one

41:30

we used

41:31

l1 r1 we computed l1 is equal to

41:35

r0 and r1 is equal to l0

41:39

plus this one and in the past three or

41:42

four slides previous slides we're

41:43

working on the output of this

41:46

and we have attained the output of this

41:48

right we know what is the output of this

41:50

we know what is l0 l0 from phase 1 input

41:53

we know what is that

41:54

and we know what is r0 r0 is also given

41:58

and since we now know the output of

42:00

everything we can go and compute

42:03

r1 r1 is nothing but you take l0

42:07

which is coming as input and you perform

42:09

an xr

42:10

with the computation of the value from

42:13

this function

42:14

the value this particular value we have

42:16

already computed

42:19

so we have computed the value of the

42:21

output of this function in round one

42:23

and we know what is the input to round

42:25

one so using this

42:27

we are going to find r1 r1 is nothing

42:30

but l0

42:31

and xr with the output of the function

42:33

we have computed

42:34

using the s boxes

42:38

so when you perform an xr of l0

42:41

with this output of the function

42:45

that is r0 comma k1

42:48

so both the 32 bits you're going to get

42:51

r1

42:52

r1 which is also 32 bits

42:55

so finally we have attained r1

42:58

and l1 so r1 and l1

43:01

is nothing but these two things are

43:05

output for round one

43:10

and this will be given as an input for

43:13

round two

43:18

let's go to our block diagram we'll

43:20

understand so

43:21

out of the permutation and division our

43:24

output was l0

43:25

or zero we have split that message after

43:28

permutation we are giving that

43:30

as an input to round one here in round

43:32

one we have obtained

43:34

computed l1 and r1 so this is

43:37

going as an input to round two again in

43:40

round two we'll

43:41

perform the computation using the

43:43

formula the algorithm is the same

43:45

and what we'll compute here is

43:48

what is l two and r two so round two

43:52

will give us the information on l2 and

43:54

r2 which will give us an input to round

43:56

three

43:57

what will round three fetches round

43:59

three will compute as

44:00

l3 and r3 like that we'll be traversing

44:04

many

44:04

rounds how many rounds we have here 16

44:07

rounds for

44:08

each round we will use the keys

44:11

say k12 k16 that we have generated

44:15

each key is of 48 bits so we'll be

44:18

propagating through the rounds

44:20

so finally what will be

44:23

the output of round 16 it will be l 16

44:26

and

44:27

r 16.

44:33

so we finished round one we know what is

44:35

l1 and

44:36

r1 right can we compute l2 and r2

44:41

can you start round two so this is l1

44:44

and r1 from round one

44:46

we have computed that how will you

44:47

compute l2 and r2

44:50

so you have this formula this is the

44:53

algorithm behind every round

44:55

so we substitute n is equal to 2

44:58

for round 2 so it is l2 is equal to r2

45:01

minus 1

45:02

and r2 is equal to l2 minus 1 plus

45:05

this function this is nothing but

45:08

r 2 minus 1 comma k2

45:13

so when you reduce it it'll be l2 is

45:15

equal to r1

45:16

we know what is r1 so we know what is l2

45:20

what is r2 this is nothing but l1 l1 is

45:23

also known

45:24

plus you have to compute the value of

45:26

this function which uses r1

45:28

and k2 k2 is nothing but the key2

45:32

you remember we generated 16 sub keys

45:35

right in this

45:36

k2 is the sub key which is 48 bits in

45:39

length

45:40

so that is k2 here

45:43

so we know everything we can substitute

45:45

we know what is k2

45:46

we know what is l2 that is nothing but

45:49

r1

45:50

we have to compute r2 so once when you

45:52

know l2 and r2 we can

45:54

be ready with the output of

45:57

round 2.

46:01

so l one plus the function

46:04

r one comma k two so this function uses

46:07

those eight eight

46:08

eight s boxes and it comes out with the

46:10

value finally

46:12

so like that you compute l2

46:15

and r2 i know it's a very tedious

46:19

process we're not going to again status

46:20

it's it's just the same process that we

46:23

did in round one

46:24

but will be it will be leading us to an

46:26

output of l2 and r2 after round two

46:29

so after 16 rounds what we are going to

46:32

have here

46:32

after 16 rounds what will be the output

46:35

here

46:36

l16 and r16 the algorithm is the same

46:39

only the input gets propagated

46:41

and finally this will be going to our

46:43

phase four

46:44

this is the phase final phase which

46:46

leads us to the

46:48

cipher text let's go to phase four

46:51

say after 16 hectic rounds

46:55

we have attained l16 and r16

46:59

now what we are going to do is we are

47:01

going to give it to the final

47:02

permutation so how we achieve this final

47:04

permutation is we will use this ip

47:06

inverse table

47:07

and this table will in turn

47:10

take in our l16 and r16

47:14

which is of each 32 bits

47:18

right and what we are going to do is

47:21

l16 is the left side and r16

47:24

is the 32 bits on the right side so we

47:26

have 32 bits here 32 bits here

47:28

we will just interchange them we will

47:31

make it as r16

47:32

l16 so that interchange

47:35

happens here so r comes first first 32

47:38

bits will be of

47:39

r and the next 32 bits will be of l16

47:43

once when you have achieved this we have

47:45

to apply the permutation which is

47:47

nothing but

47:48

rearranging the bits in this

47:53

rearranging the bits here r16

47:56

l16 bits will be rearranged so it says

47:59

go to the 48

48:00

40th bit in this r16 l16 make it the

48:04

first bit

48:05

go to the eighth bit so what is the

48:07

eighth bit here four

48:08

plus four eighth bit make it the second

48:10

bit in our output

48:12

this consists of eight numbers in one

48:14

column and eight columns so our

48:16

final output will be 64 bits so this is

48:20

nothing but

48:21

a rearrangement or permutation of r

48:24

16 l 16

48:27

and this can be represented in

48:30

xr decimal convert say

48:34

four digits will be mapped to an

48:35

hexadecimal output right so this is

48:39

eight first four digits is eight the

48:41

next four digits is nothing but

48:44

five so like that you transform that to

48:47

hexadecimal

48:48

and that is called your cipher text

48:51

finally

48:52

successfully we have achieved our cipher

48:55

text

49:00

so what we have encrypted here we have

49:03

taken

49:03

64 bits that is one block of message

49:07

and we have converted that to ciphertext

49:10

using

49:10

16 rounds and all that permutations and

49:13

divisions

49:14

and we have used 16 sub keys each of 48

49:19

bits in lab

49:20

so to we have just used one block that

49:22

is the first block message jam we have

49:24

attend our cipher text like that we have

49:27

many blocks right we are dm

49:29

vrdm1 so message can have many 64-bit

49:32

blocks

49:33

so we'll make every block go through the

49:35

same encryption process

49:36

and then we'll be getting ciphertext one

49:38

ciphertext2 ciphertext3

49:40

so whatever we have achieved here you

49:42

can you can consider this to be

49:44

cipher text one for plain text block one

49:48

so like that we have to encrypt we have

49:50

to carry out this process

49:52

for all the message blocks and we have

49:54

to send the data

49:58

such an encryption will should actually

50:01

make the hacker feel

50:03

very pathetic what on hell is that

50:05

message no matter what i try i'm not

50:07

able to decrypt it

50:09

you may think after all these rounds

50:11

this is how the hacker should feel

50:13

but let us take a look at the truth the

50:16

truth is

50:17

data encryption standard is insecure

50:20

and they say it's insecure because of

50:22

its relatively short

50:24

56-bit key size so we are taking 64 bits

50:27

initially and then we are applying the

50:29

permutation and reducing it to 56

50:31

bits so because of this short key size

50:34

they say it's insecure

50:37

and in january 1999 they were able to

50:39

publicly break a des

50:41

key in 22 hours and 15 minutes

50:45

so the cipher now is considered insecure

50:49

and it has been superseded we have a new

50:51

cipher this is the advanced

50:53

encryption standard aes which you will

50:55

be learning in our next class

50:57

and des has been withdrawn as a standard

51:00

by the national institute of standards

51:02

and

51:02

technology so even after learning all

51:05

these rounds and things like that you're

51:07

really unhappy to know that des is

51:09

insecure

51:10

so finally the hackers were able to

51:13

crack it

51:17

with this let me end this session and

51:19

we'll be learning

51:21

far better encryption strategy the

51:22

advanced encryption strategy

51:24

in our next class i hope you are able to

51:27

follow

51:28

the strenuous process on how a plain

51:30

text block is encoded as a type of text

51:33

in data encryption standard

51:37

thank you all

UNLOCK MORE

Sign up free to access premium features

INTERACTIVE VIEWER

Watch the video with synced subtitles, adjustable overlay, and full playback control.

SIGN UP FREE TO UNLOCK

AI SUMMARY

Get an instant AI-generated summary of the video content, key points, and takeaways.

SIGN UP FREE TO UNLOCK

TRANSLATE

Translate the transcript to 100+ languages with one click. Download in any format.

SIGN UP FREE TO UNLOCK

MIND MAP

Visualize the transcript as an interactive mind map. Understand structure at a glance.

SIGN UP FREE TO UNLOCK

CHAT WITH TRANSCRIPT

Ask questions about the video content. Get answers powered by AI directly from the transcript.

SIGN UP FREE TO UNLOCK

GET MORE FROM YOUR TRANSCRIPTS

Sign up for free and unlock interactive viewer, AI summaries, translations, mind maps, and more. No credit card required.