Single Round of DES Algorithm

Neso Academy
10 Aug 202313:33

Summary

TLDRThe video script provides an in-depth look into the Data Encryption Standard (DES) algorithm, focusing on the single round function. It begins with an overview of the DES encryption process, which transforms a 64-bit plaintext into ciphertext through a series of permutations, substitutions, and key-based operations. The script explains the initial permutation, where the input text's bit positions are rearranged, and the inverse initial permutation, which reverses this process. The swap function is also discussed, highlighting its role in exchanging the left and right 32 bits of the text. The core of the presentation is the single round function, which takes a 64-bit input and a 48-bit round key, performing an expansion permutation, substitution through S-boxes, and transposition to produce a new 64-bit output. The round key is derived from the original 56-bit key through a left circular shift operation. The script concludes with a teaser for the next presentation, which will delve into the specifics of the function F within each round. Overall, the script offers a clear and engaging explanation of the DES algorithm's encryption process, piquing the interest of viewers in the intricacies of data security.

Takeaways

  • ๐Ÿ—๏ธ The DES (Data Encryption Standard) algorithm is a symmetric-key encryption algorithm that converts a 64-bit plaintext into a 64-bit ciphertext.
  • ๐Ÿ”„ The DES process involves an initial permutation, 16 rounds of processing with round keys, a swap function, and an inverse initial permutation.
  • ๐Ÿ”‘ The original 64-bit key is reduced to a 56-bit key, which is then further processed to generate 48-bit round keys for each of the 16 rounds.
  • ๐Ÿ”„ The initial permutation rearranges the 64-bit plaintext, and the inverse permutation does the same to the ciphertext before it is output.
  • ๐Ÿ”„ The swap function exchanges the left and right 32-bit halves of the data after all 16 rounds of processing.
  • ๐Ÿ”‘ Each round of DES encryption uses a unique 48-bit round key derived from the original 56-bit key through a left circular shift operation.
  • ๐Ÿ” In each round, the right 32 bits of the input are expanded to 48 bits to match the round key size, then processed through substitution and permutation boxes.
  • ๐Ÿ”„ The output of each round is a new 32-bit left half and a new 32-bit right half, which become the input for the next round.
  • ๐Ÿ”— The left and right halves are XORed within each round to produce the output for that round.
  • ๐Ÿ” The 'F function' or 'mangler function' is a key part of each round, which will be explained in more detail in a subsequent presentation.
  • ๐ŸŽ“ The presentation aims to help learners understand the steps involved in a single round of the DES algorithm, including initial and inverse permutations and the swap function.

Q & A

  • What is the main topic of the presentation?

    -The main topic of the presentation is the single round of the DES (Data Encryption Standard) algorithm.

  • What are the two key outcomes expected from the session?

    -The two key outcomes are understanding the initial permutation, inverse initial permutation, and the swap function, and understanding the single round of the DES algorithm.

  • How does the initial permutation function work?

    -The initial permutation function takes a 64-bit plaintext, changes the position of the bits, and outputs a 64-bit text.

  • What is the role of the round key in the round function?

    -The round key, which is 48 bits, is used in conjunction with the right side of the 64-bit input to the round function. It is combined with the expanded 48 bits from the right side of the input through an XOR operation.

  • How many rounds are there in the DES algorithm?

    -There are 16 rounds in the DES algorithm.

  • What happens to the right side of the 64-bit input in the round function?

    -The right side of the 64-bit input, which is 32 bits, is expanded into 48 bits using an expansion function before being combined with the 48-bit round key.

  • What is the purpose of the expansion permutation?

    -The expansion permutation is used to convert the 32 bits into 48 bits so that it can be combined with the 48-bit round key via an XOR operation.

  • What is the swap function's role in the DES algorithm?

    -The swap function takes the 64-bit output from the last round and swaps the left 32 bits with the right 32 bits before it is passed to the inverse initial permutation function.

  • How does the DES algorithm produce its 56-bit key from the original 64-bit key?

    -The original 64-bit key is reduced to 56 bits by a process that involves a left circular shift operation, and then the 56-bit key is used to derive the 48-bit round keys.

  • What is the final step after the 16 rounds of processing in the DES algorithm?

    -The final step is to pass the 64-bit output from the swap function to the inverse initial permutation function, which changes the position of the bits to produce the final 64-bit ciphertext.

  • What is the F function or Mangler function in the context of the DES algorithm?

    -The F function, also known as the Mangler function, is a part of the DES algorithm that takes the right side of the input and the round key as inputs and performs operations including expansion, XOR with the round key, substitution using S-boxes, and permutation using a P-box.

