CSEC3616Cybersecurity Engineering

    Groups, rings and fields

    The algebraic-structure hierarchy from group to field, each with its axioms, the lecture's Z and Q examples, the full F7 field proof, and Z8 as a commutative ring that is not a field.

    • State the four group axioms and the fifth axiom that makes a group abelian, and check them against Z under addition.
    • State the axioms of a ring, a commutative ring and a field, and place integral domains in the hierarchy.
    • Explain why Z is not a field and Q is, using the multiplicative-inverse axiom.
    • Verify all eight field axioms for F7 with the lecture's own numeric checks.
    • Show that Z8 is a commutative ring but not a field, using the failure of 2 to have a multiplicative inverse.

    20 min read

    Intuition

    Every cryptographic scheme this unit covers computes inside one of a small number of algebraic shapes, and which shape it is decides what operations are even available. RSA works inside Zn\mathbb{Z}_n, which turns out to be only a ring: you can add, subtract and multiply, but not always divide, and RSA’s security leans on that gap directly. AES works inside GF(28)\mathrm{GF}(2^8), a field, where every nonzero element has a multiplicative inverse, and the AES S-box is built from exactly that inverse (04-07 covers the construction). Diffie-Hellman and the discrete logarithm problem live inside a cyclic group under multiplication. None of this is incidental vocabulary: whether a structure guarantees an inverse for every element is the difference between a scheme that works and one that silently breaks on certain inputs. This page builds the hierarchy, group, abelian group, ring, commutative ring, field, from the ground up, so those guarantees can be checked rather than assumed.

    Mechanism

    A group is a set GG with a binary operation, written ++ here, satisfying four properties:

    1. Closure. For all a,bGa, b \in G, a+bGa + b \in G.
    2. Associativity. For all a,b,cGa, b, c \in G, (a+b)+c=a+(b+c)(a + b) + c = a + (b + c).
    3. Identity element. There exists 0G0 \in G such that 0+a=a+0=a0 + a = a + 0 = a for every aa.
    4. Inverse elements. For every aGa \in G, there exists aG-a \in G with a+(a)=(a)+a=0a + (-a) = (-a) + a = 0.

    The operation does not have to be literal addition. It can be multiplication, or any binary operation meeting these four requirements. When the operation is also commutative (a+b=b+aa + b = b + a for all a,ba, b), the group is an abelian group, also called a commutative group.

    Worked example

    AnswerZ is an abelian group under addition

    1. Closure. 3,5Z3, 5 \in \mathbb{Z} and 3+5=8Z3 + 5 = 8 \in \mathbb{Z}.
    2. Associativity. (2+3)+4=5+4=9(2 + 3) + 4 = 5 + 4 = 9 and 2+(3+4)=2+7=92 + (3 + 4) = 2 + 7 = 9. Equal.
    3. Identity. 00 is the additive identity: 7+0=77 + 0 = 7 and 0+7=70 + 7 = 7.
    4. Inverse. For a=5a = 5, the inverse is 5-5, since 5+(5)=05 + (-5) = 0.
    5. Commutativity. 4+6=104 + 6 = 10 and 6+4=106 + 4 = 10. Equal.
    6. All five properties hold, so (Z,+)(\mathbb{Z}, +) is an abelian group.

    Mechanism

    A ring adds a second operation, multiplication, on top of the additive group structure:

    1. Closure. a+ba + b and aba \cdot b are both in the set, for all a,ba, b.
    2. Associativity. (a+b)+c=a+(b+c)(a+b)+c = a+(b+c) and (ab)c=a(bc)(a \cdot b) \cdot c = a \cdot (b \cdot c).
    3. Additive identity. a+0=aa + 0 = a for all aa.
    4. Additive inverse. For every aa, there is a-a with a+(a)=0a + (-a) = 0.
    5. Commutativity of addition. a+b=b+aa + b = b + a.
    6. Distributive laws. a(b+c)=ab+aca \cdot (b + c) = a \cdot b + a \cdot c and (a+b)c=ac+bc(a+b) \cdot c = a \cdot c + b \cdot c.

    Two things a ring does not require: multiplication does not have to be commutative (ab=baa \cdot b = b \cdot a can fail), and there does not have to be a multiplicative identity. Z\mathbb{Z} satisfies all six properties, so Z\mathbb{Z} is a ring.

    Mechanism

    A commutative ring is a ring with one more property:

    1. Commutativity of multiplication. ab=baa \cdot b = b \cdot a for all a,ba, b.

    Z\mathbb{Z} satisfies this too, so Z\mathbb{Z} is a commutative ring. A ring with a multiplicative identity (an element 11 with a1=aa \cdot 1 = a) is called a ring with unity. An integral domain is a commutative ring with unity that additionally has no zero divisors: ab=0a \cdot b = 0 forces a=0a = 0 or b=0b = 0. Z\mathbb{Z} is an integral domain. The supplement introduces the term as part of the algebraic-structure hierarchy but does not work through a separate proof for it, so no additional worked example is given here beyond noting where it sits: strictly between commutative ring and field.

    Mechanism

    A field adds the strongest requirement of all: a multiplicative inverse for every nonzero element.

    1. Multiplicative inverse. For every a0a \neq 0, there exists a1a^{-1} with aa1=1a \cdot a^{-1} = 1.

    A field is a commutative ring with unity where that eighth property also holds, supporting addition, subtraction, multiplication, and division by anything except zero.

    Compare

    Satisfies every field axiom except the last. Take a=4a = 4: its multiplicative inverse would have to be 14\frac{1}{4}, since 4×14=14 \times \frac{1}{4} = 1, but 14Z\frac{1}{4} \notin \mathbb{Z}. No integer inverse exists for 44, so Z\mathbb{Z} is not a field, only a commutative ring.

    The same check succeeds: 44‘s inverse is 14\frac{1}{4}, and 14Q\frac{1}{4} \in \mathbb{Q}. Every nonzero rational has a rational inverse (flip the fraction), so Q\mathbb{Q} satisfies all eight field axioms and is a field.

    Exam detail

    One counter-example is enough to disqualify a structure from being a field: the multiplicative-inverse axiom is universal (“for every nonzero element”), so a single element without an inverse breaks it. This is exactly the shape of both counter-examples on this page: one missing inverse for 44 rules out Z\mathbb{Z}, and one missing inverse for 22 rules out Z8\mathbb{Z}_8 below.

    Mechanism

    A prime field, written FpF_p or GF(p)\mathrm{GF}(p), is the set {0,1,,p1}\{0, 1, \ldots, p-1\} with addition and multiplication taken modulo a prime pp. The lecture works through F7=GF(7)={0,1,2,3,4,5,6}F_7 = \mathrm{GF}(7) = \{0,1,2,3,4,5,6\}, checking every field axiom directly against numeric examples.

    Worked example

    AnswerF7 satisfies all eight field axioms

    1. Closure. 5,6F75, 6 \in F_7: 5+6mod7=4F75 + 6 \bmod 7 = 4 \in F_7, and 56mod7=30mod7=2F75 \cdot 6 \bmod 7 = 30 \bmod 7 = 2 \in F_7.
    2. Associativity (addition). (5+6)+4mod7(5+6)+4 \bmod 7: 5+6=11mod7=45+6=11 \bmod 7=4; 4+4=8mod7=14+4=8 \bmod 7=1. 5+(6+4)mod75+(6+4) \bmod 7: 6+4=10mod7=36+4=10 \bmod 7=3; 5+3=8mod7=15+3=8 \bmod 7=1. Both equal 11.
    3. Associativity (multiplication). (56)4mod7(5 \cdot 6) \cdot 4 \bmod 7: 56=30mod7=25 \cdot 6=30 \bmod 7=2; 24=8mod7=12 \cdot 4=8 \bmod 7=1. 5(64)mod75 \cdot (6 \cdot 4) \bmod 7: 64=24mod7=36 \cdot 4=24 \bmod 7=3; 53=15mod7=15 \cdot 3=15 \bmod 7=1. Both equal 11.
    4. Additive identity. 0,5F70, 5 \in F_7: 5+0mod7=55 + 0 \bmod 7 = 5.
    5. Additive inverse. 5+2mod7=7mod7=05 + 2 \bmod 7 = 7 \bmod 7 = 0, so 22 is the additive inverse of 55. Likewise 4+3mod7=7mod7=04 + 3 \bmod 7 = 7 \bmod 7 = 0, so 33 is the additive inverse of 44.
    6. Commutativity of addition. 5+2mod7=05 + 2 \bmod 7 = 0 and 2+5mod7=02 + 5 \bmod 7 = 0. Equal.
    7. Distributive laws. 5(2+4)mod75(2+4) \bmod 7: 2+4=62+4=6; 56=30mod7=25 \cdot 6=30 \bmod 7=2. 52+54mod75 \cdot 2 + 5 \cdot 4 \bmod 7: 10mod7=310 \bmod 7=3, 20mod7=620 \bmod 7=6, 3+6=9mod7=23+6=9 \bmod 7=2. Both equal 22.
    8. Commutativity of multiplication. 52mod7=10mod7=35 \cdot 2 \bmod 7 = 10 \bmod 7 = 3 and 25mod7=10mod7=32 \cdot 5 \bmod 7 = 10 \bmod 7 = 3. Equal.
    9. Multiplicative inverse. 53mod7=15mod7=15 \cdot 3 \bmod 7 = 15 \bmod 7 = 1, so 33 is the multiplicative inverse of 55. And 66mod7=36mod7=16 \cdot 6 \bmod 7 = 36 \bmod 7 = 1, so 66 is its own inverse.
    10. All eight axioms hold for every element checked, so F7F_7 is a field.

    Aside

    Finding an inverse by testing every element of F7F_7 in turn, as the last step does for 55 and 66, works fine at this size. For a larger prime it does not: that is exactly the job the extended Euclidean algorithm on extended Euclid and modular inverses does instead, computing a modular inverse directly rather than by search.

    Mechanism

    A prime field is only a field because pp is prime. The general set Zn={0,1,,n1}\mathbb{Z}_n = \{0, 1, \ldots, n-1\} under addition and multiplication modulo nn is always a commutative ring, but it is only a field when nn is prime. Z8\mathbb{Z}_8 makes the gap concrete: 88 is not prime, and 22 turns out to have no multiplicative inverse mod 88.

    Worked example

    AnswerZ8 is a commutative ring, not a field, because 2 has no multiplicative inverse mod 8

    Checking every possible inverse for 22 by scanning Z8={0,1,,7}\mathbb{Z}_8 = \{0, 1, \ldots, 7\}:

    1. 2×0mod8=02 \times 0 \bmod 8 = 0
    2. 2×1mod8=22 \times 1 \bmod 8 = 2
    3. 2×2mod8=42 \times 2 \bmod 8 = 4
    4. 2×3mod8=62 \times 3 \bmod 8 = 6
    5. 2×4mod8=02 \times 4 \bmod 8 = 0
    6. 2×5mod8=22 \times 5 \bmod 8 = 2
    7. 2×6mod8=42 \times 6 \bmod 8 = 4
    8. 2×7mod8=62 \times 7 \bmod 8 = 6
    9. Every product is even, and 11 is odd, so none of these ever equals 11. 22 has no multiplicative inverse in Z8\mathbb{Z}_8, so Z8\mathbb{Z}_8 is not a field. It is a commutative ring only.

    Pitfall

    Row 33 above, 2×2mod8=42 \times 2 \bmod 8 = 4, is printed in the Week 4 abstract-algebra supplement as 2×2mod8=02 \times 2 \bmod 8 = 0. That line is wrong: 2×2=42 \times 2 = 4, and 4mod8=44 \bmod 8 = 4, not 00. 04-02 flags the same slip where this table first appears on this site. The conclusion is unaffected either way, since 44 is not 11 any more than 00 is, but if this table is ever reproduced from the source directly, the printed 00 in that one row is the error, not a valid alternative reading.

    Exam detail

    The reason 22 fails and, say, 33 would not: a multiplicative inverse for aa mod nn exists exactly when gcd(a,n)=1\gcd(a, n) = 1, the same condition 04-03 establishes for modular inverses in general. gcd(2,8)=21\gcd(2, 8) = 2 \neq 1, so 22 is disqualified before any scanning is needed. This is also why Zn\mathbb{Z}_n is a field precisely when nn is prime: for a prime modulus, every nonzero element is automatically coprime to it, so every nonzero element has an inverse. Fixing this for GF(2n)\mathrm{GF}(2^n), where the underlying set is not the integers mod nn at all but polynomials, is exactly what 04-07 builds next.

    Recall

    A set satisfies every ring axiom, is commutative under multiplication, and has a multiplicative identity. Is it necessarily a field?

    No. That description is a commutative ring with unity, possibly an integral domain if it also has no zero divisors, but a field requires one more property: every nonzero element must have a multiplicative inverse. Z8\mathbb{Z}_8 satisfies everything up to and including commutativity of multiplication and has a multiplicative identity (11), yet is not a field, because 22 has no inverse mod 88.