Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
duyuefeng0708
GitHub Repository: duyuefeng0708/Cryptography-From-First-Principle
Path: blob/main/foundations/02-rings-fields-polynomials/README.md
483 views
unlisted

Module 02: Rings, Fields, and Polynomials

View on nbviewer

Adding a second operation opens the door to polynomial algebra and field extensions.

Prerequisites

Learning Objectives

After completing this module you will:

  1. Distinguish rings from groups and fields by their algebraic properties

  2. Work with polynomial rings over finite fields

  3. Test polynomials for irreducibility over a given field

  4. Construct quotient rings and understand their role in building new algebraic structures

Explore (SageMath Notebooks)

Work through these notebooks in order:

#NotebookWhat You'll Learn
aWhat Is a Ring?Ring axioms, examples, and non-examples
bIntegers mod n as a RingZ_n with both addition and multiplication
cPolynomial RingsBuilding and manipulating polynomials over finite fields
dWhat Is a Field?Fields as rings where every nonzero element has an inverse
ePolynomial Division and IrreducibilityLong division, remainders, and irreducibility tests
fQuotient RingsModding out by an ideal to create new structures

Implement (Rust)

Build these from scratch in rust/src/lib.rs:

#FunctionDescription
1poly_evalEvaluate a polynomial at a given point over a finite field
2poly_addAdd two polynomials coefficient-wise with reduction
3poly_mulMultiply two polynomials with coefficient reduction
4poly_div_remPolynomial long division returning quotient and remainder
5is_irreducible_mod_pTest whether a polynomial is irreducible over F_p

Run: cargo test -p rings-fields-poly

Break

Try these attacks in the break/ folder:

  • Factor a "supposedly irreducible" polynomial to break a scheme built on a quotient ring

  • Find zero divisors in Z_n for composite n and show why Z_n fails to be a field

Connect

See where this shows up in practice (in the connect/ folder):

  • AES uses GF(2^8), where all field arithmetic lives in a polynomial quotient ring

  • Reed-Solomon error correcting codes rely on polynomial evaluation and interpolation over finite fields


Next: Module 03: Galois Fields and AES