Outlines

00:00

๐Ÿ” Introduction to DES Algorithm Rounds

This paragraph introduces the DES (Data Encryption Standard) algorithm, focusing on the single round function. The session aims to teach two main outcomes: understanding the initial permutation, inverse initial permutation, and the swap function; and grasping the concept of a single round of the DES algorithm. The DES algorithm takes a 64-bit plaintext and converts it into a 64-bit ciphertext through a series of steps involving initial permutation, round functions with round keys, and a final swap function. The key-related process involves converting a 64-bit key into a 56-bit key size for the algorithm, which is then used to generate 48-bit round keys through a left circular shift operation. The paragraph provides an overview of the encryption process and sets the stage for a deeper dive into the initial permutation and round function mechanisms.

05:00

๐Ÿ”„ Understanding Initial and Inverse Permutations and the Swap Function

The second paragraph delves into the specifics of the initial permutation, inverse initial permutation, and the swap function within the DES algorithm. The initial permutation rearranges the 64-bit plaintext, changing the position of the bits to produce a 64-bit output. The inverse initial permutation performs a similar function but on the 64-bit ciphertext, converting it back to the original bit order. The swap function is straightforward, taking the output from the initial permutation and swapping the left and right 32-bit halves to prepare it for the next stages of encryption. The paragraph explains these processes in detail, ensuring that the learner can understand how the plaintext and ciphertext are manipulated through these functions.

10:00

๐Ÿ”‘ The Mechanics of a Single Round in DES

This paragraph provides an in-depth look at a single round of the DES algorithm. Each round takes a 64-bit input and a 48-bit round key to produce a 64-bit output. The process involves splitting the input into left and right 32-bit halves. The right half undergoes an expansion function to match the round key's size, which is then combined with the round key through an XOR operation. This result is then reduced to 32 bits by a substitution box (S-box), which is followed by a permutation box (P-box) that changes the bit positions. The output from the P-box is XORed with the left half of the input, resulting in a new set of left and right 32-bit halves that move on to the next round. The paragraph explains the iterative nature of the 16 rounds, each with its own 48-bit round key derived from the original 56-bit key. This detailed explanation sets the foundation for understanding the complex encryption process within a single round of DES.

Mindmap

Keywords

๐Ÿ’กDES

DES stands for Data Encryption Standard, which is a symmetric-key algorithm for data encryption. In the video, DES is the central theme, as it discusses the encryption process and its various components, such as the initial permutation, round function, and inverse initial permutation.

๐Ÿ’กInitial Permutation

The initial permutation is the first step in the DES encryption process. It involves rearranging the 64-bit plaintext into a new order. The script describes how the initial permutation function changes the position of the bits, which is crucial for setting up the encryption process.

๐Ÿ’กRound Function

The round function is a key component of the DES algorithm, where the encryption process is repeated multiple times. Each round involves a different 48-bit round key and processes the data through various steps such as expansion, substitution, and permutation. The script explains that the round function takes 64 bits of input and a 48-bit key, producing a 64-bit output.

๐Ÿ’กSwap Function

The swap function is part of the final steps in the DES encryption process. It involves swapping the left and right 32 bits of the data. The script mentions this function as a simple operation that reorders the bits before they are passed to the inverse initial permutation.

๐Ÿ’กInverse Initial Permutation

The inverse initial permutation is the counterpart to the initial permutation and is applied after the swap function. It reverses the changes made by the initial permutation, preparing the ciphertext for the final output. The script describes how this function takes the 64-bit output from the swap function and reorders the bits.

๐Ÿ’กCiphertext

Ciphertext refers to the encrypted form of the original plaintext. In the context of the video, the DES algorithm takes a 64-bit plaintext and converts it into a 64-bit ciphertext through a series of permutations, round functions, and key applications.

