2 Symmetric Ciphers

Cryptography · Unit 2 · 10 hrs

Symmetric Ciphers

Exam-focused notes for Symmetric Ciphers (Cryptography, CSC327): what the TU syllabus asks and how it has actually been tested, with 14 solved past questions from this unit.

Symmetric Ciphers in short

Where Unit 1 covered ciphers that operate on individual letters, this unit covers the ciphers built from bits and bytes that dominate modern practice: the Feistel and substitution-permutation network structures, DES and its multiple-encryption variants, the finite-field arithmetic that AES and other block ciphers rely on, IDEA, AES itself, and the standard modes used to apply any block cipher to a message longer than one block.

Symmetric Ciphers: notes

Fiestel Cipher Structure

The Feistel structure, proposed by Horst Feistel and used in DES, builds an invertible cipher out of a round function that need not itself be invertible. The input block is split into two equal halves, $L_0$ and $R_0$. Each round $i$ computes

$$ L_i = R_{i-1}, \qquad R_i = L_{i-1} \oplus F(R_{i-1}, K_i), $$

where $F$ is the round function (mixing the right half with the round subkey $K_i$) and $\oplus$ is bitwise XOR. After the last round the two halves are swapped to form the ciphertext. Decryption reuses the identical structure with the subkeys applied in reverse order ($K_n$ first, then $K_{n-1}$, and so on), because each round's XOR is its own inverse: given $R_i$ and $L_i$, the previous round's halves are recovered as $R_{i-1} = L_i$ and $L_{i-1} = R_i \oplus F(L_i, K_i) = R_i \oplus F(R_{i-1}, K_i)$. This is precisely why $F$ itself never needs to be invertible, only the surrounding XOR-and-swap wrapper does, which frees the round function's S-boxes to be any non-linear mapping that resists cryptanalysis, without the constraint of also being invertible.

Substitution Permutation Network (SPN)

A substitution-permutation network (SPN), the structure Claude Shannon described as combining confusion and diffusion, builds a round out of two alternating layers applied directly to the whole block (not to one half at a time as in Feistel): a substitution layer, usually a set of small invertible S-boxes that each replace a few bits with a non-linearly related output, providing confusion by hiding the relationship between key and ciphertext, and a permutation (or linear mixing) layer that spreads the output bits of one S-box across the inputs of several S-boxes in the next round, providing diffusion by spreading the influence of each plaintext or key bit across the whole block. Because the substitution layer of an SPN is applied to the full block rather than half of it, every S-box in an SPN must itself be invertible, so that the whole round can be run backward during decryption; this is the key structural difference from a Feistel network, where only the wrapper, not the round function, needs to be invertible. AES, covered later in this unit, is the standard example of an SPN cipher.

Data Encryption Standards (DES)

The Data Encryption Standard (DES) was adopted as a U.S. Federal Information Processing Standard in 1977. It is a Feistel block cipher operating on 64-bit blocks with a 56-bit effective key (carried in a 64-bit key field, of which every 8th bit is a parity bit and is discarded), producing 64 bits of ciphertext from 64 bits of plaintext. Processing has three phases: the 64-bit plaintext first passes through an initial permutation (IP) that only rearranges bit positions; then 16 identical Feistel rounds run, each combining the current right half with a 48-bit round subkey through the round function and XORing the result into the left half; finally the two halves are swapped and passed through the inverse initial permutation ($IP^{-1}$) to produce the ciphertext. On the key side, the 56-bit key (after parity removal) is split into two 28-bit halves, $C_0$ and $D_0$; each round left-circular-shifts both halves by one or two bits according to a fixed per-round schedule, and a compression permutation selects 48 of the resulting 56 bits as that round's subkey $K_i$. DES decryption reuses the same overall algorithm with the 16 subkeys applied in reverse order, exactly as in any Feistel cipher, and with the initial and final permutations likewise reversed. A small set of weak keys exist, keys whose key schedule produces the same 16 round subkeys (so that encrypting twice with such a key is the identity map): the all-zero key, the all-one key, and the two alternating patterns (half the key all zeros and the other half all ones, in each order).

