0% found this document useful (0 votes)
8 views26 pages

4 Block Ciphers

The document discusses block ciphers, particularly focusing on the principles of substitution-permutation networks introduced by Claude Shannon. It explains the concepts of confusion and diffusion in encryption, the Feistel cipher structure, and details the Data Encryption Standard (DES) and Simplified DES (S-DES) algorithms. The document emphasizes the importance of block size, key size, and the number of rounds in ensuring the security of encryption algorithms.

Uploaded by

bscs22f36
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)
8 views26 pages

4 Block Ciphers

The document discusses block ciphers, particularly focusing on the principles of substitution-permutation networks introduced by Claude Shannon. It explains the concepts of confusion and diffusion in encryption, the Feistel cipher structure, and details the Data Encryption Standard (DES) and Simplified DES (S-DES) algorithms. The document emphasizes the importance of block size, key size, and the number of rounds in ensuring the security of encryption algorithms.

Uploaded by

bscs22f36
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/ 26

Information

Security
Block Cipher

By
Dr. Mudassar Raza
Professor
Department of Computer Science
Namal University Mianwali https://techgirls.ece.vt.edu/slides/introduction_to_cybersecurity.html#39

By: Dr. Mudassar Raza


Block cipher principles

• Stream cipher is one that encrypts a digital data stream one bit (or
byte) at a time
• Example: autokey Vigenère system
• Block cipher is one in which the plaintext is divided in blocks and one
block is encrypted at one time producing a ciphertext of equal length
• Similar to substitution ciphers on very big characters: 64 bits or 128 bits are
typical block lengths
• Many modern ciphers are block ciphers

By: Dr. Mudassar Raza


Principle: Substitution-Permutation
Ciphers
• 􀂄Claude Shannon (1949) introduced idea of substitution-permutation (S-P)
networks
• 􀂉These form the basis for modern substitution-transposition product cipher
• 􀂄S-P networks are based on the two primitive cryptographic operations
• 􀂉 substitution(S-box)
• 􀂉 permutation (P-box)
• 􀂄The goal is to provide confusion and diffusion of message

By: Dr. Mudassar Raza


Shannon’s building blocks
• Shannon proposed product ciphers with two
components
• S-Boxes -- substitution
• providing confusion of input bits
• P-Boxes -- permutation
• providing diffusion across S-box inputs
• n rounds of S-P boxes

By: Dr. Mudassar Raza


Confusion and Diffusion
• Cipher need to completely obscure statistical properties of original
message

