0% found this document useful (0 votes)
29 views27 pages

CS#3 - 2

The document summarizes the steps of the Data Encryption Standard (DES) algorithm. It describes how DES takes a 64-bit plaintext block and key and performs an initial permutation, generates subkeys from the key, and then performs 16 rounds of encryption using Feistel structure. Each round uses the F-function, which expands the 32-bit right half using an expansion box, XORs it with the subkey, runs it through 8 S-boxes to confuse the data, and finally permutes the output. The left and right halves are swapped each round until the final permutation produces the 64-bit ciphertext.

Uploaded by

faiza abdella
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
29 views27 pages

CS#3 - 2

The document summarizes the steps of the Data Encryption Standard (DES) algorithm. It describes how DES takes a 64-bit plaintext block and key and performs an initial permutation, generates subkeys from the key, and then performs 16 rounds of encryption using Feistel structure. Each round uses the F-function, which expands the 32-bit right half using an expansion box, XORs it with the subkey, runs it through 8 S-boxes to confuse the data, and finally permutes the output. The left and right halves are swapped each round until the final permutation produces the 64-bit ciphertext.

Uploaded by

faiza abdella
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 27

64 bit data block K1 48b DES Round

Initial
Permutation 32b R0 f(R0, K1)
K2 48b
32b L0

L1 = R 0 R1 f(R1, K2)

R2 Repeat The Other