Double DES

Double DES encrypts twice with two independent 56-bit keys, $C = E(K_2, E(K_1, P))$, and decrypts as $P = D(K_1, D(K_2, C))$. Its intended security is $2^{112}$, but the meet-in-the-middle attack shows the real strength is far lower, only a small factor above single DES's $2^{56}$. The attack rests on the observation that if $C = E(K_2, E(K_1, P))$ then the intermediate value $X = E(K_1, P) = D(K_2, C)$: given one known plaintext-ciphertext pair $(P, C)$, the attacker encrypts $P$ under all $2^{56}$ possible values of $K_1$ and stores the results, sorted by the resulting $X$ value, in a table; then decrypts $C$ under all $2^{56}$ possible values of $K_2$ and looks each result up in the table. Any match gives a candidate key pair $(K_1, K_2)$, which is then confirmed (or eliminated, since false matches occur by chance) against a second known plaintext-ciphertext pair. The attack costs about $2^{56}$ encryptions plus $2^{56}$ decryptions and a table of $2^{56}$ entries, i.e. $O(2^{56})$ time and space rather than the $O(2^{112})$ an exhaustive key search over the full double-length key would need, which is why double DES is not considered meaningfully stronger than single DES and is not used in practice.

What this unit covers

  • Fiestel Cipher Structure
  • Substitution Permutation Network (SPN)
  • Data Encryption Standards (DES)
  • Double DES
  • Triple DES
  • Finite Fields: Groups Rings, Fields, Modular Arithmetic, Euclidean Algorithm, Galois Fields (GF(p) & GF(2n)), Polynomial Arithmetic
  • International Data Encryption Standard (IDEA)
  • Advanced Encryption Standards (AES) Cipher
  • Modes of Block Cipher Encryptions (Electronic Code Book, Cipher Block Chaining, Cipher Feedback Mode, Output Feedback Mode, Counter Mode)

Fiestel Cipher Structure

2082

Feistel Cipher Structure and AES Key Expansion

Show solved answer

Feistel Cipher Structure and AES Key Expansion

Part A: Feistel Cipher Structure

A Feistel Cipher is a symmetric block cipher design that splits a plaintext block into two equal halves and processes them through several rounds of substitution and permutation using round sub-keys derived from the master key.

Working

A block of $2w$ bits is divided into $L_0$ (left) and $R_0$ (right).

For each round $i$:

$$L_i = R_{i-1}$$ $$R_i = L_{i-1} \oplus F(R_{i-1}, K_i)$$

where $K_i$ is the round sub-key and $F$ is the round function (which need not be invertible).

Block Diagram (words)

  • Split plaintext into $L_0$ and $R_0$.
  • Feed $R_0$ and $K_1$ into $F$.
  • XOR $F$ output with $L_0 \Rightarrow R_1$.
  • $R_0$ becomes $L_1$ (swap).
  • Repeat for $n$ rounds; recombine $L_n, R_n$ into ciphertext.

Key Properties

  • Same structure for encryption and decryption (sub-keys reversed for decryption).
  • $F$ need not be invertible.
  • Security grows with more rounds.
  • Examples: DES (16 rounds), Blowfish, Camellia.

Part B: AES Key Expansion - First 4 Bytes After First Iteration

Given Data

Key (16 bytes) grouped into 4 words:

WordBytes
$W_0$2B 7E 15 16
$W_1$28 AE D2 A6
$W_2$AB F7 97 66
$W_3$01 02 03 04

S-Box row 0 provided (sufficient, since all bytes being substituted have upper nibble 0).

Formula

$$W_4 = W_0 \oplus g(W_3)$$

Step 1: RotWord of $W_3 = [01,02,03,04]$: $$[02,\ 03,\ 04,\ 01]$$

Step 2: SubBytes (row 0 of S-Box):

ByteS-Box
02 → col 277
03 → col 37B
04 → col 4F2
01 → col 17C

$$[77,\ 7B,\ F2,\ 7C]$$

Step 3: XOR Rcon(1) = [01,00,00,00]: $$[77\oplus01,\ 7B,\ F2,\ 7C] = [76,\ 7B,\ F2,\ 7C]$$

