Block Cipher Principles and the Data Encryption Standard (DES)

Cryptography and Block Cipher Principles

  • Modern Block Ciphers: These are among the most widely used types of cryptographic algorithms and are essential for providing secrecy and authentication services.
  • Data Encryption Standard (DES): This serves as the primary focus to illustrate fundamental block cipher design principles.
  • Encryption Methodology: Block ciphers encrypt data one block at a time, unlike stream ciphers which process data bit by bit.
  • Applications: Block ciphers are utilized in a broader range of applications compared to stream ciphers.
  • Block Size: Typical block sizes for modern algorithms range from 6464 to 128128 bits.
  • Feistel Block Cipher: Most current block cipher algorithms are based on the Feistel cipher structure.

Comparison of Block and Stream Ciphers

  • Stream Ciphers:
    • Process data as a continuous bit stream (PiP_i).
    • Utilize a key (KK) and an algorithmic bit stream generator to produce a cryptographic bit stream (kik_i).
    • Ciphertext (CiC_i) is produced by a bitwise XOR transition: Pi⊕ki=CiP_i \oplus k_i = C_i.
  • Block Ciphers:
    • Process data in fixed-length segments called blocks of length bb bits.
    • Apply an encryption algorithm using a key (KK) to the entire block of plaintext to produce a block of ciphertext of equal length (bb bits).

Block Cipher Principles and the Ideal Block Cipher

  • General Principles:
    • An nn-bit block cipher takes an nn-bit plaintext and produces an nn-bit ciphertext.
    • There are 2n2^n possible different plaintext blocks.
    • Encryption must be reversible, meaning decryption is possible.
    • To be reversible, each plaintext block must map to a unique ciphertext block (one-to-one mapping).
    • The total number of possible transformations is (2n)!(2^n)!.
  • The Ideal Block Cipher:
    • The key is essentially the mapping table itself.
    • Key length for an ideal block cipher is (2n×n)(2^n \times n).
    • Example: For a 44-bit block, the key length is 24×4=16×4=642^4 \times 4 = 16 \times 4 = 64 bits (formed by concatenating all bits of the ciphertext table).
  • Problems with Ideal Block Ciphers:
    • Small Block Size: If nn is small (e.g., 44), it is equivalent to a classical substitution cipher, making cryptanalysis based on statistical characteristics feasible.
    • Large Block Size: To be secure, nn must be large, but this causes the key length to grow exponentially. For an actual block size of at least 6464 bits, the key length would be 264×64≈10212^{64} \times 64 \approx 10^{21} bits, causing implementation and performance issues.

Feistel Cipher Structure and Design Concepts

  • Feistel's Proposal: Feistel proposed applying two or more simple ciphers in sequence so the final result is cryptographically stronger than the component ciphers. This involves alternating substitutions and transpositions (permutations).
  • Feistel Parameters:
    • Block length: nn bits.
    • Key length: kk bits.
    • Transformations: 2k2^k (rather than (2n)!(2^n)!).
  • Shannon’s Concepts:
    • Diffusion: Reducing the statistical nature of the plaintext in the ciphertext. One plaintext letter should affect the value of many ciphertext letters. This is achieved by repeatedly applying permutations (transpositions) to the data followed by a function.
    • Confusion: Making the relationship between the ciphertext and the key as complex as possible. Use complex, non-linear substitution algorithms so that even if statistical characteristics of the ciphertext are found, the key remains difficult to deduce.
  • Feistel Construction Approach:
    • The plaintext is split into two halves: Left (LL) and Right (RR).
    • Subkeys (round keys KiK_i) are generated from the main key.
    • A round function FF is applied to the right half with the subkey.
    • Substitution is performed on the left half using an XOR operation with the output of FF.
    • A permutation (interchange) of the two halves is performed.
  • Design Trade-offs: Factors include block size (64,12864, 128 bits), key size (e.g., 128128 bits), number of rounds (e.g., 1616), subkey generation complexity, and round function complexity. The primary trade-off is security versus performance.

Data Encryption Standard (DES) Overview

  • General Properties:
    • Symmetric block cipher.
    • 6464-bit input/output block size.
    • 5656-bit key length (nominally 6464-bit, but 88 bits are used for parity).
  • History: Developed in 1977 by NBS (now NIST). Designed primarily by IBM (based on the Lucifer cipher) with input from the NSA.
  • Algorithm Structure:
    • Initial Permutation (IP): The first step, reordering the bits of the 6464-bit input.
    • 16 Rounds of Processing: Each round involves subkey generation and the Feistel function.
    • 32-bit Swap: After the 16th round, the left and right halves are swapped.
    • Inverse Initial Permutation (IP−1IP^{-1}): The final step of the algorithm.