14 Rounds
L2 = R 1 Finally,
Final
Permutation on 64 bit Cipher Text
L16 & R16 (after
switched
Components
1. Initial Permutation
1. Permute 64bit data without loosing any bit
2. Dividing into left (L) and right (R)
2. Key Generation
i. Converting 64bit Key into 56bit Key (Dropping Parity Bits And Permuting)
ii. Generating 16 sub-keys of 48 bit from 56bit
3. F-Function
1. Mix Key with Data, Right(R).
2. Confuse Data.
4. XOR Left (L) with result from (3)
5. Final Permutation
1. Switch L16 & R16
2. Permute them to make final 64bit cipher
Initial (IP) Vs Final Permutations
(P-Boxes)
• Initial permutation, the first bit of the output is taken from the
58th bit of the input; the second bit from the 50th bit, and so on,
with the last bit of the output taken from the 7th bit of the input.

• The final permutation is the inverse of the initial permutation; the


table is interpreted similarly. That is, the output of the Final
Permutation has bit 40 of the pre output block as its first bit, bit 8
as its second bit, and so on, until bit 25 of the pre output block is
the last bit of the output.
Key Generation
Key Generation: Steps
• The round-key generator creates sixteen 48-bit keys out of a 56-bit
cipher key.
Steps
1. Drop Parity Bits, while permuting, bits 8, 16, 24, 32, …, 64 dropped.
2. Divide into two part, 28 bits each.
3. Circular Left Shift both separately.
4. Combine both sides and Compress it to 48bit subkeys for 16 DES
rounds.
Key Generation: parity bit dropper and
permute
Key Generation: Key Compression
• Converting the 56bit key into 48bit

Remember: Now we have 48bit sized key for ROUND Ki


What We Have?
F-Function: The Heart of DES
What it does
• Takes 32bit (right, R) data.
• Expand it to 48bit, to fit into each round key size (48bit)
• XOR 48bit data with key.
• Then mix the result using internal boxes called S-Boxes.
• There are about 8 S-boxes, each takes 6bits (or 6X8=48) to produce
compressed result, 4bit. That is 4X8= 32bit (right).
Finally, We will have 32bit (data mixed with key).
F-Function
Then,
• The result from F-function will me XORed
with Left (L) data to produce next Right (R).
• This step repeat 16 times.
• Finally, The Final Permutation will give us
the Cipher.
Example: Encrypt ‘hello’ message
• Let us Convert into Number, using alphabetical order.
• Convert Number into equivalent Binary
hello = 7 4 11 11 14 => 111 100 1011 1011 1110
• Let us make it one DES block text, 64 bits by adding more zeros.
=> 01110100101110111110 = 20bits representing each by 4bits
• Lets add 44 more bits, Infront.
0000000000000000000000000000000000000000000001110100101110111110
Now we have 64bit data (D).
Lets have 64bit Key (K)
1010101010101010101011111100001110110010000100101110001110100111
Initial Permutation on D
Permute D = 00000000 00000000 00000000 00000000 00000000
00000111 01001011 10111110
After Initial Permutation:
010000001000000010100000011000001000000010000000110000001
1100000 = D
Then, Divide D into L and R (32 bits each)
Lo = 01000000100000001010000001100000
Ro= 10000000100000001100000011100000
Key Generation
K=1010101010101010101011111100001110110010000100101110001110100111
1. Permute While Dropping every 8th bits (8, 16, 24, …. 64), to make it
56 bits
2. Then, divided into two part L and R, 28 bits
kl = 1101010011010011111101000111
kr = 1111100001111111100000000000

3. Then, For each Round Shift Circular Left.


Round 1, 2, 9 and 16 Shift Once.
For others Shift Twice (two bit).
Now, Using Compression Box generate 16, 48bit keys from kl and kr
Lets generate K1 (for the 1st round)
• Shift Both kl and kr circular left by one bit.
Result in;
kl = 1010100110100111111010001111
kr = 1111000011111111000000000001
• Using Compression Box, get the first 48 bit key (k1)
• Compression Box takes kl&kr (or Combined)
10101001101001111110100011111111000011111111000000000001
• Oops, I cannot find specific patter to program compression box.
So, let K1 = 011010010000111110011111010101111110000001111110
Next, what do we have?
• We have a permuted and divided data (D) into;
Lo = 01000000100000001010000001100000 (32 bit)
Ro= 10000000100000001100000011100000 (32 bit)
• We have also Key1 (k1), 48 bit
K1 = 011010010000111110011111010101111110000001111110
• Next copy Ro into L1, but backup Lo to T;
T = 01000000100000001010000001100000
L1 = 10000000100000001100000011100000
DES round (The 1st round)
• DES f-function and XORing
DES f-function
• Expand Ro from 32bit to 48bit, to fit into K1.

Index
1234 1234
Ro= 1000 0000 1000 0000 1100 0000 1110 0000
• Re = 0 1000 0 0 0000 1
Then,
We have Expanded Ro (32b) to Re (48b). Let say,
Re = 100000001000000011000000111000001111001010100100
Now, XOR K1 with Re:
K1 = 011010010000111110011111010101111110000001111110
XOR
Re=100000001000000011000000111000001111001010100100
---------------------------------------------------------------------------------------
Rx = 101001101000010011000000111000001101101010100101
Rx is an XORed result.
Next? S-box (Confusion), S-box rules
• 8 S-boxes, each one takes 6 bit and produce 4bit.
Rx = 101001 101000 010011 000000 111000 001101 101010 100101
S1 S2 S3 S4 S5 S6 S7 S8

• Each S-box have


predefined Tables
Example: S-box 1 and S-box 2 Tables
Example (S-Box)

• From the previous slide pick entry at row (2) & column(4), that is 10.
• Then What? Just convert number 10 into binary, 1010. Cool!
Next Part of F-function is: Straight permutation
• Let us have;
Rc = 1011 1000 0111 0000 1100 0001 1010 1101 (32bit)
• The last operation in the DES function is a permutation with a 32-bit input and a 32-bit
output.

• Now, Rp = 01010011000001110010001101010111 (permuted 32bit)


We are almost Done; But are we still on 1st round? Yes
• Now, Let us XOR L0 (T) with Rp
Rp = 01010011000001110010001101010111
XOR
T = 01000000100000001010000001100000
--------------------------------------------------------------------------------
• What Do you Think The Result Will Be?
That is R1 = 0101011010101001010101000101010

Congratulations!
DES ANALYSIS
• Critics have used a strong magnifier to analyze DES. Tests have been done to measure the
strength of some desired properties in a block cipher.
• The elements of DES have gone through scrutinizes to see if they have met the established
criteria.
Properties
Two desired properties of a block cipher are the avalanche effect and the completeness.
• Avalanche Effect Avalanche effect means a small change in the plaintext (or key) should create a
significant change in the ciphertext. DES has been proved to be strong with regard to this
property.
Completeness Effect Completeness effect means that each bit
of the ciphertext needs to depend on many bits on the
plaintext.
• The diffusion and confusion produced by D-boxes and S-
boxes in DES, show a very strong completeness effect.
Thank You

You might also like