So $g(W_3) = [76, 7B, F2, 7C]$.

Step 4: Compute $W_4 = W_0 \oplus g(W_3)$:

$W_0$$g(W_3)$XOR
2B765D
7E7B05
15F2E7
167C6A

Verification of first byte: $2B = 0010,1011$, $76 = 0111,0110$, XOR $= 0101,1101 = 5D$. ✓

Final Answer

$$\boxed{W_4 = [5D,\ 05,\ E7,\ 6A]}$$

The first 4 bytes of the next key after the first iteration are 5D 05 E7 6A.

Open this answer on its own page →

Modes of Block Cipher Encryptions

2082 · 5 marks

Explain any two modes of block cipher encryption. [5]

A block cipher encrypts data in fixed-size blocks. When a message is longer than one block, a mode of operation defines how the cipher is applied repeatedly. Two important modes are described below. --- Definition: In ECB mode, the plaintext is divided into fixed-size blocks, and each block is en...

Open this answer on its own page →

2081 · 5 marks

Describe the different modes of block cipher. [5]

A block cipher encrypts a fixed-size block of plaintext into a block of ciphertext using a key. However, most real-world messages are longer than a single block, so different modes of operation define how to apply the block cipher repeatedly to encrypt longer messages. The five standard modes of ...

Open this answer on its own page →

International Data Encryption Standard

2081

Tracing the First Full Round of IDEA Algorithm

IDEA (International Data Encryption Algorithm) is a symmetric block cipher that operates on 64-bit plaintext blocks using a 128-bit key, performing 8 identical rounds with operations: multiplication modulo $2^{16}+1$, addition modulo $2^{16}$, and XOR.

Subkeys (4-bit each): - $K1 = 1100 = 12$ - $K2 = 1010 = 10$ - $K3 = 0000 = 0$ - $K4 = 1111 = 15$ - $K5 = 0101 = 5$ - $K6 = 1001 = 9$ Input plaintext blocks (4-bit each): - $X1 = 1011 = 11$ - $X2 = 1110 = 14$ - $X3 = 1011 = 11$ - $X4 = 1000 = 8$ Scaled operations (n = 4): - Multiplication $\odot$ ...

Open this answer on its own page →

2079 · 5 marks

How encryption is done using IDEA algorithm. [5]

IDEA (International Data Encryption Algorithm) is a symmetric block cipher that: - Operates on 64-bit plaintext blocks - Uses a 128-bit key - Performs 8 rounds of encryption followed by a final output transformation - Uses three algebraic operations: XOR, addition mod 2^16, and multiplication mod...

Open this answer on its own page →

2076 · 10 marks

Cryptography Question

Among monoalphabetic and polyalphabetic cipher, which one is more vulnerable? Justify your statement. Which types of keys are considered weak keys in DES? Explain the round operation in IDEA.[10]

Show solved answer

Cryptography: Monoalphabetic vs Polyalphabetic, DES Weak Keys, and IDEA Round Operation


Part A: Monoalphabetic vs Polyalphabetic, Which is More Vulnerable?

Monoalphabetic cipher is more vulnerable than polyalphabetic cipher.

Definition

  • Monoalphabetic Cipher: A substitution cipher where each plaintext letter is always replaced by the same fixed ciphertext letter throughout the entire message. Example: Caesar Cipher.
  • Polyalphabetic Cipher: A substitution cipher that uses multiple substitution alphabets in rotation. Example: Vigenere Cipher.

Justification

FeatureMonoalphabeticPolyalphabetic
Substitution alphabets usedSingle fixed alphabetMultiple alphabets in rotation
Letter frequency preserved?YesNo (flattened)
Vulnerable to frequency analysis?Yes, easilyMuch harder
Security levelLowHigher

Why monoalphabetic is weaker:

  1. Since every occurrence of a plaintext letter maps to the same ciphertext letter, the statistical frequency distribution of the original language is preserved in the ciphertext.
  2. An attacker can perform frequency analysis: in English, 'E' appears ~13% of the time, 'T' ~9%, etc. By counting ciphertext letter frequencies and matching them to known language frequencies, the key can be recovered without brute force.
  3. In polyalphabetic ciphers, the same plaintext letter is encrypted differently depending on its position (e.g., 'E' may become 'H' at one position and 'R' at another). This flattens the frequency distribution, making frequency analysis ineffective.