DES Round Structure and Mathematical Components

  • Expansion/Permutation (E table): Expands the 3232-bit right half of the data to 4848 bits to match the subkey length.
  • Subkey Mixed XOR: The 4848-bit expanded data is XORed with the 4848-bit subkey (KiK_i).
  • Substitution/Choice (S-boxes): The 4848-bit result is fed into eight S-boxes. Each S-box takes 66 bits as input and produces 44 bits as output, resulting in a 3232-bit total output.
    • S-boxes provide the non-linearity to the cipher and are considered the most secure part of DES.
  • Permutation (P table): A 3232-bit permutation is applied to the output of the S-boxes to increase diffusion.
  • Mathematical Representation of a Round:
    • Li=Ri−1L_i = R_{i-1}
    • Ri=Li−1⊕F(Ri−1,Ki)R_i = L_{i-1} \oplus F(R_{i-1}, K_i)

DES Key Schedule Calculation

  • Permuted Choice 1 (PC-1): The initial 6464-bit key is reduced to 5656 bits by selecting specific bits and discarding parity bits (8,16,24,32,40,48,56,648, 16, 24, 32, 40, 48, 56, 64).
  • Left Circular Shifts: The 5656 bits are split into two 2828-bit halves. In each round, these halves are shifted left. Rounds 1,2,9,1, 2, 9, and 1616 involve a single shift, while others involve two shifts.
  • Permuted Choice 2 (PC-2): After shifting, 4848 bits are selected from the 5656 bits to serve as the subkey (KiK_i) for that round.

The Avalanche Effect

  • Definition: A small change in either the plaintext or the key should produce a significant change in the ciphertext.
  • DES Performance:
    • A 11-bit change in plaintext results in approximately 3232 output bits changing after 16 rounds.
    • Example:
      • Plaintext 1: 02468aceeca86420
      • Plaintext 2: 12468aceeca86420 (1 bit difference)
      • Ciphertext difference after IP-1: 3232 bits.
    • A 11-bit change in the key results in approximately 3030 output bits changing.

Security and Attacks on DES

  • Brute Force Resistance:
    • 256≈7.2×10162^{56} \approx 7.2 \times 10^{16} possible keys.
    • In 1977, it was estimated that a machine costing 2020 million USD could break it in 1010 hours.
    • In 1998, the Electronic Frontier Foundation (EFF) built a machine for 250,000250,000 USD that broke DES in 33 days.
    • Today, 5656 bits is considered too short to withstand brute force.
  • Analytical Attacks:
    • Timing Attacks: Information gained by observing how long decryption takes. No known useful attacks on DES.
    • Differential Cryptanalysis: Observes how pairs of plaintext blocks evolve. Can break DES in 2472^{47} operations, but requires 2472^{47} chosen plaintexts.
    • Linear Cryptanalysis: Finds linear approximations of transformations. Can break DES using 2432^{43} known plaintexts.

Average Time Required for Exhaustive Key Search

Key Size (bits)CipherNumber of Alternative KeysTime at 10910^9 decryptions/sTime at 101310^{13} decryptions/s
5656DES256=7.2×10162^{56} = 7.2 \times 10^{16}2.152.15 hours1.1251.125 years
128128AES2128=3.4×10382^{128} = 3.4 \times 10^{38}5.3×10215.3 \times 10^{21} years5.3×10175.3 \times 10^{17} years
168168Triple DES2168=3.7×10502^{168} = 3.7 \times 10^{50}5.8×10335.8 \times 10^{33} years5.8×10295.8 \times 10^{29} years
192192AES2192=6.3×10572^{192} = 6.3 \times 10^{57}9.8×10409.8 \times 10^{40} years9.8×10369.8 \times 10^{36} years
256256AES2256=1.2×10772^{256} = 1.2 \times 10^{77}1.8×10601.8 \times 10^{60} years1.8×10561.8 \times 10^{56} years
2626 charactersMonoalphabetic26!=4×102626! = 4 \times 10^{26}6.3×1096.3 \times 10^9 years6.3×1066.3 \times 10^6 years

Multiple Encryption and Variations of DES

  • Double DES: Uses two 5656-bit keys for a total length of 112112 bits. However, it is vulnerable to the Meet-in-the-middle attack, making it not much better than single DES.
  • Triple DES (3DES):
    • With 2 keys: Provides a brute force resistance of 21122^{112}.
    • With 3 keys: Provides a brute force resistance of 21682^{168}.
    • Maintains compatibility with DES software and equipment while increasing key length to 128 bits (or higher).