๐Ÿ’กRound Key

A round key is a 48-bit key used in each round of the DES encryption process. The script explains that there are 16 round keys derived from the original 56-bit key, each used in a specific round to ensure the security of the encryption.

๐Ÿ’กExpansion Function

The expansion function, or expansion permutation, is used within the round function to increase the size of the right-hand side 32 bits to 48 bits. This is necessary to match the size of the round key for the XOR operation, as described in the script.

๐Ÿ’กSubstitution Box (S-Box)

The substitution box, often referred to as an S-box, is a component of the DES round function that reduces the 48 bits resulting from the expansion function to 32 bits. The script mentions the S-box as part of the process that involves changing the bit positions to achieve the desired output size.

๐Ÿ’กPermutation Box (P-Box)

The permutation box, or P-box, is used to rearrange the bits after they have been processed by the S-box. The script explains that the P-box changes the position of the bits without altering their number, which is an essential step before the bits are XORed with the left-hand side bits.

๐Ÿ’กXOR Operation

The XOR (exclusive OR) operation is a logical function used in the DES algorithm to combine bits. In the script, it is mentioned that the XOR operation is used to combine the left-hand side bits with the processed right-hand side bits, resulting in the final 32-bit output for each round.

Highlights

Introduction to the DES (Data Encryption Standard) algorithm focusing on the single round function.

Understanding the initial permutation, inverse initial permutation, and the swap function.

The DES algorithm takes a 64-bit plaintext and converts it into a 64-bit ciphertext.

The round function accepts a 48-bit round key and processes the input through 16 rounds.

The swap function rearranges the left and right 32 bits of the 64-bit block.

The 64-bit key is reduced to a 56-bit key size for the DES algorithm.

The left circular shift algorithm generates the 48-bit round keys from the 56-bit key.

The initial permutation changes the position of the 64 bits of plaintext.

The inverse initial permutation reverses the changes made by the initial permutation.

The expansion function converts 32 bits into 48 bits to combine with the round key.

The S-boxes (substitution boxes) reduce the 48 bits back to 32 bits.

The P-box (permutation box) changes the position of the 32 bits without expanding or reducing them.

The output of the round function is a 64-bit block, consisting of a new left and right 32-bit half.

The process of the round function is repeated 16 times with different round keys.

The original 64-bit key is reduced to a 48-bit round key for each round.

The function F, also known as the mangler function, will be elaborated in the next presentation.

The presentation concludes with a comprehensive understanding of the single round in the DES algorithm.

Transcripts

play00:00

foreign

play00:06

welcome back in the last presentation we

play00:09

have seen about the introduction to desk

play00:11

and in that we have seen about the Des

play00:14

encryption algorithm in today's

play00:16

presentation we will focus on what

play00:18

happens in that round function so the

play00:21

topic of the day is single round of Des

play00:24

the Des algorithm as usual let's start

play00:27

the session with the outcomes upon the

play00:30

completion of the session the learner

play00:32

will be able to outcome number one

play00:34

understand the initial permutation the

play00:37

inverse initial permutation and the swap

play00:40

function and outcome number two which is

play00:43

understanding the single round of this

play00:45

algorithm and in the last presentation

play00:48

we have seen about this this encryption

play00:50

algorithm where this algorithm is going

play00:52

to take a 64-bit blank text and it is

play00:55

going to be converted into a 64-bit

play00:57

ciphertext and this 64-bit playing text

play01:00

is given to the initial permutation

play01:02

function and the position of the bits

play01:04

are changed and then the output of this

play01:07

initial permutation is going to be 64

play01:09

bits this 64 bits is going to the round

play01:12

function where it accepts the round key

play01:15

which is of 48 bit if it is round 1 it

play01:18

is going to be K1 which is of 48 bits

play01:20

then after processing the input it goes

play01:22

to round 2 goes to round three round

play01:24

four and so on and finally it completes

play01:27

round 16. for round 16 it takes k16 as a

play01:31

round key and then the 64 bits are given

play01:34

to a swap function where this swap

play01:36

function is going to swap the left hand

