3 Symmetric Encryption

Information Security · Unit 3

Symmetric Encryption

Exam-focused notes for Symmetric Encryption (Information Security, BIT303): what the TU syllabus asks and how it has actually been tested, with 4 solved past questions from this unit.

Symmetric Encryption in short

Symmetric encryption uses one shared secret key for both locking and unlocking data. It is fast, so it protects most of the data we send and store. This chapter covers the main principles, the DES block cipher and the Hill cipher.

Symmetric Encryption: notes

Symmetric cryptography principles

In symmetric (secret key) cryptography the sender and receiver share the same key $K$.

$$C = E_K(P), \qquad P = D_K(C)$$

Here $P$ is plaintext, $C$ is ciphertext, $E$ is encryption and $D$ is decryption.

Parts of a symmetric system: plaintext, encryption algorithm, secret key, ciphertext and decryption algorithm. The algorithm can be public. Only the key must stay secret (Kerckhoffs' principle).

Two kinds of cipher:

  • Block cipher: works on fixed blocks (DES uses 64 bits, AES uses 128 bits).
  • Stream cipher: works on one bit or byte at a time, with a key stream (RC4 is an example).

Two ideas of Shannon make a strong cipher:

  • Confusion: make the link between key and ciphertext complex (substitution).
  • Diffusion: spread the effect of one plaintext bit over many ciphertext bits (permutation).

Advantages: fast and good for large data. Problems: the key must be shared safely, and $n$ users need $n(n-1)/2$ keys for pairwise secrecy.

DES algorithm and round operations

The Data Encryption Standard (DES) is a block cipher with a 64-bit block and a 56-bit key (64 bits with 8 parity bits). It uses 16 rounds of a Feistel structure.

Overall flow of encryption:

  • The 64-bit plaintext goes through the Initial Permutation (IP).
  • The result is split into a left half $L_0$ and a right half $R_0$, each 32 bits.
  • Sixteen rounds are applied, each with its own 48-bit sub-key.
  • The halves are swapped after round 16.
  • The Final Permutation (the inverse of IP) gives the 64-bit ciphertext.

Each round follows:

$$\begin{aligned} L_i &= R_{i-1} \ R_i &= L_{i-1} \oplus f(R_{i-1}, K_i) \end{aligned}$$

The function $f$ does four things:

  • Expansion (E): the 32-bit $R$ is expanded to 48 bits by repeating some bits.
  • Key mixing: the 48 bits are XORed with the sub-key $K_i$.
  • Substitution: eight S-boxes turn the 48 bits into 32 bits.
  • Permutation (P): the 32 bits are rearranged.

What this unit covers

  • Symmetric cryptography principles
  • DES algorithm and round operations
  • DES sub-key generation
  • S-box operations in DES
  • DES encryption and decryption
  • Hill cipher and matrix operations

DES encryption and decryption

2081 · 10 marks

Discuss how encryption and decryption is done in the DES algorithm.[10]

DES (Data Encryption Standard) is a symmetric-key block cipher developed by IBM and adopted as a federal standard by NIST in 1977. It encrypts data in 64-bit blocks using a 56-bit key and performs 16 rounds of substitution and permutation operations. --- Parameter Value ------------------ Block S...

Open this answer on its own page →

S-box operations in DES

2081 · 5 marks

What is the use of S-box in DES? Illustrate S-box operation with an example. [5]

Show solved answer

S-Box in DES (Data Encryption Standard)

Given

This is a conceptual/illustrative question. The only numeric data needed comes from the standard DES S-box specification (the S1 table) and a chosen example input. No numeric data is supplied in the question itself, so I use the standard DES S1 table and the classic textbook example input 011011.

Standard S1 table (from DES specification):

Row\Col0123456789101112131415
01441312151183106125907
10157414213110612119538
24114813621115129731050
31512824917511314100613

Example input: 011011


Solution

Use of S-Box in DES

An S-Box (Substitution Box) is the heart of the DES round function and is its only non-linear component. Its purposes are:

  1. Confusion: It hides the statistical relationship between plaintext, key, and ciphertext (Shannon's confusion principle).
  2. Non-linearity: Since XOR, permutation, and expansion in DES are all linear, the S-boxes are what make DES resistant to linear and differential cryptanalysis.
  3. Compression: Each S-box maps a 6-bit input to a 4-bit output, so the 8 S-boxes together reduce 48 bits → 32 bits in each round.
  4. Avalanche effect: A single-bit change at the input propagates to many output bits, giving DES its cryptographic strength.

DES uses 8 S-boxes (S1-S8), each with its own $4 \times 16$ lookup table.

S-Box Operation Rule

For a 6-bit input $b_1 b_2 b_3 b_4 b_5 b_6$:

  • Row = decimal value of the outer bits $b_1 b_6$ (range 0-3)
  • Column = decimal value of the middle 4 bits $b_2 b_3 b_4 b_5$ (range 0-15)
  • Output = 4-bit binary of the table entry at (row, column)

Worked Example (using S1, input 011011)

Bits:

$$b_1 b_2 b_3 b_4 b_5 b_6 = 0;1;1;0;1;1$$

Row = $b_1 b_6 = 01_2 = 1$

Column = $b_2 b_3 b_4 b_5 = 1101_2 = 13$

Lookup:

$$S1[\text{row}=1][\text{col}=13] = 5$$

Output (4-bit):

$$5_{10} = 0101_2$$

Result

$$\boxed{\text{Input } 011011 ;\rightarrow; \text{Output } 0101}$$

Thus a 6-bit block is substituted and compressed into a 4-bit block, providing the essential non-linear confusion in DES.

Open this answer on its own page →

DES algorithm and round operations

2079 · 10 marks

What is symmetric cryptography? Explain round operation of DES algorithm. Describe Sub-Key generation process for DES rounds.[10]

Note: No curriculum notes were found for this topic. The answer below is based on standard, well-established cryptography curriculum content as taught in BSc CSIT programs. --- Symmetric cryptography (also called secret-key or conventional cryptography) is a type of encryption where the same key ...

Open this answer on its own page →

Hill cipher and matrix operations

2079 · 5 marks

Decrypt the cipher text "CRHG" using the Hill cipher with the key matrix $$\begin{bmatrix} 3 & 4 \ 3 & 5 \end{bmatrix}$$. [5]

  • Ciphertext: CRHG - Key matrix: $K = \begin{bmatrix} 3 & 4 \ 3 & 5 \end{bmatrix}$ - Alphabet mapping: A = 0, B = 1, ..., Z = 25 - Modulus: 26 C R H G ------------ 2 17 7 6 Column vectors: $\begin{bmatrix}2\17\end{bmatrix}$, $\begin{bmatrix}7\6\end{bmatrix}$ $$\det(K) = (3)(5) - (4)(3) = 15 - ...
Open this answer on its own page →