Data Encryption Standard (DES) - Explained with an Example - Cryptography - CyberSecurity - CSE4003
FULL TRANSCRIPT
today we are going to have a very
interesting session
we are going to learn about data
encryption standard des
before going into des let us take a look
at our
previous class concepts in our previous
class we are looking at
block cipher do you remember what is a
block cipher
the key concept in a block cipher is
whenever you have a message
that should be sent this message is
divided
into equal sized blocks so
these blocks can be of 64 bits 128 bits
or 256
bits so message gets split
into blocks and
these blocks are then given to an
encryption strategy wherein we convert
the plain text to a
cipher text so we were looking at so
many different modes of block ciphers in
our last class
this is one of the modes called
electronic code book and we looked at
another mode called the cipher
block chaining wherein we take the plain
text of 64 bits and then we
have an initialization vector of 64 bits
we perform an
xr and we feed this to an encryption
strategy
so in all the modes we are talking about
some encryption and decryption
algorithms or strategies so what is this
encryption strategy
today we are going to learn one of the
block cipher encryption strategies that
is
d e s nothing but data
encryption standard
so what is this data encryption standard
it's an encryption algorithm
that was put forward in the 1970s it was
developed in the early 1970s by
ibm and it was published as an official
information processing standard in 1976.
so let's go and take a look at what is
des
first we will take a look at the block
diagram of
des and overview of this algorithm
using a block diagram so i have taken
some time to construct this block
diagram
so let us understand this
we have messages coming in which are
divided into blocks when you talk about
block cipher
d e s is a block cipher therefore we
have messages divided into
blocks each block is of 64 bits
so this is the message that we want to
encrypt
so we'll take every block and then we
run it through our encryption algorithm
to finally get the
cipher text when you take a look at this
block diagram we have some important
phases in this diagram the very first
thing is we'll be using a key
for encryption we need a key and that
key size is 64 bit
which will be fed to the key generator
and this key generator will be
rearranging the bits in the key
and then it will generate sub keys and
this will lead to
16 sub keys you see here we are going to
generate 16 sub keys
and each sub key will be of 48 bits in
length so we'll take a 64 bit key
we'll do some permutations and we'll
reduce it to 56
from this 56 we'll employ a strategy
from which we'll be getting 16 sub keys
i will say
these are sub keys 16 sub keys
each of length 48 bits
so that is one part so once when the
keys are ready the next thing is we'll
be taking in the message
we'll be understanding what is
permutation and division of the
block of message that you are taking in
so this this is another step
once when this is done the output of
this block is given to
a block by name round so you can see
here we have almost
16 rounds
all these rounds perform the same action
but with different input and one good
thing is
all the rounds perform the same action
the only thing is
the output of one of the round will be
the input of the
next round so the output of this round
will be the input of this round
otherwise the concept behind all these
rounds is the same
only thing is the output from each round
is given to the next round
and the output just propagates like that
we complete 16 rounds
finally we'll perform some final
permutations
and then we'll be giving the ciphertext
out
so that is the overall very higher level
view of what data encryption standard
is all about we learn this algorithm
in three parts the first part
we'll take a look at this we'll take a
key
and we'll see how we are going to
generate
16 sub keys how to generate 16 sub
keys from this 64-bit key which is taken
as an
input that will be our say we'll call
that to be the first
phase of a learning after this
we'll take a block of message a 64-bit
block of message we will see
how that block is given to a permutation
and division module and what kind of
permutation happens for this block of
message
we'll understand this this can be our
phase two of the learning
so permutation is nothing but
rearranging the bits in the
blocks we'll understand how that
rearrangement really happens and what is
dividing or what is the division of bits
into
separate blocks we'll understand this in
phase two
and in phase three we'll go and
understand what is the algorithm behind
each and every round so we'll understand
what is this round what really works
behind these rounds
so once when you understand it for round
one the same concept applies for
all the 16 rounds only thing is the
output from one of the rounds will be
given as an
input to the another round so that will
be your phase
three of the learning
so once when that is done finally the
output of the
final round will be given to final
permutation right
and this will lead to a cipher text so
we will consider this to be the
phase four of our learning so we'll
understand this algorithm in
four phases first we'll see how to
generate sub keys
next we will see how to take a block of
message and how to
perform permutation and division and
then give that as an input to the round
and we'll understand the algorithm
behind around
and that algorithm is applicable for all
the rounds and we'll see how we generate
the final output from the final round
and in the last phase we'll understand
how to take this output
and perform some final permutation and
generate the
ciphertext that is the overall view
we will now start with phase one
generating sub keys
so however algorithm starts this
we have a key in exa decimal so this is
the input key
and you can very well see here we have
16 digits
of hexadecimal character here so this
leads to
a 64-bit key
so this is the 64-bit key we are going
to use
in our algorithm so the very first step
in generating sub keys is
we are going to take the key and then we
are going to apply some permutation
permutation is nothing but
rearranging the bits in this key and
also reducing the
number of bits we are going to reduce it
from 64 to 56 bits
that will be the first step and for that
we will be utilizing a
pc one table that table i have given
here
so how we are going to utilize this
table is
we will take go to the very first number
which is 57 so we have to go to the 57th
bit in this key the 57th bit is
here so this 57th bit will become the
first bit in our output
likewise we take go to the 49th bit
49th bit is here this will become our
second bit in the output like that it
travels
all the bits and then we create our
output
so i have given the output here so this
is the output that is created
by traversing all the bits and applying
it on this particular key
we'll get the output as k plus so the
number of bits in the output
is actually equal to the number of
digits in this table
so how many digits we have in
every column you see here one two three
four five
six seven eight so we have eight digits
in the column
likewise how many uh columns we have one
two three
four five six seven so seven into eight
we are going to have 56 digits in our
output
so we add 64 bits here and this 64 bits
by using this pc one table
we were able to arrive at 56 bits of key
and we have also reordered the bits in
this particular
key so that is the very first step in
generating
sub keys i hope you are able to follow
me
let us go to the next step
the next step is we are going to take
this 56 bit
key that we have attained by using pc1
table
from the previous slide and then we are
going to split this as
two halves each half having 28 bits
so we will take k plus and split it like
this that is c0
and d0 the first 28 bits
will be c0 and the next 28 bits will be
d0 we know that the size of this key is
56 bits so we are just dividing that
into two equal halves
very simple and clear
the next step is we'll take the c0 and
d0 which we obtained from the previous
slide
and we'll be using a table containing
schedule of left shifts so we'll be
using this table
in going forward with our output i tell
you how to use this table
so we'll go to iteration number one and
it says
number of left shifts is one so we'll be
applying
a circular left shift by one on this
particular
input and what will happen when you
apply a circular lift shift of one bit
this one will be pushed to the end
and all the other bits will be moved
forward
by one position because we say number of
lift shift should be one it's a circular
left shift
so that happens likewise when you do a
circular left shift for b
zero by one bit we're going to push this
zero at the end
and zero will be coming here and we push
all the bits
one position to the left so
we take c zero d zero and we go to
iteration number one we see number of
left shifts we have to do is one so we
we
do a circular left shift by one bit on c
zero and d0
the output we are going to get is c1 and
d1
so as a result of the left ship we have
received this output
now we go to iteration number 2 and we
see that we have to perform
one left ship
on this c1 and d1 so what we do is we
just push this one to the end
with a circular left shift by one digit
likewise we push this one
in d1 to the end so it's a circular left
shift by one digit
so we are going to use the schedule of
left shifts for our operations here
so once when you perform that we'll be
getting c2 and d2
c2 and d2 is nothing but the output of
that
because of the left shift we have
received this output
now we will go to iteration three
and we'll apply the number of left
shifts now it says number of left shift
should be
two so what does that mean you're going
to take
two digits from this place and then
we're going to push it to the
end and we're going to push all the
remaining
two digits to the left by
2. likewise you're going to apply that
to d22
so we are going to take two digits and
move it to the
end and we will push all the digits to
the
left so as a result of this we will be
getting
c3 d3 so for c3 d3 what you're going to
do you're going to go to the next uh
number here that is iteration number
four
and then what hominish number should be
shifted
if shifted it should be by two so again
we are going to do this we are going to
take these two zeros
push it here and then push all the
remaining digits
to the left likewise take these two
digits
push it at the end and then push all the
digis to the left
so as a result of iteration number four
on c3 d3
the output will be c4 d4 you can see
these two zeros here and zero one here
likewise you have to continue the
process till we go and reach
iteration number 16 so that we achieve
c16 and
day 16. quite hectic but the process is
very simple and
repetitive let us go with iteration
number five
we have to do a left shift by two
numbers or two digits
so you just push this zero zero here and
it goes to the end
you push zero one to the end it goes to
the end so
because of iteration number five applied
on c4 d4 we are going to get
c5 d5 next we have to take
iteration number six it says do a left
shift by two bits
so again to get c6 d6 you have to push
this to the end
and you have to push this to the end
that's it
so like this you have to continue your
hydrations till you reach iteration
number 16
and corresponding to the iterations you
have to perform
lift shifts as given here number of left
shifts
so i hope you have understood this like
this we carry on for 16
iterations and we'll be getting c6 d6 c7
d7
c8 d8 c9 d9 c10 d10
c11 d11 c12 d12 c13
d13 c14 d14 c15 d15
and c16 d16 so how did we achieve
all these things it's very simple
you just go through so many different
iterations on c0d0 which we are
attained from the key and then you do
the number of left shifts as i have told
you
this will lead you to this result
after this what we are going to do is we
are going to take
c1 d1 we have achieved from a previous
slide right we take c1 d1
we will combine that so this is nothing
but c1 d1
after combining this we are going to
rearrange the bits in this
for this we are going to use a
permutation table as usual
so this permutation table is called pc2
and this will help us in rearranging the
pitch here
so after applying pc2 the number of bits
here
will be reduced to 48 and also the order
of the bits will be
rearranged let's see how to use pc2
it's very similar like what you have
done in the initial slide by using pc1
so it says go to the 14th bit in your
input so what is the 14th bit here that
is 0
and make it the first bit in your output
likewise go to the 17th bit so 17th bit
is here
make it the second number in your output
likewise go to the 11th bit
so 11th bit is here so
you make it the third number in your
output so like that you traverse the
entire
chart you'll be you'll be getting how
many digits out
48 bits out why i say you'll get 48 bits
because you see here
one two three four five six seven eight
eight elements we have in one column
like that how many columns we have
six columns so eight into six is 48
so after you apply pc2 on c1 d1
you'll be getting an output like this
this is key one
so after applying pc2 on c1 d1 your
output will be
key k1 and what is the length of this
key
48 bits and this is the
first sub key
the block diagram we have seen 16 sub
keys should be generated each of
length 48 bits so we have attained our
first
sub key like that we have to find all
the sub keys so we know
c2 d2 we can take c2 d2
and what is the next step we have to
combine them and once we
have combined we have to use our pc2
table and this pc2 table will reduce
this 56 bits to 48 bits and it will also
rearrange the bits here
so let's go and see how to do that so go
to
the 14th bit so you go to the 14th bit
here
and you make it the first bit out
in your output likewise go to the 17th
bit
make it the first bit in your output
like that you build the output using
this table
and this table has got 48 numbers so
your output will also be 48 digits
so this is the output we have seen so we
get
key2 that is sub key2 which is 48 bits
so this is our sub key2
and for this we have used our input as
c2 d2
like that we can go and generate for c3
d3 we can take
and we can apply pc2 and c3 d3 and we
can get
k3 like that we have to continue for all
the 16 sub keys we are going to generate
so that
will finally lead us to all these 16
sub keys so all these 16 sub keys are of
length
48 bits so that's how you generate
sub keys and taking a look back at our
block diagram we have finished learning
the phase
one
now we know how to take a 64 bit key
apply some permutation
using pc1 then divide it into two blocks
so pc1 reduces that to 56 bits we divide
it into two blocks as c0 d0
each of 28 bits then we use the
iterations and we apply these 16
hydrations and we apply so many left
ships
so that we get c1 d1 c2 d2 and from that
we will use pc2
to reduce all those c1s c naught d
naught and c
one d one c two d two right so we will
reduce that c and d
and two k and keys and the pc2 helps us
in reducing the number from
56 to 48 bits and we will get all our 16
sub keys
each of length 48 bits
so our phase one is done i hope you are
all clear with
how to generate 16 sub keys now let us
go to
phase 2 what i told this phase 2 we will
take one block of message which is 64
bits
we will then apply permutation on that
block of bits
and we'll also divide those block of
bits that will be our
phase two so we'll now learn this face
we'll be working with the input message
so now let us take the message so this
is the message block
it is of 64 bits in length
and we have to achieve some permutation
on this what is permutation just
rearranging the bit cr for that we'll be
using
the initial permutation table the ip
table which is given here
what this table does is it's the same
thing go to the first number
it says go to the 58th bit and make it
the first bit in your
output so what is the 58 with 58th bit
here
this is the 58th bit and you're going to
make the
output bit 1 to be the 58th bit
likewise what is the next number 50th
bit
what is the 50th bit here
so this is the 50th bit we're going to
make that
as bit number two in our output
so like that you're going to use the
numbers here take the bits corresponding
to those numbers
and move it to our output so we will be
getting an output like this
okay this we have achieved by using our
initial
permutation
the next step will be taking this and
we'll be dividing this into
two halves each half will have 32 bits
the entire size of this is 64 bits so
we'll be dividing that as
l0 which is of 32 bits
and then r0 which is of 32 bits
so we take the permitted output from the
previous slide
and then we are going to divide it into
two equal halves as
l0 and r0 so
we have finished the phase 2 2 that is
taking a message block of 64 bits
and then applying the permutation that
is using ip1 table
applying the permutation and dividing
that into two equal halves of 32 bits
each
so this is a phase two which we have
finished right now
we've already finished understanding
phase one generation of sub keys this is
also done
and now we have to move on to the very
important phase that is
understanding the algorithm behind each
of these rounds
as i told you if you understand for
round one the same concept applies for
all the rounds
only thing is the output of a round is
given as input to the
next round
so let's take a look at all that 16
rounds we'll first understand what
happens in
round one the input to round one is
these two 32 bits
that we have achieved in phase one that
will be the input to round one
we'll go and see what happens in round
one first
so in round one this will be our input
l0 and all zero
each of 32 bits right
so this will be our input and in every
round
we are going to calculate this this is
the core algorithm behind every round
what it says ln is equal to rn minus 1
where n is the round number and rn is
equal to
ln minus 1 xor a function
which takes r n minus 1 comma k n
where k is the key
so our round is 1 so n will be 1
what we'll do is we'll go and substitute
the value for
n to be 1 in this equation
let me take an eraser it is this
so when n is equal to 1 what will happen
l 1 is equal to
r 1 minus 1 and r 1 is equal to l 1
minus 1
plus f and then this function will have
r 1 minus 1 comma k
1 so n is 1 here that's what we have
done
so this will lead to l1 is equal to r0
and r1 is equal to l0 plus f
the function will take r0 and k1
we have all the data here right we know
what is r0 r0
is the input from our previous phase
so r0 is here we know what is l0
the l0 is also here and
we should learn what this function is
what is the output of this function we
should compute this function we will be
learning
that in the coming slides we know what
is r0 r0 is already given
what is this k1 k1 is nothing but the
sub
key 1 which is 48 bits we have already
computed that do you do you remember all
the sub keys we have computed
the 16 sub keys each 48 bits right
so we are going to take k1 from there
and
we are going to use k1 here so we have
data to compute
l1 and r1 the only thing is we should
understand
what this function does what is the
output of this function
if we get the output we can go and xor
it with l0
and then we'll also have l1 and r1 so
this will be the
output what is l1 and r1 this will be
the output of
round one so output of round one will be
l1 and r1 this will be going to the next
round as an input
so this is also the input for round two
so input for round two will be l one and
r one
and round two will go and produce l2 and
r2
and round three will go and produce the
output l3 and r3
like that we'll traverse through all
these 16 rounds to finally get
l16 and r16
so before going in for the output l1 and
r1
we should know what this function does
that will be our
discussion in the next slide and
substituting for n is equal to 1 so we
have achieved what is k1 already that is
the sub key 1
we know what is l1 that is equal to r0
so r0 is given and what is r1
this is what we have to compute we know
what is l0 it's already there
whereas this function takes r0 which we
know
but k1 also we know but what this
function
does with r0 and k1 that we have to
analyze and understand
that will be our next slides concept
understanding
what is this function and how it works
in round one
with the input as r0 and k1
the very first step is we'll take r0
this is 32 bits in length actually
right and we have to expand this we will
expand this
to 48 bits in length how will we expand
this we'll be
padding some bits to this and we'll be
expanding it to 48 bits
for that we'll be using the help of this
table called
e-bits selection table this table
works in the same way that we have
understood all the
pc1 pc2 tables so what it says is
go to the 30 second bit in r0
and make it the first bit in your output
so what is the 30 second bit
zero so that will be our first
bit in our output likewise go to the
first bit in
r0 what is the first bit that is one
make it the
second bit in your output so like that
you are going to use this ebit selection
table and how many digits you have in
the selection table you see one two
three
four five six seven eight so we have
eight
numbers in one column like that you have
six columns so six into eight you're
going to get
48 bits in the output so this
output is given here
so how many bits here 48 bits
so let me erase that
in here
and this output is represented as ef r0
so you have taken r0 expanded it from 32
bits to 48 bits
and we have rearranged the bits using
this ebit selection table
and then the output is represented as e
of r0
this is the output we achieved we are
not yet done with the function
let's go to the next step in this
function
so we have computed a of r0 we know what
is e of r0 from a previous slide
next what we are going to do is we are
going to take this key
k1 and then we are going to perform an
xr
with e of r0 so
we know what is key k1 this is a sub key
which is 48 bits in length so we will
take this key
this plus symbol means we will do an xor
operation
on this result that we have achieved in
the previous slide
so that will be nothing but k1 when
xor with e of r0 this is the
result so the xor operation result is
given here
and we can take a look at this result as
48 bits
this is totally 48 bits in length or we
can say
it's eight group of six bits
so we have six bits in one group six
bits in one group
like that we have eight groups
so totally we have 48 bits
so we are still in the computation of
the output of this function
and from a previous slide we we have
taken the key we have performed an xr
with
er0 we have attained this result
i told you we had eight groups
each with six bits in length with a
purpose so let me say that
each group of six bits i will call that
as b1
so this six bits as b2
six bits here as b3 like that so we take
every group of six bits we say that is
b1 b2 b3 b4
and b5 b6 b7 b8
so with these six bits we are going to
do a very weird thing
we are going to use them as addresses in
tables called
s boxes and we are going to calculate
s1 b1 s2 b2 s3 b3
so we are going to see how to calculate
everything here s1 b1
s2 b2 s3 b3 to compute s1b1
we'll be using b1 what is b1
the 6 bits that is represented here
to compute s4 b4 we'll be using b4
but what is b4 the group of six bits
here
okay now let's understand how to compute
s1 b1
first and then we'll go to the other
computations
so we'll see how to compute this s1 b1
for
we know what is b1 what is b1 the six
bits here
that is represented here to compute s1
of b1
we have to use this s box here so since
it's s1
this box i am going to take and we are
going to compute
s1 of b1 its a weird strategy let me
tell you what is what it is
you take this bit the starting bit and
the ending bit
you write it what is this 0 0
0 0 is nothing but 0 so we go to
row number 0 here so you take the first
bit and the last bit
you determine the row in the s box so
that is row number zero
and you take the other bits in between
so what are the other bits in between it
is 1
1 0 0 this is nothing but
12 so you take this 12 and go to the
corresponding
column number so what is the column
number 12 here
the column number is 12 and the row
number is 0
what is the value you get 5 and you
represent 5 in 4 bits
0 1 0 1 so this is
actually s1 of
b1 so we have taken
these six bits b1 we have used that in
s1 what is s1 of b1 you compute that
using this s box and it's a weird
computation you
you take the six bits in b1 the first
bit and the last bit
together you find the value that value
will give you the
row number in the s box so the row
number here is
0 and likewise you take the remaining
bits
that are in between so it is 1 1 0 0
you compute the decimal value that is 8
4 2 1 right so this is 12 so 12
is nothing but the column so the column
number is 12
row number is 0 so you get 5 and
5 how it is represented in binary it is
0
1 0 1 so that is the value of s1 b1
so that's what i have given here
the value of s 1 p 1 is 0 1 0 1
that is nothing but 5 in decimal so we
finish
computing s 1 b 1 like that we should
compute s 2 b 2 b2 s3 b3
up till s8 b8 and for
each computation when i take s2 there is
a separate
sbox table called s2 for s3 we have a
separate
s box table called s3 and we know what
is b1 b2 b3
from the result here so we should go
ahead and compute
all these things little tedious
computation
but the process is very simple and keep
in mind we are still
computing the output of this function
that takes r0
and k1 as input so we finish computing
s1 b1
let us go and compute s2 b2 let's take
some practice
so s2 b2 what is b2 here the six
bits from the input
so this is b2 and to compute s2 of
b2 we need this s table or s
box s2 take the first digit
and then the last digit so it is 0 1 so
row number is nothing but
1 so we're going to go to row number 1.
so row number here
is 0 1 2 3 so we're going to go to row
number one
you take the remaining bits here what
are those remaining bits is nothing but
one zero
zero zero so this is nothing but
column number so the column number here
is eight
since we have one year so we're going to
go to column number eight so it's
column numbers we'll just write it out
zero one two
three four five six
seven and eight so it is row number one
and column number eight
so the value is 12
okay so the output of
s2 b2 is nothing but 12 12
is represented as 1 1 0 0 that is the
output so finish computing s1 b1 we
finish computing
s2 p2 is that clear
take the first bit last bit compute the
row number
take the remaining bits compute the
column number
take the row number column number find a
match in the s2
box and then you represent that value
say if you get 12 you represent that in
binary so that becomes your s2 b2
likewise we should continue with s3 b3
i know you guys are tired but let's take
another
thing s3 b3 let's understand that
b3 is nothing but these six bits
and i have given b3 here to compute s3
b3 we need
this s box s3
and how will you compute you have to
take the first bit and the last bit
that becomes the row number row number
is 0 so here row numbers are 0
1 2 3 so we are going to go to row
number 0
we take the remaining bits here what are
the remaining bits
so it is 1 1 1 1 that's nothing but
50 so you have to go to column number 15
so it's 0 1 2 3 i'm just giving the
column numbers here
5 6 7 8 9
10 11 12 13
14 15 so we have 15 columns so you go to
the 15th column
row number zero it is eight so you
represent eight in binary one
zero zero so that is the value of s3 b3
got it like that
you should continue with b4 b4 can you
try
1 and 0 so what is the row number here
4 number is 2 so you can 0 1 2 so we are
in row number 2.
you take the remaining digits what is
that 1
1 0 1
so what is this this is column number 13
so
this is column number 13 and row number
2
so the value is 2 how we represent 2 in
binary 0 0 1 0 so what is the value of
s 4 b 4 0 0 1
0 so you should not have any confusion
on how you
use the s box and compute s1
p1 to s8 b8 so i'm not going to go
through the other things it's just given
here
s5 b5 is computed like this s6 b6 is
computed
so for each one we are going to have a
separate s box table
s7 b7 will use s7 table so like that we
compute
s8 s8 is nothing but 0 1 1
so we have finished computing all these
values s1 b1 s2 b2
s3 b3 s4 b4 s5 b5 up till
s8 p8 so for each
calculation we add four bits so finally
when we write all the values the result
together
for s1 b1 till s8 b8 this is what we are
going to
achieve
there is one final stage before we get
the output of this function please
remember we are still working on the
output of this function
that is we will be taking this result
right we have just now computed using
the s boxes eight s boxes we have used
and we'll be applying a permutation for
permutation as usual we'll use a
table so this table will help us in
rearranging the bits
how it happens is you go to the 16th bit
so
this is the 16th bit make it the first
bit in your output
go to the seventh bit so this is the
seventh bit make it the second
bit in your output like that go to the
20th bit
so which is the 20th bit here this will
be the 20th
bit you make it the third
bit in your output so you use this
permutation table
and you get your output that is given
here so this is the output of this
function
that you have been computing so far so
finally we have obtained the output of
the
function what is that this is and
this is how many bits in length 32 bits
okay
so do you remember why we were computing
this function
do you remember that initial equation
where we have used this function do you
remember that so we got l0
r0 from phase one right the output to
our round one this was the out
this was the output from phase one which
is an input to a round one
and we use this formula you remember
this right
and in this formula when it is round one
we used
l1 r1 we computed l1 is equal to
r0 and r1 is equal to l0
plus this one and in the past three or
four slides previous slides we're
working on the output of this
and we have attained the output of this
right we know what is the output of this
we know what is l0 l0 from phase 1 input
we know what is that
and we know what is r0 r0 is also given
and since we now know the output of
everything we can go and compute
r1 r1 is nothing but you take l0
which is coming as input and you perform
an xr
with the computation of the value from
this function
the value this particular value we have
already computed
so we have computed the value of the
output of this function in round one
and we know what is the input to round
one so using this
we are going to find r1 r1 is nothing
but l0
and xr with the output of the function
we have computed
using the s boxes
so when you perform an xr of l0
with this output of the function
that is r0 comma k1
so both the 32 bits you're going to get
r1
r1 which is also 32 bits
so finally we have attained r1
and l1 so r1 and l1
is nothing but these two things are
output for round one
and this will be given as an input for
round two
let's go to our block diagram we'll
understand so
out of the permutation and division our
output was l0
or zero we have split that message after
permutation we are giving that
as an input to round one here in round
one we have obtained
computed l1 and r1 so this is
going as an input to round two again in
round two we'll
perform the computation using the
formula the algorithm is the same
and what we'll compute here is
what is l two and r two so round two
will give us the information on l2 and
r2 which will give us an input to round
three
what will round three fetches round
three will compute as
l3 and r3 like that we'll be traversing
many
rounds how many rounds we have here 16
rounds for
each round we will use the keys
say k12 k16 that we have generated
each key is of 48 bits so we'll be
propagating through the rounds
so finally what will be
the output of round 16 it will be l 16
and
r 16.
so we finished round one we know what is
l1 and
r1 right can we compute l2 and r2
can you start round two so this is l1
and r1 from round one
we have computed that how will you
compute l2 and r2
so you have this formula this is the
algorithm behind every round
so we substitute n is equal to 2
for round 2 so it is l2 is equal to r2
minus 1
and r2 is equal to l2 minus 1 plus
this function this is nothing but
r 2 minus 1 comma k2
so when you reduce it it'll be l2 is
equal to r1
we know what is r1 so we know what is l2
what is r2 this is nothing but l1 l1 is
also known
plus you have to compute the value of
this function which uses r1
and k2 k2 is nothing but the key2
you remember we generated 16 sub keys
right in this
k2 is the sub key which is 48 bits in
length
so that is k2 here
so we know everything we can substitute
we know what is k2
we know what is l2 that is nothing but
r1
we have to compute r2 so once when you
know l2 and r2 we can
be ready with the output of
round 2.
so l one plus the function
r one comma k two so this function uses
those eight eight
eight s boxes and it comes out with the
value finally
so like that you compute l2
and r2 i know it's a very tedious
process we're not going to again status
it's it's just the same process that we
did in round one
but will be it will be leading us to an
output of l2 and r2 after round two
so after 16 rounds what we are going to
have here
after 16 rounds what will be the output
here
l16 and r16 the algorithm is the same
only the input gets propagated
and finally this will be going to our
phase four
this is the phase final phase which
leads us to the
cipher text let's go to phase four
say after 16 hectic rounds
we have attained l16 and r16
now what we are going to do is we are
going to give it to the final
permutation so how we achieve this final
permutation is we will use this ip
inverse table
and this table will in turn
take in our l16 and r16
which is of each 32 bits
right and what we are going to do is
l16 is the left side and r16
is the 32 bits on the right side so we
have 32 bits here 32 bits here
we will just interchange them we will
make it as r16
l16 so that interchange
happens here so r comes first first 32
bits will be of
r and the next 32 bits will be of l16
once when you have achieved this we have
to apply the permutation which is
nothing but
rearranging the bits in this
rearranging the bits here r16
l16 bits will be rearranged so it says
go to the 48
40th bit in this r16 l16 make it the
first bit
go to the eighth bit so what is the
eighth bit here four
plus four eighth bit make it the second
bit in our output
this consists of eight numbers in one
column and eight columns so our
final output will be 64 bits so this is
nothing but
a rearrangement or permutation of r
16 l 16
and this can be represented in
xr decimal convert say
four digits will be mapped to an
hexadecimal output right so this is
eight first four digits is eight the
next four digits is nothing but
five so like that you transform that to
hexadecimal
and that is called your cipher text
finally
successfully we have achieved our cipher
text
so what we have encrypted here we have
taken
64 bits that is one block of message
and we have converted that to ciphertext
using
16 rounds and all that permutations and
divisions
and we have used 16 sub keys each of 48
bits in lab
so to we have just used one block that
is the first block message jam we have
attend our cipher text like that we have
many blocks right we are dm
vrdm1 so message can have many 64-bit
blocks
so we'll make every block go through the
same encryption process
and then we'll be getting ciphertext one
ciphertext2 ciphertext3
so whatever we have achieved here you
can you can consider this to be
cipher text one for plain text block one
so like that we have to encrypt we have
to carry out this process
for all the message blocks and we have
to send the data
such an encryption will should actually
make the hacker feel
very pathetic what on hell is that
message no matter what i try i'm not
able to decrypt it
you may think after all these rounds
this is how the hacker should feel
but let us take a look at the truth the
truth is
data encryption standard is insecure
and they say it's insecure because of
its relatively short
56-bit key size so we are taking 64 bits
initially and then we are applying the
permutation and reducing it to 56
bits so because of this short key size
they say it's insecure
and in january 1999 they were able to
publicly break a des
key in 22 hours and 15 minutes
so the cipher now is considered insecure
and it has been superseded we have a new
cipher this is the advanced
encryption standard aes which you will
be learning in our next class
and des has been withdrawn as a standard
by the national institute of standards
and
technology so even after learning all
these rounds and things like that you're
really unhappy to know that des is
insecure
so finally the hackers were able to
crack it
with this let me end this session and
we'll be learning
far better encryption strategy the
advanced encryption strategy
in our next class i hope you are able to
follow
the strenuous process on how a plain
text block is encoded as a type of text
in data encryption standard
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.
AI SUMMARY
Get an instant AI-generated summary of the video content, key points, and takeaways.
TRANSLATE
Translate the transcript to 100+ languages with one click. Download in any format.
MIND MAP
Visualize the transcript as an interactive mind map. Understand structure at a glance.
CHAT WITH TRANSCRIPT
Ask questions about the video content. Get answers powered by AI directly from the transcript.
GET MORE FROM YOUR TRANSCRIPTS
Sign up for free and unlock interactive viewer, AI summaries, translations, mind maps, and more. No credit card required.