Conclusion

Monoalphabetic cipher is significantly more vulnerable because its one-to-one fixed mapping leaks the statistical patterns of the plaintext language, allowing easy cryptanalysis through frequency analysis.


Part B: Weak Keys in DES

Background

DES is a block cipher that encrypts 64-bit plaintext using a 56-bit key over 16 rounds, generating 16 subkeys (one per round) through a key schedule.

Definition of Weak Keys

Weak keys in DES are keys that produce identical subkeys for all 16 rounds. This means:

$$E_K(E_K(P)) = P$$

That is, encrypting twice with the same weak key returns the original plaintext, making encryption equivalent to decryption. This severely reduces security.

The 4 Weak Keys

Weak Key (Hex)Bit Pattern
0101 0101 0101 0101All zeros (after parity removal)
FEFE FEFE FEFE FEFEAll ones (after parity removal)
1F1F 1F1F 0E0E 0E0EFirst half zeros, second half ones
E0E0 E0E0 F1F1 F1F1First half ones, second half zeros

These keys produce subkeys that are either all zeros or all ones in both halves of the key register (C and D registers), so all 16 subkeys are identical.

Semi-Weak Keys

DES also has 12 semi-weak keys (6 pairs) where:

$$E_{K_1}(P) = D_{K_2}(P)$$

Encrypting with key $K_1$ is the same as decrypting with key $K_2$. These pairs produce only two distinct subkeys alternating across 16 rounds.

Why They Are Dangerous

  • Weak keys reduce the effective key space.
  • An attacker who suspects a weak key is in use can test only a handful of keys rather than $2^{56}$ possibilities.
  • In practice, weak keys should be detected and rejected during key generation.

Part C: Round Operation in IDEA

Overview

IDEA (International Data Encryption Algorithm) is a symmetric block cipher with the following parameters:

  • Block size: 64 bits
  • Key size: 128 bits
  • Structure: 8 full rounds + 1 output transformation (half round)
  • Subkeys: 52 subkeys of 16 bits each (6 per full round + 4 for output transformation)

Three Algebraic Operations

IDEA derives its strength from mixing three algebraically incompatible operations on 16-bit sub-blocks:

SymbolOperationModulus
$\oplus$Bitwise XOR$2^{16}$
$\boxplus$Addition$2^{16}$
$\odot$Multiplication$2^{16} + 1 = 65537$

These three operations come from different algebraic groups, making algebraic cryptanalysis extremely difficult.

Input Division

The 64-bit plaintext block is divided into four 16-bit sub-blocks:

$$X_1, \quad X_2, \quad X_3, \quad X_4$$

Steps in One Full Round (using subkeys $K_1$ through $K_6$)

Step 1: Apply first four subkeys

$$a = X_1 \odot K_1$$ $$b = X_2 \boxplus K_2$$ $$c = X_3 \boxplus K_3$$ $$d = X_4 \odot K_4$$

Step 2: XOR cross combinations

$$e = a \oplus c$$ $$f = b \oplus d$$

Step 3: MA (Multiplication-Addition) Structure

The MA structure uses subkeys $K_5$ and $K_6$:

$$g = e \odot K_5$$ $$h = (f \boxplus g) \odot K_6$$ $$i = g \boxplus h$$

Step 4: XOR to produce round outputs

$$Y_1 = a \oplus h$$ $$Y_2 = c \oplus h$$ $$Y_3 = b \oplus i$$ $$Y_4 = d \oplus i$$

The final round output $(Y_1, Y_2, Y_3, Y_4)$ becomes the input to the next round (or, after the eighth round, to the output transformation), and the swap of the two middle blocks between rounds ensures full diffusion of the plaintext bits across the 64-bit block by the end of the cipher.

Open this answer on its own page →

Finite Fields

2081 · 5 marks

