IA idea · Cryptography & number theory
Agreeing a secret in public: the Diffie–Hellman key exchange
Research question
How can two people agree a secret number over a public channel using powers modulo a prime, why must the base be chosen carefully, and how does the work an eavesdropper must do grow with the size of the prime?
Make it yours, then agree it with your teacher.
Next step: plan this IA free — the planner opens with this question filled in. For feedback on your own draft, the IA package (€39 once) gives you 5 AI feedback credits and every annotated exemplar in full.
Why it makes a good exploration
It is a short, complete piece of number theory with a real purpose. Small primes let you do every step by hand and see exactly where the security comes from.
The mathematics you'll need
- Modular arithmetic and powers mod p (new: explain)
- Primitive roots: the order of an element
- Proof that both parties get the same key
- Fast exponentiation by repeated squaring
- Growth of brute-force search with the size of p
Where the data comes from
No data needed; use small primes by hand and a spreadsheet or calculator for larger ones; check sequences on OEIS.
- OEIS (On-Line Encyclopedia of Integer Sequences) — Check a sequence you have found and read its known formulas and references.
- Desmos graphing calculator — Free graphing and regression (y₁ ~ ax₁ + b) — fit models to your data and show residuals.
A possible outline
- Explain modular arithmetic with clock examples.
- Run the exchange with a small prime by hand.
- Prove the shared keys are equal.
- Investigate primitive roots and why a bad base leaks information.
- Measure how search time grows with p and reflect on real key sizes.
Pitfalls that cost marks
- Quoting results about primitive roots without testing them.
- Mixing up the public and private numbers.
- Overclaiming: real systems use extra protections you are not modelling.
Showing personal engagement
- Run the exchange with a classmate.
- Find primes whose structure makes the attack easier.
- Time your own brute-force search.
See Criterion C: personal engagement for what examiners look for.
Which course is it for?
| Course | Fit | Maths to lean on |
|---|---|---|
| AA SL | Not a natural fit | The core technique sits in the AI course or at HL; an AA SL student could use it only as clearly explained new mathematics. |
| AA HL | Good fit | Modular arithmetic and powers mod p (new: explain); Primitive roots: the order of an element |
| AI SL | Not a natural fit | The mathematics is mainly AA or HL (calculus or proof beyond AI SL); an AI SL version would need a data-driven, technology-based approach. |
| AI HL | Not a natural fit | The mathematics is mainly from the AA course; an AI HL version would need modelling with technology, statistics or networks at HL level. |
Level: Ambitious. Suits confident students; expect to learn some mathematics on your own. See how the IA differs between AA and AI, SL and HL.
How this idea reaches the top bands
Reflection (D)
For this idea, start with the weak points: quoting results about primitive roots without testing them; and mixing up the public and private numbers. Say how each one affects your answer.
Use of mathematics (E)
HL: modular arithmetic and powers mod p (new: explain); primitive roots: the order of an element; proof that both parties get the same key; fast exponentiation by repeated squaring; growth of brute-force search with the size of p, each explained in your own words and carried out correctly.
How cryptography explorations reach the top bands in general: Cryptography & number theory IA ideas. Guides: A · B · C · D · E · self-grade sheet.
Taking it further
Investigate the number of primitive roots of a prime, or Fermat's little theorem and its proof.
Extending it for HL
Add an HL technique the question genuinely needs: what an HL cryptography exploration adds.
See a complete IA, marked
How far can a stack of books lean over the edge of a table? (AA HL) is a complete cryptography exploration, marked on every criterion.
Frequently asked questions
Which IB Maths course is this IA idea for?
It works for AA HL. We rate it Ambitious: it suits confident students, who should expect to learn some mathematics on their own.
What mathematics does this IA use?
Modular arithmetic and powers mod p (new: explain), primitive roots: the order of an element, proof that both parties get the same key, fast exponentiation by repeated squaring and growth of brute-force search with the size of p.
Where can I get data for this IA?
No data needed; use small primes by hand and a spreadsheet or calculator for larger ones; check sequences on OEIS. Checked sources and tools: OEIS (On-Line Encyclopedia of Integer Sequences) and Desmos graphing calculator.
Turn this idea into your IA
The planner opens with “Agreeing a secret in public: the Diffie–Hellman key exchange” filled in: the question, the maths and the data sources.
Your plan is kept in this browser. A free account keeps it with your drafts on any device: Join free · Sign in
Also: free IA self-check · A–E checklist (PDF) · have a draft? AI feedback or a review with Pete (€100)
Writing it up: how to write a Maths IA, step by step · structure and format · mistakes that cost marks · annotated exemplars, marked on every criterion
Similar ideas
- The Collatz conjecture: what can we say about stopping times?AA SLAA HLAI SLAI HLSolid
- How many primes are there below n? Testing the prime number theoremAA SLAA HLAI SLSolid
- Which typing errors does a check digit catch? ISBN-10 versus ISBN-13AA HLAA SLSolid
- Patterns in the last digits of powersAA SLAA HLSolid