play01:38

side 32 bits and the right hand side 32

play01:40

bits and the output of this function is

play01:43

going to be again 64 bit and these 64

play01:46

bits are then given to the inverse

play01:48

initial permutation function again the

play01:50

position of the bits are changed and

play01:52

finally we will be getting the 64-bit

play01:55

ciphertext

play01:56

in the left hand side we can see the

play01:58

encryption related Parts the initial

play02:00

permutation the round functions swap

play02:03

function and the inverse initial

play02:05

permutation function and coming to this

play02:08

side we can see everything is of key

play02:10

related things where the 64-bit key is

play02:13

actually inputted with the playing text

play02:15

for the encryption algorithm and these

play02:18

64 bits are actually converted into 56

play02:21

bits which is the key size or the key

play02:23

length of the dash algorithm these 56

play02:25

bits are actually given to the left

play02:27

circular shift algorithm in order to do

play02:29

a left circular shift operation

play02:32

all these 48-bit round keys are actually

play02:35

derived from this 56-bit key so this is

play02:38

just a recapture of the previous lecture

play02:40

now what we are going to learn in

play02:41

today's presentation we are going to

play02:43

learn about the initial permutation the

play02:46

round function and then the inverse

play02:48

initial permutation function let's start

play02:51

with the first one the initial

play02:53

permutation this initial permutation is

play02:55

going to take 64 bits plain text and

play02:57

it's going to change the position of the

play02:59

bits and it's going to give 64 bits

play03:01

output right so let's see that now

play03:04

if we take the playing text which is of

play03:06

64 bits which are ordered like this the

play03:09

first bit the second bit the third bit

play03:10

fourth bit and if the bits are placed

play03:12

like this obviously the last bit will be

play03:15

the 64th bit now if you see here the

play03:18

input what we are giving is going to be

play03:20

converted into binary bits and the

play03:22

64-bit binary bits are placed like this

play03:26

as I already mentioned in the last

play03:27

diagram this initial permutation

play03:30

function takes 64 bits input and it

play03:32

converts this into 64-bit output and

play03:35

what is actually happening

play03:37

the position of the bits are changed

play03:39

let's see that now we know the inputs

play03:41

are placed like this and how it is going

play03:44

to be changed it's going to be changed

play03:46

like this the first eight bits are

play03:49

placed like this the first bit here the

play03:52

second bit here the third bit here the

play03:54

fourth bit here five six seven and eight

play03:58

what about the second row 9 to 16 9 10

play04:02

11 12 13 14 15 16 likewise the bit

play04:08

positions are changed now if you start

play04:10

reading from here whatever we had in the

play04:13

58th position maybe this might be a zero

play04:16

bit or a one bit this bit takes this

play04:18

position and whatever we have in this

play04:21

place it can also be either a zero or a

play04:23

one that bit is placed here so if you do

play04:26

this approach ultimately we will be

play04:28

getting 64 bits only and we need to

play04:30

start reading like this this is the

play04:32

first bit second bit third bit fourth

play04:34

bit now if you read like this then

play04:36

obviously we'll be having 64 bits so the

play04:39

initial permutation changes the position

play04:41

of the 64 bits

play04:43

I hope things are clear for you so let's

play04:46

see the diagram now so we are done with

play04:48

completing the initial permutation where

play04:50

the position of the playing text is 64

play04:52

bits are changed let's now focus on

play04:55

inverse initial permutation where it is

play04:57

also going to take 64 bits and it's

play05:00

going to convert the 64-bit Cipher text

play05:02

the input 64 bits is actually coming

play05:05

from the 32-bit swap function anyway

play05:07

let's see the diagram now let's see the

play05:10

inverse initial permutation now

play05:12

let's understand the swap function is

play05:14

giving 64 bits and those 64 bits are

play05:17

arranged like this the first 8 Bits are

play05:20

placed like this one two three four five

play05:23

six seven eight then the next eight bits

play05:25

are placed like this 9 10 11 12 13 14 15

play05:28

16 in this manner if you arrange then it

play05:32

is inverse initial permutation so it's

play05:34

so simple whatever we get from the

play05:36

32-bit swap function let's assume that

