Block Ciphers
Block Ciphers
Block Ciphers
Prepared By
Dr. L. Mary Shamala
Assistant Professor
Feistel Cipher
• Most symmetric block ciphers are based on a Feistel Cipher
Structure
• Horst Feistel devised the feistel cipher based on concept of
invertible product cipher
• Implements Shannon’s substitution-permutation network.
• In 1949, Claude Shannon introduced idea of substitution-
permutation (S-P) networks (Product Ciphers)
• substitution (S-box)
• permutation (P-box)
• Provide confusion and diffusion of message
VIT/SCOPE/CNS/Module 2 2
A Round in Feistel Cipher
VIT/SCOPE/CNS/Module 2 3
Simplified DES (S-DES)
• Developed by Professor Edward Schaefer of Santa Clara University
• An educational tool designed to help students learn the structure of
DES using cipher blocks and keys with a small number of bits.
VIT/SCOPE/CNS/Module 2 4
General structure of S-DES Encryption
VIT/SCOPE/CNS/Module 2 5
Key Generation for S-DES
VIT/SCOPE/CNS/Module 2 6
Key Generation for S-DES …
Cipher Key 1011100110
After permutation 1100101110
After splitting L: 11001 R: 01110
Round 1:
Shifted keys: L: 10011 R: 11100
Combined key: 1001111100
Round Key 1: 10111100
Round 2:
Shifted keys: L: 01110 R: 10011
Combined key: 0111010011
Round Key 2: 11010011VIT/SCOPE/CNS/Module 2 8
S-DES encryption
1. Initial and Final Permutations
• Plaintext:11110011
• Permuted output: 10111101
VIT/SCOPE/CNS/Module 2 10
S-DES encryption
• Rounds
• S-DES uses two rounds.
• Each round of S-DES is a Feistel cipher
VIT/SCOPE/CNS/Module 2 11
S-DES encryption
• S-DES Function
• The heart of S-DES is the S-DES function.
• The S-DES function applies an 8-bit key to the
rightmost 4 bits to produce a 4-bit output
• Example
• Permuted output :10111101
• F(1101,SK)=1110 for some key SK
• Then fk(10111101)=(1011) XOR (1110),1101
=01011101
VIT/SCOPE/CNS/Module 2 12
S-DES encryption
• Expansion P-box
• Example: R= 1101
E/P output = 11101011
VIT/SCOPE/CNS/Module 2 13
S-DES encryption
• S-boxes
VIT/SCOPE/CNS/Module 2 15
Simplified DES
VIT/SCOPE/CNS/Module 2 17
Data Encryption Standard
• The Data Encryption Standard (DES) is a symmetric-key block
cipher published by the National Institute of Standards and
Technology (NIST).
• Encrypts 64-bit data using 56-bit key
• Most widely used block cipher in world
VIT/SCOPE/CNS/Module 2 18
DES History
• IBM developed Lucifer cipher
• by team led by Feistel
• used 64-bit data blocks with 128-bit key
• Redeveloped as a commercial cipher with input from NSA and others
• In 1973, NIST issued request for proposals for a national cipher
standard
• IBM submitted their revised Lucifer which was eventually accepted as
the DES
VIT/SCOPE/CNS/Module 2 19
Data Encryption Standard
(DES)
• Adopted in 1977 by NBS (now NIST) as Federal Information Processing
Standard(FIPS) 46
• Has considerable controversy over design
• in choice of 56-bit key (vs Lucifer 128-bit)
• design criteria were classified
• Subsequent events and public analysis show in fact design was
appropriate
• DES has become widely used, especially in financial applications
• NIST defines DES as the standard for use in unclassified applications.
VIT/SCOPE/CNS/Module 2 20
General structure of DES
• The encryption process is made of:
• 2 permutations (P-boxes)
• 16 Feistel rounds.
• Each round uses a different 48-bit
round key
VIT/SCOPE/CNS/Module 2 21
Initial and final permutations
VIT/SCOPE/CNS/Module 2 23
Initial and final permutations …
VIT/SCOPE/CNS/Module 2 24
DES Rounds
• DES uses 16 rounds.
• Each round of DES is a Feistel cipher
• Uses two 32-bit L & R halves
• Feistel cipher can be described as:
Li = Ri–1
Ri = Li–1 xor F(Ri–1, Ki)
VIT/SCOPE/CNS/Module 2 26
DES Function
• The heart of DES is the DES function.
• The DES function applies a 48-bit key to the
rightmost 32 bits (Ri–1) to produce a 32-bit
output.
• This function is made up of four sections:
• an expansion P-box,
• a whitener (that adds key)
• a group of S-boxes
• a straight P-box
VIT/SCOPE/CNS/Module 2 27
Substitution Boxes
• The S-boxes do the real mixing (confusion).
• Have eight S-boxes which map 6 to 4 bits
VIT/SCOPE/CNS/Module 2 28
S-Boxes…
• S-box rule
• Example:
S(18 09 12 3d 11 17 38 39) = 5fd25e03
VIT/SCOPE/CNS/Module 2 29
S-box 1
S-box 2
S-box 3
VIT/SCOPE/CNS/Module 2 30
S-box 4
S-box 5
S-box 6
VIT/SCOPE/CNS/Module 2 31
S-box 7
S-box 8
VIT/SCOPE/CNS/Module 2 32
Straight Permutation
• The last operation in the DES function is a straight permutation with a 32-bit
input and a 32-bit output.
VIT/SCOPE/CNS/Module 2 33
Key Generation
VIT/SCOPE/CNS/Module 2 34
Key generation
Parity-bit drop table
• The compression permutation (P-box) changes the 58 bits to 48 bits, which are
used as a key for a round.
VIT/SCOPE/CNS/Module 2 35
Key generation
shift left
VIT/SCOPE/CNS/Module 2 36
Key generation
compression permutation
• The compression permutation (P-box) changes the 58 bits to 48 bits, which are
used as a key for a round.
Key-compression table
VIT/SCOPE/CNS/Module 2 37
DES Decryption
• Decryption uses the same algorithm as encryption, except that the application of
the subkeys is reversed.
• Additionally, the initial and final permutations are reversed.
VIT/SCOPE/CNS/Module 2 38
DES Example
• Plaintext: 123456ABCD132536
• Key: AABB09182736CCDD
• CipherText: C0B7A8D05F3A829C
VIT/SCOPE/CNS/Module 2 39