Find the multiplicative inverse of polynomial (95) using extended euclidean Algorithm. [5]

Show solved answer

Multiplicative Inverse in GF(2⁸) using the Extended Euclidean Algorithm

Given

  • Element to invert: 95 (hexadecimal), interpreted as an element of $GF(2^8)$.
  • $95_{16} = 1001,0101_2$, giving polynomial

$$b(x) = x^7 + x^4 + x^2 + 1$$

  • AES irreducible (reduction) polynomial:

$$m(x) = x^8 + x^4 + x^3 + x + 1$$

Note: The question only states "95" and "extended Euclidean algorithm". The irreducible polynomial is not explicitly given; the AES standard modulus is assumed since this is the standard BIT/cryptography context.

Goal: find $b(x)^{-1} \bmod m(x)$.


Solution

All arithmetic is in $GF(2)$ (addition = XOR).

Initialize:

  • $r_0 = m(x)=x^8+x^4+x^3+x+1$, $; t_0=0$
  • $r_1 = b(x)=x^7+x^4+x^2+1$, $; t_1=1$

Recurrence: $r_{i+1}=r_{i-1}-q_i r_i$, $;t_{i+1}=t_{i-1}-q_i t_i$.

Division 1: $r_0 \div r_1$

$$x^8+x^4+x^3+x+1 ;=; x\cdot(x^7+x^4+x^2+1) + r_2$$

$x\cdot b = x^8+x^5+x^3+x$. XOR:

$$r_2 = (x^8+x^4+x^3+x+1)\oplus(x^8+x^5+x^3+x)=x^5+x^4+1$$

  • $q_1=x$
  • $t_2=t_0-q_1t_1 = 0 - x\cdot1 = x$

Division 2: $r_1 \div r_2$

Divide $x^7+x^4+x^2+1$ by $x^5+x^4+1$:

  • $x^2$: $x^2(x^5+x^4+1)=x^7+x^6+x^2$; XOR → $x^6+x^4+1$
  • $x$: $x(x^5+x^4+1)=x^6+x^5+x$; XOR → $x^5+x^4+x+1$
  • $1$: $x^5+x^4+1$; XOR → $x$

So:

  • $q_2=x^2+x+1$, $; r_3=x$
  • $t_3=t_1-q_2t_2 = 1 - (x^2+x+1)(x) = 1+(x^3+x^2+x)=x^3+x^2+x+1$

Division 3: $r_2 \div r_3$

Divide $x^5+x^4+1$ by $x$:

$$x^5+x^4+1 = x\cdot(x^4+x^3)+1$$

So:

  • $q_3=x^4+x^3$, $; r_4=1$
  • $t_4=t_2-q_3t_3 = x - (x^4+x^3)(x^3+x^2+x+1)$

Compute $(x^4+x^3)(x^3+x^2+x+1)$:

$x^4\cdot(x^3+x^2+x+1)=x^7+x^6+x^5+x^4$ $x^3\cdot(x^3+x^2+x+1)=x^6+x^5+x^4+x^3$

XOR (add): $x^6\oplus x^6=0$, $x^5\oplus x^5=0$, $x^4\oplus x^4=0$:

$$=x^7+x^3$$

Then:

$$t_4 = x \oplus (x^7+x^3) = x^7+x^3+x$$

Since $r_4 = 1 = \gcd$, the inverse of $b(x)$ modulo $m(x)$ is $t_4$.

Verification

$$b(x)^{-1} = x^7 + x^3 + x$$

Check $b(x)\cdot t_4 \bmod m(x)$:

$b = x^7+x^4+x^2+1$, $t_4=x^7+x^3+x$.

Product:

  • $x^7\cdot t_4 = x^{14}+x^{10}+x^8$
  • $x^4\cdot t_4 = x^{11}+x^7+x^5$
  • $x^2\cdot t_4 = x^9+x^5+x^3$
  • $1\cdot t_4 = x^7+x^3+x$

XOR all: $x^5\oplus x^5=0$, $x^7\oplus x^7=0$, $x^3\oplus x^3=0$:

$$= x^{14}+x^{11}+x^{10}+x^9+x^8+x$$