play05:38

it is ordered like one two three four

play05:40

sequentially take the first row and

play05:42

place it in the second column in this

play05:44

manner if this is also reordering this

play05:46

is also permutation right

play05:48

so we are done with dealing with the

play05:51

initial permutation and the inverse

play05:53

initial permutation and 32-bit swap

play05:55

operation is so simple if you have 64

play05:57

bits just partition that into two equal

play05:59

halves left hand side 32 right hand side

play06:02

32 take the right hand side 32 and place

play06:04

it in the left hand side take the left

play06:05

hand side 32 bits and place it in the

play06:07

right hand side so we will be getting 64

play06:09

bits though 64 bits after swapping what

play06:12

we get that only is given to the inverse

play06:15

initial permutation

play06:16

so we are done with dealing the initial

play06:19

permutation and the inverse initial

play06:21

permutation let's now focus on what

play06:24

happens in every round that's the topic

play06:26

of the day the single round of this

play06:29

algorithm here is the single round of

play06:32

this algorithm let's see what happens in

play06:35

one round let's revisit the diagram one

play06:37

more time

play06:39

what happens in every round this round

play06:41

receives 64 bits as the input and it

play06:45

also takes 48-bit key that is the round

play06:47

key please note here round function

play06:49

takes 64 bits input and 48-bit key and

play06:53

finally what's the output of every round

play06:55

it is 64 bits only so every round is

play06:58

going to take 64 bits input and a 48-bit

play07:01

key and finally it gives a 64-bit output

play07:04

let's take any round since we are not

play07:07

able to place the complete round details

play07:09

here we have simply mentioned it as

play07:11

round one round two up to round 16. now

play07:14

what happens in every single round

play07:16

in every single round this is happening

play07:19

so if you note here this is one round

play07:22

and what's the input size which is

play07:24

getting into the round it's 64 bits

play07:26

right the entire 64 bits which is

play07:28

entering into the round contains the

play07:30

left hand side 32 bits and the right

play07:32

hand side 32 bits these right hand side

play07:34

32 bits are just taken as such so can

play07:37

you see here the right hand side 32 bits

play07:39

are taken and this is actually given to

play07:42

an expansion function now the role of

play07:45

this expansion function or expansion

play07:46

permutation is to expand it why we need

play07:50

to expand it because we are getting a 48

play07:53

bit key and what is the input that is

play07:55

fed into the round function it is 64

play07:57

bits right now these 64 bits we have

play08:00

partitioned into two halves one is the

play08:02

left hand side 32 and the other one is

play08:04

the right hand side 32. now this right

play08:06

hand side 32 have to be converted into

play08:08

48 bits so that this can be absorbed

play08:12

with the round key which is 48 bits so

play08:15

this is actually

play08:17

can you see here the original key is

play08:19

What 64 bits it is also having 32 bits

play08:22

here and 32 bits here I will just go

play08:25

back to the previous diagram so that it

play08:26

will be easy for you to understand

play08:29

in this diagram the original key is What

play08:31

64 bits and what we are giving for every

play08:34

round 48 bits this original 64 bits

play08:37

whatever is given to the round contains

play08:39

left hand side 32 and right hand side

play08:40

32. the right hand side 32 is expanded

play08:43

so that the 32 bits in the right hand

play08:46

side is converted into 48 bits and then

play08:49

this 48 bit can be absorbed with this 48

play08:51

bits which is the round key that is what

play08:53

we are dealing here so the right hand

play08:55

side 32 bits are actually expanded and

play08:57

then we will be getting 48 bits how we

play09:00

are going to expand this that we will

play09:01

see later but just understand the

play09:03

concept so the right hand side 32 bits

play09:06

are expanded into 48 bits and whatever

play09:08

we get from the round key this is of 48

play09:11

bits so when this 48 bit is xorbed with

play09:14

this 48 bit will be getting 48 bits so

play09:17

this 48 bits actually now to be reduced

play09:20

to 32 bits because already we have 32

play09:22

bits in the left hand side so we have to

play09:24

reduce this so what we are going to do

play09:26

is we are going to reduce this 48 bits

play09:29

into 30 two bits by giving this to a

