Path: blob/main/foundations/06-elliptic-curves/sage/06a-curves-over-reals.ipynb
483 views
Notebook 06a: Elliptic Curves over the Reals
Module 06. Elliptic Curves
Motivating Question. In Modules 01 and 05 we built cryptography on the multiplicative group . That group works, but it has a weakness: sub-exponential attacks (index calculus) mean we need 2048-bit primes for adequate security. Is there a different group where the discrete log is even harder, so we can use shorter keys? The answer is yes, elliptic curves provide groups where the best known attacks are fully exponential, enabling 256-bit keys with security comparable to 3072-bit RSA.
Before we can use these curves for crypto, we must first understand what they look like. This notebook starts with curves over the real numbers , where we can draw pictures and build geometric intuition.
Prerequisites. You should be comfortable with:
Groups and group operations (Module 01)
Fields, especially and finite fields (Module 02)
The discrete logarithm problem in (Module 05)
Learning objectives. By the end of this notebook you will be able to:
Write the short Weierstrass equation and explain each component.
Compute and interpret the discriminant .
Plot elliptic curves over and describe how and affect the shape.
Identify the point at infinity and the -axis symmetry.
Distinguish singular from non-singular curves.
1. The Weierstrass Equation
An elliptic curve over a field (for now, ) is the set of points satisfying
together with a special "point at infinity" that we will discuss shortly.
This is called the short Weierstrass form. The constants determine the curve's shape.
| Parameter | Role |
|---|---|
| Controls the "width" / curvature of the curve | |
| Shifts the curve vertically (controls -intercept) |
Not every choice of gives a valid elliptic curve, we need the curve to be non-singular (no cusps or self-intersections). This is guaranteed by the discriminant condition.
Observations:
The curve is symmetric about the -axis (if is on the curve, so is , since ).
It has a smooth, connected shape, no sharp corners or crossings.
The right "arm" extends to infinity as .
Checkpoint 1. Why is the curve symmetric about the -axis? Look at the equation , what happens when you replace with ?
2. The Discriminant: Singular vs Non-Singular
For the curve to define an elliptic curve, we require the discriminant
When , the cubic has a repeated root, and the curve develops a singularity, either a cusp (one repeated root of multiplicity 3) or a node (a double root). Singular curves do not form a group, so they are useless for cryptography.
| Condition | Curve type | Group? |
|---|---|---|
| Non-singular (elliptic curve) | Yes | |
| , double root | Node (self-crossing) | No |
| , triple root | Cusp (sharp point) | No |
Key observation: The cusp () has a sharp point at the origin where the tangent is not well-defined. The node () crosses itself at . Neither can be used for cryptography because the group law breaks down at the singular point.
Misconception alert. "Any cubic equation defines an elliptic curve." No! The curve must be non-singular (). Also, the general cubic can always be transformed to short Weierstrass form over fields with characteristic .
3. Exploring Different Shapes
By varying and , the curve can take on quite different shapes. Let us build a gallery.
Patterns to notice:
When , the curve can have two components: a closed "egg" on the left and an unbounded piece on the right (e.g., ).
When or is large enough, the curve typically has one connected component.
The curve always extends to the right () because dominates.
All curves are symmetric about the -axis.
Checkpoint 2. The curve has two components. The cubic has three real roots at . Between which pairs of roots is (needed for real )?
4. The Point at Infinity
Every elliptic curve has a special point called the point at infinity. You cannot see it on our plots, it lives "at the top and bottom of the plane simultaneously," in the projective closure of the curve.
Formally, we work in projective coordinates where the affine point corresponds to , and the point at infinity is .
Why do we need ? It serves as the identity element of the group:
Without , the set of curve points would not have an identity and could not form a group.
| Analogy | Identity element |
|---|---|
| 0 | |
| 1 | |
| (point at infinity) |
5. Points and the -Axis Symmetry
For any point on the curve, the point is also on the curve (since ). This "mirror" point is the inverse of in the group:
Geometrically: the line through and is vertical, and it "meets the curve at infinity", which is .
Checkpoint 3. If a point lies on the curve (i.e., ), what is ? What does this tell you about such points in the group?
6. Finding Rational Points
Over , there are infinitely many points on any elliptic curve. But finding points with rational coordinates (both and in ) is a deep number-theoretic problem. Let us find some by hand and with SageMath.
Bridge from Module 05. In Module 05, our group elements were numbers in and the operation was multiplication mod . On an elliptic curve, our group elements are points and the operation is a geometric "addition" rule (coming in notebook 06b). Different objects, same abstract structure: a finite cyclic group where the DLP is hard.
7. Why Curves, Not Lines or Conics?
You might wonder: why specifically cubic curves? Why not lines () or conics ()?
Lines have no interesting structure, a line meets another line in at most one point.
Conics (degree 2) can be parameterised rationally, meaning you can write down all rational points with a formula. This makes the "discrete log" problem trivial.
Cubics (degree 3) are the sweet spot: they have enough structure to define a group law (two points determine a third), but they cannot be rationally parameterised, which is what makes the DLP hard.
This is sometimes called the genus argument: elliptic curves have genus 1, which is exactly what gives them a group structure and computational hardness.
This "three-point" property is the key to defining the group law in the next notebook. Given two points and on the curve, we draw a line through them, find the third intersection point , and then reflect across the -axis to get .
Crypto foreshadowing. The group law on elliptic curves enables the same cryptographic constructions as , Diffie-Hellman, ElGamal, digital signatures, but with much shorter keys. A 256-bit elliptic curve key provides roughly the same security as a 3072-bit RSA key. That is a factor of 12× savings in key size, which matters for constrained devices, bandwidth, and storage.
8. Exercises
Exercise 1 (Worked): Checking the Discriminant
Problem. Determine which of the following define valid elliptic curves:
(a)
(b)
(c)
Solution. Compute for each:
| Curve | Valid? | ||||
|---|---|---|---|---|---|
| (a) | 2 | 3 | Yes () | ||
| (b) | -3 | 2 | No (singular!) | ||
| (c) | 1 | 1 | Yes () |
Curve (b) is singular because has a double root at .
Exercise 2 (Guided): Curve Shape Classification
Problem. For the curve (with ), determine:
For which values of is the curve non-singular?
For and , how many connected components does the real curve have?
Plot both curves to confirm.
Hint: With , the discriminant simplifies to . When is this zero?
Exercise 3 (Independent): Point Negation
Problem.
On the curve over , find the point and its inverse . Verify that using SageMath.
Find all points of the form on this curve (i.e., points where ). What is special about these points?
The point is on the curve. What is its order in the group? (Hint: compute .)
Summary
| Concept | Key Fact |
|---|---|
| Weierstrass form | with from a field |
| Discriminant | ensures non-singularity |
| Point at infinity | is the identity element of the group |
| Symmetry | If , then ; negation is reflection |
| Three-point property | A line meets a cubic in (generically) 3 points, the basis for the group law |
We now know what elliptic curves look like over . In the next notebook, we will define the group law: how to "add" two points on the curve using the chord-and-tangent construction.