Reduce mod $m(x)=x^8+x^4+x^3+x+1$ (i.e. $x^8\equiv x^4+x^3+x+1$):

  • $x^8\equiv x^4+x^3+x+1$

  • $x^9\equiv x^5+x^4+x^2+x$

  • $x^{10}\equiv x^6+x^5+x^3+x^2$

  • $x^{11}\equiv x^7+x^6+x^4+x^3$

  • $x^{14}=x^6\cdot x^8\equiv x^6(x^4+x^3+x+1)=x^{10}+x^9+x^7+x^6$

    reduce: $x^{10}\to x^6+x^5+x^3+x^2$, $x^9\to x^5+x^4+x^2+x$ $x^{14}\equiv (x^6+x^5+x^3+x^2)+(x^5+x^4+x^2+x)+x^7+x^6$ $= x^7+x^4+x^3+x$

Sum all reduced terms (XOR):

termreduced
$x^{14}$$x^7+x^4+x^3+x$
$x^{11}$$x^7+x^6+x^4+x^3$
$x^{10}$$x^6+x^5+x^3+x^2$
$x^9$$x^5+x^4+x^2+x$
$x^8$$x^4+x^3+x+1$
$x$$x$

XOR column by column:

  • $x^7$: $1+1=0$
  • $x^6$: $1+1=0$
  • $x^5$: $1+1=0$
  • $x^4$: $1+1+1+1=0$
  • $x^3$: $1+1+1+1=0$
  • $x^2$: $1+1=0$
  • $x^1$: $1+1+1+1=0$
  • $x^0$: $1$

$$= 1 \checkmark$$

Final Answer

$$\boxed{b(x)^{-1} = x^7 + x^3 + x}$$

In binary: $1000,1010$, i.e. hexadecimal 8A.

Completing the computation through $t_4$ gives the inverse $x^7+x^3+x$, which multiplies back to $1$.

Open this answer on its own page →

2080 · 5 marks

Show that the set of integers is Ring under addition and multiplication. [5]

A set R with two binary operations (+) and (×) is a Ring if for all a, b, c ∈ R the following axioms hold: Axiom Name ---------------- A1 a + b ∈ R Closure under addition A2 a + (b + c) = (a + b) + c Associativity of addition A3 a + b = b + a Commutativity of addition A4 ∃ 0 ∈ R such that a + 0 =...

Open this answer on its own page →

2078 · 10 marks

Define Galois field with an example. Explain any two modes of block cipher encryption. Determine the quadratic residues of 7.[10]

Show solved answer

Galois Field, Block Cipher Modes, and Quadratic Residues

Given

  • Modulus for quadratic residues: $n = 7$
  • Tasks: (a) define Galois field with example, (b) explain any two block cipher modes, (c) find quadratic residues of 7.

No numeric data is missing. All parts are solvable.


Solution

Part 1: Galois Field

Definition: A Galois Field (Finite Field), denoted $GF(p^n)$, is a field containing a finite number of elements, satisfying all field axioms (closure, associativity, commutativity, additive and multiplicative identities, additive and multiplicative inverses for non-zero elements, and distributivity).

The order (number of elements) must be a prime power $p^n$, where $p$ is prime and $n \geq 1$.

  • $GF(p)$: elements ${0, 1, \ldots, p-1}$ with arithmetic mod $p$.
  • $GF(2^8)$ is used in AES.

Example: $GF(7) = {0, 1, 2, 3, 4, 5, 6}$ (arithmetic mod 7)

Addition: $5 + 4 = 9 \equiv 2 \pmod 7$

Multiplication: $3 \times 5 = 15 \equiv 1 \pmod 7$

Multiplicative inverse: since $3 \times 5 \equiv 1 \pmod 7$, we have $3^{-1} = 5$.

Every non-zero element has an inverse, so $GF(7)$ is a valid Galois field.


Part 2: Two Modes of Block Cipher Encryption

