0% found this document useful (0 votes)
9 views13 pages

Week 5-Block Cipher & DES

Chapter 3 discusses block ciphers, specifically the Data Encryption Standard (DES), highlighting the differences between stream and block ciphers, reversible and irreversible mappings, and the Feistel cipher structure. It details the key generation and message encryption processes of DES, including initial permutations, left and right divisions, and the use of S-boxes for substitution. The chapter also addresses the security implications of DES, including its susceptibility to cryptanalysis and the importance of parameters such as block size, key size, and the number of rounds.

Uploaded by

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

Week 5-Block Cipher & DES

Chapter 3 discusses block ciphers, specifically the Data Encryption Standard (DES), highlighting the differences between stream and block ciphers, reversible and irreversible mappings, and the Feistel cipher structure. It details the key generation and message encryption processes of DES, including initial permutations, left and right divisions, and the use of S-boxes for substitution. The chapter also addresses the security implications of DES, including its susceptibility to cryptanalysis and the importance of parameters such as block size, key size, and the number of rounds.

Uploaded by

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

Chapter 3: Block Cipher & DES

=====================
Stream Cipher:
============
Is one that encrypts a digital data stream one bit or one byte at a time.

Block Cipher:
===========
is one which a block of plaintext of sizes ( 64 to 128 bits) is treated as whole & used to
produce cipher text of equal length

Reversible & Irreversible Mapping:


============================
Reversible Mapping
================
Plaintext Ciphertext

00 (00, 10, 01, 11)

01 (00, 10, 01)

10 (00, 01)

11 (00)

2^n!
Irreversible Mapping
=================
Plaintext Ciphertext

00 (00, 10, 01, 11)

01 (00, 10, 01, 11)

10 (00, 10, 01, 11)

11 (00, 10, 01, 11)

● Reversible mapping allows for decryption while irreversible doesn't

Questions:
=========
● A cipher block operates on a plaintext block of size n bits. How many different irreversible
mappings can result?
Answer:
=======
2n different mapping

● How many reversible mappings?


Answer:
=======
2n ! Reversible

● Predicting key size= n * 2n where n is block size

Feistel Cipher: (reversible mapping)


============================
● Feistel developed a block cipher of size n bits & key length k bits & allowed a total of 2k
transformations
rather than 2n!
● The cipher alternates confusion & diffusion.

Diffusion:
========
● Is where the statistical structure of the plaintext is dissipated into long range statistics of
the ciphertext
● To prevent cryptanalysis by letter frequencies.

Confusion:
=========
● Is where the relationship between the statistics of the ciphertext & the value of the key is
as complex as possible
● Difficult to deduce key given ciphertext
Substitution:
==========
● Is performed on the left side of the data by applying the round function F to the right half &
XORing with the left

Permutation:
===========
● Occurs when the two halves of data are interchanged
Parameters & design features of the Feistel cipher:
===================================
1. Block Size:
○ Larger block size--> larger security but reduced encryption / decryption speed
(64.. 128 bits)
2. Key Size:
○ Larger key size--> larger security but reduced encryption / decryption speed (64..
128 bits)

1. Number of rounds:
○ Single round is not secure but multiple rounds offer increased security (16
rounds)

1. Subkey generation algorithm


○ Greater complexity--> greater difficulty of cryptanalysis

1. Round Function
○ Greater complexity--> greater difficulty of cryptanalysis

1. Other:
○ Fast software encryption / decryption
○ Ease of analysis

123=>loijhggvbkbvfdsrety

Avalanche Effect:
==============
A small change in the plaintext or key causes a large change in the
ciphertext

Note:
====
● DES is now prone to BFA with its key size & high processing power
● DES may also be susceptible to cryptanalysis attack due to its s-boxes

Algorithm of DES:
===============
● Part 1: Key Generation:
=================
1. Convert it to binary (64 bits)
2. Apply Permutation choice 1 (56 bits)
3. Divide Key left and right
4. Apply left shift table for the 16 keys
5. Concatenate left & right
6. Apply Permutation Choice 2 ( 48 bits)
● Part 2: Message Encryption:
======================
1. Apply Initial Permutation (64 bits )
2. Divide Message into left & right (32, 32).
3. Find left 1 , right 1
1. Left 1=Right 0
2. Right 1= ( Left 0 + Function ( Right 0, Key 1) )
1. Function (Right 0, key 1)
===================
Right 0==> 32 bits
Key 1===> 48 bits
So, we will apply expansion to the right part
1. Left 0 + Function
==============
Left 0===> 32 bits
Function-> 48 bits
So we will apply s-box for the function results
1. Concatenate right, left
2. Apply inverse Permutation

