Unit 2
Unit 2
Session: 2024-25
It consists of :
1. Initial Permutation
2. 16 Rounds
3. Round Key generator
4. Final Permutation
1. Initial Permutation
• It takes a 64-bit input and
permutes them according
to a predefined rule as
shown in Table.
2. Round Structure
• DES uses 16 rounds. Each round of DES
is a Feistel cipher, as shown in Figure.
• The round i takes Li−1 and Ri−1 from
previous round (or the initial
permutation box) and creates Li and Ri,
which go to the next round (or final
permutation box).
• The DES function F applies a 48-bit key
Ki to the rightmost 32 bits (Ri−1) to
produce a 32-bit output. This function
is made up of four sections:
1. An expansion P-box
2. A XOR Operation
3. A group of S-boxes, and
4. A straight P-box
a. Expansion permutation
a) Parity Drop
b) Shift Left
a) Parity Drop
a) It drops the parity bits
(bits 8, 16, 24, 32, …, 64)
b) The remaining 56-bit value is the actual cipher key which is used to generate
round keys.
Parity-bit drop table
b) Shift Left
• After the parity drop, the key is divided into two 28-bit parts. Each
part is shifted left (circular shift) one or two bits. In rounds 1, 2, 9, and
16, shifting is one bit; in the other rounds, it is two bits. The two parts
are then combined to form a 56-bit part.
Compression Permutation (P-Box)
• The compression permutation (P-box) changes the 58 bits to 48 bits,
which are used as a key for a round.
Importance of Feistal structure in DES
1. Simplicity of Design
• One of the main advantages of the Feistel structure is that encryption and decryption
use the same algorithm. In DES, the only difference between encryption and
decryption is the order in which the round keys are applied. This makes the design
efficient and elegant because no separate algorithm is needed for decryption. During
decryption, the keys are simply applied in reverse order, and the swapping of left and
right halves is maintained.
2. Confusion and Diffusion
• Confusion: This ensures that the relationship between the plaintext,
ciphertext, and encryption key is as complex as possible. In DES, confusion is
achieved through the substitution step in the round function. The round
function in DES includes S-boxes (substitution boxes), which perform a non-
linear transformation of the input.
• Diffusion: Diffusion ensures that the influence of each bit of the plaintext and
the key is spread across many bits of the ciphertext. The Feistel structure
enhances diffusion because every bit of the input can influence every bit of
the output after a few rounds. The permutation step in DES enhances this
diffusion, scrambling the bits to ensure widespread influence.
3. Key Symmetry and Reversibility
• The Feistel structure is symmetric, meaning that it allows for easy reversibility
of the process. In DES, once the encryption is complete, decryption can be
achieved by running the Feistel structure in reverse:
• In encryption, the round keys K1,K2,…,K16K_1, K_2, \dots, K_{16}K1,K2,…,K16
are applied in a forward direction.
• During decryption, the round keys are applied in reverse order
K16,K15,…,K1K_{16}, K_{15}, \dots, K_1K16,K15,…,K1.
• Because the Feistel structure only relies on the XOR operation (which is its
own inverse), the decryption process is simple and efficient. This is one of the
most important reasons why Feistel ciphers, like DES, are widely used.
4. Resistance to Cryptanalysis:
• The Feistel structure allows DES to withstand various types of attacks,
including differential and linear cryptanalysis. The repeated rounds and key
mixing ensure that even if a part of the input is known, recovering the key
remains difficult.
• Efficient Block Cipher Construction
The Feistel structure allows for the construction of a block cipher that is:
• Efficient: Feistel networks require simple operations like XOR and bit shifts,
making them suitable for implementation in hardware and software.
• Modular: The structure allows for a flexible number of rounds, which can be
increased to improve security without changing the basic framework.
• Block Cipher Foundation
• DES, based on the Feistel network, laid the groundwork for other block
ciphers, such as Triple DES (3DES) and later modern algorithms like AES
(though AES does not use a Feistel structure).
DES ANALYSIS
• Avalanche Effect
• 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
• Each bit of ciphertext depends on many bits of plaintext.
• Design Criteria
• The design of DES was revealed by IBM in 1994.
• S-Boxes, P-Boxes and 16 rounds.
DES Weaknesses
• Weakness has been found in the design of the cipher:
• Two chosen input to an S-box can create the same output.
• The purpose of initial and final permutation is not clear.
• Key Size: brute-force attack on a given ciphertext block, the adversary
needs to check 256 keys.
• Using parallel processing, we can test the whole key domain in approximately
20 hours
• In history:
• A special computer was built in 1998 that found the key in 112 hours.
• In 1977 a team of researchers used 3500 computers attached to the Internet to find a
key challenged by RSA Laboratories in 120 days.
Weak Keys
• A weak key is the one that, after parity drop operation, consists either of all
0s, all 1s, or half 0s and half 1s.
• The round keys created from any of these weak keys are the same and have
the same pattern as the cipher key.
• If we encrypt a block with a weak key and subsequently encrypt the result
with the same weak key, we get the original block.
Cryptanalysis
Various types of cryptanalytic attacks based on the amount of information
known to the cryptanalyst.
• Cipher text only – A copy of cipher text alone is known to the
cryptanalyst.
• Known plaintext – The cryptanalyst has a copy of the cipher text and the
corresponding plaintext.
• Chosen plaintext – The cryptanalysts gains temporary access to the
encryption machine. They cannot open it to find the key, however; they
can encrypt a large number of suitably chosen plaintexts and try to use
the resulting cipher texts to deduce the key.
• Chosen cipher text – The cryptanalyst obtains temporary access to the
decryption machine, uses it to decrypt several string of symbols, and tries
to use the results to deduce the key.
Double DES
• In this approach, we use two instances of DES ciphers for encryption
and two instances of reverse ciphers for decryption.
• Each instances use a different key.
• The size of the key is doubled.
• There are issues of reduction to single stage.
• However, double DES is vulnerable to meet-in-the-middle attack.
• Given a plaintext P and two encryption keys 𝐾1 and 𝐾2, a cipher text
can be generated as,
C = E(𝐾2, E(𝐾1, P))
• Decryption requires that the keys be applied in reverse order,
P = D(𝐾1, D(𝐾2, C))
• Reduction to single stage:
• DES is not a group; i.e., Double DES is not equivalent to DES encryption using
a single key.
• For example, the Caesar cipher is a group. If a message were encrypted with
the Caesar cipher with a key of 3 and then re-encrypted with the Caesar
cipher with a key of 5, the result is equivalent to encrypting the message with
the Caesar cipher with a key of 8. For the Caesar cipher, double encryption
does not increase security. DES is not a group; double encryption is not
equivalent to single encryption. Security does increase by double encryption,
but it does not increase much.
Meet-in-the–middle attack on Double DES
• At first glance, it looks like double
DES increases the number of tests
for key search from 256 (in single
DES) to 2112 (in double DES).
• Meet-in-the-middle attack proves
that double DES improves this
vulnerability slightly (to 257 tests).
Given a known pair, (P,C) , the attack proceeds as
follows.
• First, encrypt P for all 256 possible values of k1. M = Ek1 (P) M = Dk2 (C)
• Store these results in a table and then sort the
table by the values of M .
• Next, decrypt C using all 256 possible values of k2.
• As each decryption is produced, check the result
against the table for a match.
• If only one match occurs, then test the two
resulting keys against a new known plaintext–
ciphertext pair. If the two keys produce the correct
ciphertext, accept them as the correct keys.
• If more than two match, then take another
intercepted plaintext-ciphertext pair until finally
finds a unique pair.
• It has been proved that after applying the above
step to a few intercepted plaintext ciphertext pairs,
the keys are found. This means that instead of
using 2112 key-search tests, Attacker can use 256
key-search tests two times.
• In other words, moving from single DES to double
DES, we have increased the strength from 256 to
257.
Triple DES – 3DES
• 3DES was developed in 1999
• Uses three stages of DES for encryption and decryption.
• Two versions of triple DES
• Triple DES with Two Keys
• Triple DES with Three Keys
Triple DES with Two Keys
• The first and the third stages use
k1; the second stage uses k2.
• The middle stage uses decryption
(reverse cipher) in the encryption
site and encryption (cipher) in the
decryption site.
• Although triple DES with two keys
is also vulnerable to a known-
plaintext attack, it is much
stronger than double DES.
Triple DES with Three Keys
• Use three stages of DES
for encryption and
decryption with three
different keys.
• 3-key 3DES has an
effective key length of 168
bits
SECURITY OF DES
1. Brute-Force Attack: it is clear that DES can be broken using 256
encryptions. However, today most applications use either 3DES with
two keys (key size of 112) or 3DES with three keys (key size of 168).
These two multiple-DES versions make DES resistant to brute-force
attacks.
2. Differential Cryptanalysis
3. Linear Cryptanalysis
Linear Cryptanalysis
• Linear cryptanalysis examines the linear connection between the plaintext,
ciphertext, and encryption key. Linear cryptanalysis is constructing linear
equations using known plaintext and ciphertext combinations to obtain the
encryption key.
• Linear cryptanalysis is a known plaintext attack that involves discovering
affine approximations to the target cipher’s action. The attacker studies the
probabilistic linear relations, referred to as linear approximations, between
plaintext parity bits, the ciphertext, and the target’s secret key. This attack
is one of the most common attacks employed against block ciphers.
• In addition, to use linear cryptanalysis properly, we must build a strong
correlation between the plaintext and the ciphertext.
• Advantages:
• It requires minimal computational resources and can be performed with
relatively small amounts of data.
• Limitations:
• It’s less effective against ciphers that use a non-linear substitution box (S-box).
• it also requires a considerable amount of known plaintext-ciphertext pairs
• Example:
Differential Cryptanalysis
• Differential cryptanalysis was not reported in the open literature until
1990. Differential cryptanalysis is the first published attack that is capable
of breaking DES in less than 255 encryptions.
• Differential cryptanalysis is a choosen plaintext attack used to break
encryption systems by analysing the differences between pairs of plaintexts
and ciphertext.
• Differential cryptanalysis examines the differences between pairs of
plaintext and ciphertext blocks to figure out how they differ. Finding pairs
of plaintexts that only differ by one bit is the first step in the process. The
second step involves examining the difference in the corresponding
ciphertext blocks.
• It must be remembered establishing a high correlation between the
differences in plaintext and the differences in the ciphertext is essential for
the technique to be successful. This method is particularly effective for
attacking substitution-permutation networks-based ciphers like AES and
DES.
• Advantages
• The ability to attack ciphers that use non-linear S-boxes is one of the key
advantages of the differential method. It’s also relatively efficient and
requires fewer plaintext-ciphertext pairs than other cryptanalytic techniques.
• Additionally, differential cryptanalysis has shown to be successful in breaching
a variety of block ciphers and successfully attacking a wide range of
cryptographic systems.
• Limitations
• Despite its many advantages, the differential technique has several
limitations. For instance, this method is less effective against ciphers with a
small block size or a limited number of rounds.
• Furthermore, this method requires many plaintext-ciphertext pairs with
specific characteristics. This can be a limitation when trying to attack systems
with limited data. Finally, it’s susceptible to noise and randomisation,
significantly affecting the attack’s success rate.
Example