Mode 1: Electronic Codebook (ECB)

  • Plaintext is split into fixed-size blocks ($P_1, P_2, \ldots$).
  • Each block is encrypted independently with the same key $K$: $$C_i = E(K, P_i)$$
  • Advantages: Simple, fast, fully parallelizable; random access to blocks.
  • Disadvantages: Identical plaintext blocks give identical ciphertext blocks, exposing data patterns; weak for structured data.

Mode 2: Cipher Block Chaining (CBC)

  • Each plaintext block is XORed with the previous ciphertext block before encryption. An Initialization Vector (IV) seeds the first block: $$C_i = E(K,; P_i \oplus C_{i-1}), \qquad C_0 = IV$$
  • Decryption: $P_i = D(K, C_i) \oplus C_{i-1}$
  • Advantages: Identical plaintext blocks give different ciphertext (hides patterns); more secure than ECB.
  • Disadvantages: Encryption is sequential (not parallelizable); a transmission error in one block corrupts that block and the next during decryption.

Part 3: Quadratic Residues of 7

An integer $a$ is a quadratic residue mod $n$ if there exists $x$ with $x^2 \equiv a \pmod n$ and $\gcd(a,n)=1$.

Compute $x^2 \bmod 7$ for $x = 1$ to $6$:

$x$$x^2$$x^2 \bmod 7$
111
244
392
4162
5254
6361

Distinct quadratic residues: $$QR(7) = {1, 2, 4}$$

Non-residues: ${3, 5, 6}$

Check with formula: For prime $p$, number of QRs $= \dfrac{p-1}{2} = \dfrac{7-1}{2} = 3$. ✓ (matches ${1,2,4}$)


Final Answers

  • $GF(7) = {0,\ldots,6}$ under mod-7 arithmetic is the example Galois field.
  • ECB and CBC modes explained as above.
  • Quadratic residues of 7: ${1, 2, 4}$.
Open this answer on its own page →

2078 · 5 marks

Divide $3x^2 + 4x + 3$ by $5x + 6$ over GF(7). [5]

  • Dividend: $3x^2 + 4x + 3$ - Divisor: $5x + 6$ - Field: $GF(7)$, all arithmetic mod 7. We need $5^{-1} \pmod 7$: since $5 \cdot 3 = 15 \equiv 1 \pmod 7$, we have $$5^{-1} = 3 \text{ in } GF(7)$$ $$\frac{3x^2}{5x} = 3 \cdot 5^{-1} x = 3 \cdot 3 , x = 9x \equiv 2x \pmod 7$$ Multiply back: $$2x(5x...
Open this answer on its own page →

Double DES

2080 · 10 marks

Write down the encryption and decryption process at 2-DES and 3-DES. Explain the Fiestal cipher structure. Divide $5x^2 + 4x + 6$ by $2x + 1$ over GF(7). [10]

--- 2-DES applies the DES algorithm twice with two independent keys $K1$ and $K2$ (each 56 bits, giving 112-bit effective key length). Encryption: $$C = E{K2}(E{K1}(P))$$ Plaintext $P$ is first encrypted with $K1$ to give an intermediate value, which is then encrypted with $K2$ to produce ciphert...

Open this answer on its own page →

2078

CIA Triad, Double & Triple DES, and S-Box in DES

--- The CIA Triad is the foundational model of information security consisting of three core principles: "Computer Security is the protection afforded to an automated information system in order to attain the applicable objectives of preserving the integrity, availability, and confidentiality of ...

Open this answer on its own page →

Advanced Encryption Standards

2079

Security Policy and Mechanism, Block vs Stream Cipher, and AES Key Expansion

--- A security policy is a set of rules and guidelines that define what is and is not allowed in a system. It is a high-level statement of intent that specifies the security goals an organization wants to achieve. It answers the question: "What needs to be protected?" A security mechanism is a de...

Open this answer on its own page →

2076 · 5 marks

Explain the procedure of mix column transformation in AES with an example. [5]

MixColumns is one of the four transformations in each AES round (except the final round). It operates on the state column by column. Each column of the $4 \times 4$ state matrix is treated as a four-term polynomial over $GF(2^8)$ and is multiplied (modulo $x^4 + 1$) by a fixed polynomial. This st...

Open this answer on its own page →