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 readJump to the quiz ↓

    A group needs closure, associativity, an identity and inverses

    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 available. RSA works inside Zn\mathbb{Z}_n, which is only a ring: you can add, subtract and multiply, but not always divide, and RSA’s security leans on that gap. 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. 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 from the ground up so those guarantees can be checked rather than assumed.

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

    1. Closure. For all a,b∈Ga, b \in G, a+b∈Ga + b \in G.
    2. Associativity. For all a,b,c∈Ga, b, c \in G, (a+b)+c=a+(b+c)(a + b) + c = a + (b + c).
    3. Identity element. There exists 0∈G0 \in G such that 0+a=a+0=a0 + a = a + 0 = a for every aa.
    4. Inverse elements. For every a∈Ga \in G, there exists −a∈G-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.

    Try it — worked example

    Show that the integers Z under addition form an abelian group.

    Show answer and steps

    AnswerZ is an abelian group under addition

    1. Closure. 3,5∈Z3, 5 \in \mathbb{Z} and 3+5=8∈Z3 + 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.

    A ring adds multiplication, and a field also guarantees a multiplicative inverse

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

    1. Closure. a+ba + b and a⋅ba \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 (a⋅b)⋅c=a⋅(b⋅c)(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)=a⋅b+a⋅ca \cdot (b + c) = a \cdot b + a \cdot c and (a+b)⋅c=a⋅c+b⋅c(a+b) \cdot c = a \cdot c + b \cdot c.

    A ring does not require multiplication to be commutative (a⋅b=b⋅aa \cdot b = b \cdot a can fail), and it does not require a multiplicative identity. Z\mathbb{Z} satisfies all six properties, so Z\mathbb{Z} is a ring.

    A commutative ring is a ring with one more property:

    1. Commutativity of multiplication. a⋅b=b⋅aa \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 a⋅1=aa \cdot 1 = a) is called a ring with unity. An integral domain is a commutative ring with unity that has no zero divisors: a⋅b=0a \cdot b = 0 forces a=0a = 0 or b=0b = 0. Z\mathbb{Z} is an integral domain. The supplement names the term without a separate proof; it sits strictly between commutative ring and field.

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

    1. Multiplicative inverse. For every a≠0a \neq 0, there exists a−1a^{-1} with a⋅a−1=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

    Z (the integers)

    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 14∉Z\frac{1}{4} \notin \mathbb{Z}. No integer inverse exists for 44, so Z\mathbb{Z} is not a field, only a commutative ring.

    Q (the rationals)

    The same check succeeds: 44‘s inverse is 14\frac{1}{4}, and 14∈Q\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. Both counter-examples on this page have this shape: one missing inverse for 44 rules out Z\mathbb{Z}, and one missing inverse for 22 rules out Z8\mathbb{Z}_8 below.

    Z_p is a field because p is prime

    A prime field, written FpF_p or GF(p)\mathrm{GF}(p), is the set {0,1,…,p−1}\{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.

    Try it — worked example

    Show that F7 = {0, ..., 6} with addition and multiplication mod 7 is a field.

    Show answer and steps

    AnswerF7 satisfies all eight field axioms

    1. Closure. 5,6∈F75, 6 \in F_7: 5+6 mod 7=4∈F75 + 6 \bmod 7 = 4 \in F_7, and 5⋅6 mod 7=30 mod 7=2∈F75 \cdot 6 \bmod 7 = 30 \bmod 7 = 2 \in F_7.
    2. Associativity (addition). (5+6)+4 mod 7(5+6)+4 \bmod 7: 5+6=11 mod 7=45+6=11 \bmod 7=4; 4+4=8 mod 7=14+4=8 \bmod 7=1. 5+(6+4) mod 75+(6+4) \bmod 7: 6+4=10 mod 7=36+4=10 \bmod 7=3; 5+3=8 mod 7=15+3=8 \bmod 7=1. Both equal 11.
    3. Associativity (multiplication). (5⋅6)⋅4 mod 7(5 \cdot 6) \cdot 4 \bmod 7: 5⋅6=30 mod 7=25 \cdot 6=30 \bmod 7=2; 2⋅4=8 mod 7=12 \cdot 4=8 \bmod 7=1. 5⋅(6⋅4) mod 75 \cdot (6 \cdot 4) \bmod 7: 6⋅4=24 mod 7=36 \cdot 4=24 \bmod 7=3; 5⋅3=15 mod 7=15 \cdot 3=15 \bmod 7=1. Both equal 11.
    4. Additive identity. 0,5∈F70, 5 \in F_7: 5+0 mod 7=55 + 0 \bmod 7 = 5.
    5. Additive inverse. 5+2 mod 7=7 mod 7=05 + 2 \bmod 7 = 7 \bmod 7 = 0, so 22 is the additive inverse of 55. Likewise 4+3 mod 7=7 mod 7=04 + 3 \bmod 7 = 7 \bmod 7 = 0, so 33 is the additive inverse of 44.
    6. Commutativity of addition. 5+2 mod 7=05 + 2 \bmod 7 = 0 and 2+5 mod 7=02 + 5 \bmod 7 = 0. Equal.
    7. Distributive laws. 5(2+4) mod 75(2+4) \bmod 7: 2+4=62+4=6; 5⋅6=30 mod 7=25 \cdot 6=30 \bmod 7=2. 5⋅2+5⋅4 mod 75 \cdot 2 + 5 \cdot 4 \bmod 7: 10 mod 7=310 \bmod 7=3, 20 mod 7=620 \bmod 7=6, 3+6=9 mod 7=23+6=9 \bmod 7=2. Both equal 22.
    8. Commutativity of multiplication. 5⋅2 mod 7=10 mod 7=35 \cdot 2 \bmod 7 = 10 \bmod 7 = 3 and 2⋅5 mod 7=10 mod 7=32 \cdot 5 \bmod 7 = 10 \bmod 7 = 3. Equal.
    9. Multiplicative inverse. 5⋅3 mod 7=15 mod 7=15 \cdot 3 \bmod 7 = 15 \bmod 7 = 1, so 33 is the multiplicative inverse of 55. And 6⋅6 mod 7=36 mod 7=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.

    Finding an inverse by testing every element of F7F_7, as the last step does for 55 and 66, works at this size. For a larger prime it does not. That is the job of the extended Euclidean algorithm on extended Euclid and modular inverses, which computes a modular inverse directly rather than by search.

    Z_8 is only a commutative ring, because 2 has no inverse mod 8

    A prime field is only a field because pp is prime. The general set Zn={0,1,…,n−1}\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 has no multiplicative inverse mod 88.

    Try it — worked example

    Is Z8 a field? If not, find an element with no multiplicative inverse.

    Show answer and steps

    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×0 mod 8=02 \times 0 \bmod 8 = 0
    2. 2×1 mod 8=22 \times 1 \bmod 8 = 2
    3. 2×2 mod 8=42 \times 2 \bmod 8 = 4
    4. 2×3 mod 8=62 \times 3 \bmod 8 = 6
    5. 2×4 mod 8=02 \times 4 \bmod 8 = 0
    6. 2×5 mod 8=22 \times 5 \bmod 8 = 2
    7. 2×6 mod 8=42 \times 6 \bmod 8 = 4
    8. 2×7 mod 8=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

    The Week 4 abstract-algebra supplement prints row 33 above as 2×2 mod 8=02 \times 2 \bmod 8 = 0. That is wrong: 2×2=42 \times 2 = 4, and 04-02 flags the same slip. The conclusion is unaffected, since neither 44 nor 00 is 11, but if this table is reproduced from the source, the printed 00 in that one row is the error.

    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)=2≠1\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. For GF(2n)\mathrm{GF}(2^n), where the underlying set is polynomials rather than the integers mod nn, 04-07 builds the fix.

    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.

    Check yourself