Example on Simplified DES:


======================
Given the following plaintext and key get the first round of Simplified DES:
====================================================
Let the plaintext be the string 10101000. Let the 10-bit key be 1100011110.
===========================================

Permutation Choice 1:
3 5 2 7 4 10 1 9 8 6

Shift table:
Round 1 1 bit

Permutation Choice 2:
6 3 7 4 8 5 10 9

IP:
2 6 3 1 4 8 5 7

Expansion :
4 1 2 3 2 3 4 1

S-box 1:
1 0 3 2

3 2 1 0

0 2 1 3

3 1 3 2

S-box 2:
0 1 2 3

2 0 1 3

3 0 1 0

2 1 0 3

Solution:
=======
● Part 1: Key Generation:
===================
1. Apply Permutation choice 1 (56 bits)
key be 1100011110.
1 2 3 4 5 6 7 8 9 10

1 1 0 0 0 1 1 1 1 0

3 5 2 7 4 10 1 9 8 6

0 0 1 1 0 0 1 1 1 1
Key : 0011001111

1. Divide Key left and right

Left 0: 00110
Right 0: 01111
1. Apply left shift table for the 16 keys

Left shift left 0: 01100


Right shift right 0: 11110

1. Concatenate left & right

Concatenate: 01100 11110


1. Apply Permutation Choice 2

1 2 3 4 5 6 7 8 9 10

0 1 1 0 0 1 1 1 1 0

6 3 7 4 8 5 10 9

1 1 1 0 1 0 0 1

Key: 11101001
● Part 2: Message Encryption:
======================

Message : 1010 1000

1. Apply Initial Permutation

1 2 3 4 5 6 7 8

1 0 1 0 1 0 0 0

IP:
2 6 3 1 4 8 5 7

0 0 1 1 0 0 1 0

Message : 00110010

1. Divide Message into left & right

Left 0: 0011
Right 0: 0010

1. Find left 1 , right 1


1. Left 1=Right 0

Left 1=Right 0=0010

1. Right 1= ( Left 0 + Function ( Right 0, Key 1) )

Right 1= (0011 + Function (0010, 11101001) )

1. Function (Right 0, key 1)


===================
Right 0==>. 0010
Key 1===> 11101001
So we will make expansion to right part
Expansion :
1 2 3 4

0 0 1 0

4 1 2 3 2 3 4 1

0 0 0 1 0 1 0 0

Right after expansion: 00010100


Key 1. : 11101001
==================
11111101
Right 1= (0011 + 11111101 )

1. Left 0 + Function
==============
Left 0===> 0011
Function-> 11111101
So we will apply s-box for the function results

S-box 1: 1111. row : 11:3. col:11: 3. intersection(3,3)=2=10


1 0 3 2

3 2 1 0

0 2 1 3

3 1 3 2

S-box 2: 1101 row=11=3. col=10=2 intersection(3,2)=0=00


0 1 2 3

2 0 1 3

3 0 1 0

2 1 0 3

After S-boxes : 11111101=1000


Left 0 + Function
0011
1000
====
1011
Right 1: 1011
1. Concatenate right, left
10110011
1. Apply inverse Permutation

IP:
1 2 3 4 5 6 7 8

2 6 3 1 4 8 5 7
IP-1:

1 2 3 4 5 6 7 8

4 1 3 5 7 2 8 6

1 1 1 0 1 0 1 0

1 2 3 4 5 6 7 8

1 0 1 1 0 0 1 1

Message After round 1: 10110011


Sheet:
=====
Problem number 3 :
================

110111
Row number : 11: 3
Column number :1011 :11
Value =3: 0011

Other examples:
● Plaintext: 11010101; Key: 0111010001
● Plaintext: 01001100; Key: 1111111111
● Plaintext: 00000000; Key: 0000000000
● Plaintext: 11111111; Key: 1111111111

You might also like