CSC327 ยท 2078 ยท 10 marks
Define Galois field with an example. Explain any two modes of block cipher encryption. Determine the quadratic residues of 7.
Define Galois field with an example. Explain any two modes of block cipher encryption. Determine the quadratic residues of 7.[10]
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$ |
|---|---|---|
| 1 | 1 | 1 |
| 2 | 4 | 4 |
| 3 | 9 | 2 |
| 4 | 16 | 2 |
| 5 | 25 | 4 |
| 6 | 36 | 1 |
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}$.
Short on time? The 1, 5 and 10 mark versions of this answer, flashcards and practice sets come with a program pass.