• Diffusion
• Makes the statistical relationship plaintext -ciphertext as complex as possible
• Achieved by requiring that every digit of the plaintext affects many digits of
the ciphertext (equivalently, every digit of the ciphertext is affected by many
digits of the plaintext

By: Dr. Mudassar Raza


Confusion & Diffusion
• Diffusion complicates the statistics of the cipher text, and makes it difficult to
discover the key of the encryption process.
• The process of confusion, makes the use of the key so complex, that even when
an attacker knows the statistics, it is still difficult to deduce the key.
• Confusion can be accomplished by using a complex substitution algorithm.
• The principles of confusion and diffusion are the most essential concepts in the
design of modern block ciphers they defend against statistical attacks

By: Dr. Mudassar Raza


Feistel Cipher Structure
• Virtually all modern block encryption algorithms use the Feistel structure
• 􀂄Horst Feistel was the leader of the IBM team that worked in late 1960s on LUCIFER
• 􀂄He devised the so-called “feistelcipher”
• 􀂄Algorithm structure –perform n rounds, each round has the following structure (for encryption
and decryption):
• 􀂉Input is of length 2w (bits), key is K
• 􀂉Divide the input into two halves L0and R0
• 􀂉L1= R0, R1=L0⊕f(R0,K)
• 􀂉In the next round use (L1, R1) instead of (L0, R0), etc.
• 􀂉Function f is the same in all rounds but uses a different subkeyin each round –the subkeyof each round
is generated from the key

By: Dr. Mudassar Raza


By: Dr. Mudassar Raza
Feistel Cipher Structure

• Block size: larger block sizes mean greater


security
• Key Size: larger key size means greater security
• Number of rounds: multiple rounds offer
increasing security
• Subkey generation algorithm: greater
complexity will lead to greater difficulty of
cryptanalysis.
• Fast software encryption/decryption: the
speed of execution of the algorithm becomes a
concern

By: Dr. Mudassar Raza


Conventional Encryption
Algorithms
• Data Encryption Standard (DES)
• The most widely used encryption scheme
• The algorithm is reffered to the Data Encryption Algorithm
(DEA)
• DES is a block cipher
• The plaintext is processed in 64-bit blocks
• The key is 56-bits in length

By: Dr. Mudassar Raza


DES encryption scheme
• The plaintext (64 bits) passes through an initial permutation IP(on 64
bits)
• Then follow 16 identical rounds –in each round a different sub key is
used; each sub key is generated from the key
• After round 16, swap the left half with the right half
• Apply the inverse of the initial permutation IP-1(on 64 bits)

By: Dr. Mudassar Raza


By: Dr. Mudassar Raza
By: Dr. Mudassar Raza
Simplified DES (S-DES)
An educational rather than secure algorithm

By: Dr. Mudassar Raza


– 8 bit blocks and 10 bit keys
– IP, IP-1 = (initial) permutation
– P10 = 10 bit permutation
– P8 = 8 bit permutation
and selection
– SW = swap 2 halves
– FK(L,R)=(L F(R,SK),R)

By: Dr. Mudassar Raza


S-DES key generation
-Uses a 10-bit key
-Forms two 8-bit subkeys

1. Apply P10 permutation

2. Left-shift circularily (LS-1) separately on the five


first and five second bits

3. Apply P8 to pick the eight bits of key K1

4. Perform LS-2 (2-bit left shift) on the product of


phase 2
5. Apply P8 to pick the eight bits of key K2

By: Dr. Mudassar Raza


S-DES key generation

K1 = P8(Shift(P10(key)))

K2 = P8(Shift(Shift(P10(key))))

By: Dr. Mudassar Raza


KEY1 S-DES key generation
Input: 1 0 1 0 0 1 0 1

1 2 3 4 5 6 7 8 9 10
10 bit Key: 0 0 1 0 0 1 0 1 1 1

permutation P10: 3 5 2 7 4 10 1 9 8 6

After applying permutation P10: 1 0 0 0 0 1 0 1 1 1

Apply LS-1 (left shift 1) 0 0 0 0 1 0 1 1 1 1


to each 5-bit group

permutation P8: 6 3 7 4 8 5 10 9

After applying permutation P8 : 0 0 1 0 1 1 1 1


KEY1
Original key :

By: Dr. Mudassar Raza


KEY2 S-DES key generation
Input: 1 0 1 0 0 1 0 1

1 2 3 4 5 6 7 8 9 10
After Apply LS-1 (left shift 1)
to each 5-bit group
0 0 0 0 1 0 1 1 1 1

After Apply LS-1 (left shift 2) 0 0 1 0 0 1 1 1 0 1


to each 5-bit group

permutation P8: 6 3 7 4 8 5 10 9

After applying permutation P8 : 1 1 1 0 1 0 1 0

KEY2

By: Dr. Mudassar Raza


ENCRYPTION

By: Dr. Mudassar Raza


ENCRYPTION

The encryption function can be seen as a composition


of functions:
IP-1 o fK2 o SW o fK1 o IP
• which can also be rewritten as
ciphertext = IP-1 ( fK2 ( SW ( fK1 ( IP ( plaintext ) ) ) ) )
• where
K1 = P8 ( Shift ( P10 ( key ) ) )
K2 = P8 ( Shift ( Shift ( P10 ( key ) ) )

By: Dr. Mudassar Raza


ENCRYPTION

1 2 3 4 5 6 7 8
Input: 1 0 1 0 0 1 0 1

Initial permutation IP 2 6 3 1 4 8 5 7

Apply Initial permutation IP


0 1 1 1 0 1 0 0
1 2 3 4

expansion/permutation
E/P to input 4 bits
4 1 2 3 2 3 4 1

Apply E/P: 0 0 1 0 1 0 0 0

By: Dr. Mudassar Raza


ENCRYPTION

Apply FKey1: FKey1(0 1 1 1 0 1 0 0) = ((0 1 1 1) XOR f(0 1 0 0, Key1), (0 1 0 0))


To compute f(0 1 0 0 , Key1):

(A) Apply E/P: 0 0 1 0 1 0 0 0

Key1: 0 0 1 0 1 1 1 1

(B) Add Key1: 0 0 0 0 0 1 1 1


1 2 3 4 1 2 3 4

(C) Pass left 4 bits through S0 and right four bits through S1:

0 1 2 3 0 1 2 3
0 1 0 3 2 0 0 1 2 3 The fisrt and last bit ow a row
1 3 2 1 0 1 2 0 1 3 specify the column and the
second and third bit the row of
2 0 2 1 3 2 3 0 1 0
the S-box. The entry at the
3 3 1 0 3 3 2 1 0 3 specified location is the 2-bit
output.
0 1 1 1
By: Dr. Mudassar Raza
ENCRYPTION
0 1 1 1 IP
0 1 1 1 0 1 0 0
permutation P4: 2 4 3 1

(D) Apply P4: 1 1 1 0

FKey1(0 1 1 1 0 1 0 0) = ((0 1 1 1) XOR (1 1 1 0) , (0 1 0 0)) =

xor 0 1 1 1

1 0 0 1

1 0 0 1 0 1 0 0

Apply SW:
0 1 0 0 1 0 0 1

By: Dr. Mudassar Raza


ENCRYPTION
Apply FKey2:
FKey2(0 1 0 0 1 0 0 1) = ((0 1 0 0) XOR f(1 0 0 1 , Key2), (1 0 0 1))
To compute f(1 0 0 1 , Key2):

(A) Apply E/P: 1 1 0 0 0 0 1 1

(B) Add Key2: 0 0 1 0 1 0 0 1

(C) Pass left 4 bits through S0 and right four bits through S1:

0 0 1 0

(D) Apply P4: 0 0 1 0

FKey2(0 1 0 0 1 0 0 1) = ((0 1 0 0) XOR (0 0 1 0) , (1 0 0 1)) =

0 1 1 0 1 0 0 1

Apply IP-1: 0 0 1 1 0 1 1 0

Which is 8 bit cipher text


By: Dr. Mudassar Raza
Thank You

By: Dr. Mudassar Raza

You might also like