play09:31

substitution box which is also called as

play09:33

yes box so what is Box is doing it's

play09:36

taking 48 bits as the input and it is

play09:39

reducing it into 32 bits so if you see

play09:42

here expansion table is expanding into

play09:45

48 bits whereas the s box is reducing

play09:48

this into 32 bits now these 32 bits are

play09:52

actually given to a p box which is the

play09:53

permutation box or a transposition box

play09:56

where the position is going to be

play09:57

changed and whatever we get here is

play10:00

going to be another 32 bits because we

play10:02

are not going to expand or reduce rather

play10:05

we are going to change the position only

play10:06

after changing the position whatever we

play10:08

get you can ignore this for now and

play10:11

whatever you get after changing the

play10:13

position will be 32 bits and these 32

play10:16

bits actually are xored with the left

play10:19

hand side 32 bits can you see here the

play10:21

left hand side is of 32 bit these 32

play10:24

bits are just absorbed with the 32 bits

play10:26

after processing these many aspects now

play10:30

whatever the result we get will be 32

play10:32

bits because the left hand side 32 bits

play10:35

is actually absorbed with the 32 bits

play10:37

after performing these operations so 32

play10:40

bits xorbate another 32 bits will be 32

play10:43

bits and these 32 bits are the right

play10:45

hand side part and what about the left

play10:48

hand side 32 part before starting any

play10:50

round we will be having 64 bits input

play10:52

right the 32 bits are just taken here

play10:55

and placed here so that this is 32 bits

play10:58

and this is 32 bits these 32 plus 3264

play11:02

bits are going to the next round it

play11:04

means this is the previous round which

play11:06

is I minus 1 this is the next round

play11:08

which is I how many times these rounds

play11:11

are being performed 16 times the rounds

play11:14

are performed for every 16 time we get

play11:16

16 round keys I hope things are clear

play11:19

for you now let's see what happens here

play11:21

the original key is 32 plus 32 64 bits

play11:25

it is actually reduced into 56 this 56

play11:28

bit key is actually reduced to 48 bit

play11:31

and this is the round key for every

play11:34

round we have a 48 bit round now this

play11:37

entire process is repeated for how many

play11:38

times 16 times because how many rounds

play11:41

we have 16 rounds so this is exactly

play11:44

what happens in this round or in this

play11:47

round or in any of the rounds this is

play11:50

what happens in every single round of

play11:52

this algorithm so let's see the equation

play11:54

what happens in left hand side and right

play11:56

hand side

play11:57

let's take this diagram what is actually

play12:00

Li let's say the input is Li minus 1 and

play12:05

RI minus 1 and the output of the round

play12:07

function is l i and r a now what is l i

play12:11

this Li is exactly whatever is there in

play12:14

the ri minus 1 so l i is exactly ra

play12:17

minus 1 so R A minus 1 is exactly l i

play12:21

and what about this r i r i is l i minus

play12:25

1 xorb with these many things right so

play12:29

what is RI RI is Li minus 1 which is RIS

play12:34

l i minus 1 xorbit this entire function

play12:38

what is this function this function is a

play12:41

mangular function where it takes the

play12:44

right hand side part which is R minus 1

play12:47

as the input and this k i key right so

play12:51

these two inputs are given for this

play12:53

function f which is exactly the F

play12:55

function or Mangler function don't worry

play12:58

about this function now anyway in the

play13:00

next presentation we are going to

play13:01

elaborately focus on what happens in

play13:03

this function f in every round and

play13:06

that's it guys I hope now you understood

play13:09

what happens in the initial permutation

play13:10

in the inverse initial permutation and

play13:13

the swap function and also we have

play13:15

understood the single round of this

play13:17

algorithm I hope you guys enjoyed this

play13:19

presentation and thank you for watching

play13:22

[Music]

play13:22

[Applause]

play13:24

[Music]

Rate This
โ˜…
โ˜…
โ˜…
โ˜…
โ˜…

5.0 / 5 (0 votes)

Related Tags
DES AlgorithmEncryptionCryptographyInitial PermutationRound FunctionInverse PermutationSwap FunctionKey GenerationSecurityEducational