Path: blob/main/foundations/02-rings-fields-polynomials/break/zero-divisors-composite-n.ipynb
483 views
Break: Zero Divisors in Z_n for Composite n
Module 02 | Breaking Weak Parameters
When n is composite, has zero divisors, and any scheme that assumes a field will break.
Why This Matters
Many cryptographic constructions require field arithmetic: every nonzero element must have a multiplicative inverse. The simplest fields are for a prime .
But if someone uses where is composite, the ring has zero divisors, nonzero elements with . These elements have no multiplicative inverse, and any scheme that tries to divide by them will fail.
This notebook explores exactly what goes wrong in .
The Scenario
We work in with arithmetic modulo 12. Since is composite, this ring is not a field.
Goal: Find all elements that lack multiplicative inverses, discover all zero divisors, and show how a toy encryption scheme breaks.
Step 2: Find Zero Divisors
A zero divisor is a nonzero element such that for some nonzero .
In : since , we expect . And . Let's find them all.
The Fix: Use a Prime Modulus
When is prime, is a field: every nonzero element has a multiplicative inverse. There are no zero divisors.
This is why cryptographic protocols work modulo a prime .
Exercises
Zero divisors in : Find all zero divisors in . Which elements are invertible? How many? Hint: , so look for products of 3 and 5 and their multiples.
Zero divisors in : Repeat for . .
Characterize invertible elements: In , the number of invertible elements is (Euler's totient). Verify that , , by listing the units.
Prime power modulus: Consider where . Find all zero divisors. Is ever a field for ?
Summary
| Modulus | Structure of | Zero Divisors | Units | Field? |
|---|---|---|---|---|
| Ring with zero divisors | No | |||
| (prime) | Field | None | All | Yes |
| Ring with zero divisors | No |
Key takeaways:
is a field if and only if is prime.
When is composite, elements with are zero divisors and have no inverse.
The number of invertible elements is (Euler's totient), not .
Zero divisors cause information loss: distinct inputs produce identical outputs under multiplication.
Any cryptosystem that requires division (multiplicative inverses) must use a prime modulus to work in a field.
This is the integer analogue of the polynomial fact: is a field only when is irreducible (see the companion break notebook).