Elliptic curve cryptography
Non-examinable material on the curve equation, point addition, curves over prime and binary finite fields, the elliptic curve discrete logarithm problem, ECDH and EC ElGamal, covered in full for readers who want it anyway.
Not examinable — the lecture flags this material as out of scope for assessment.
- State the elliptic curve equation over the reals, over a prime field and over a binary field.
- Explain point addition and point doubling using the line-and-reflect geometric picture.
- Verify whether a given point lies on a curve over a prime field.
- State the elliptic curve discrete logarithm problem and work a small brute-force example.
- Work an ECDH key agreement and an EC ElGamal encryption and decryption by hand.
24 min read
This page is non-examinable. The lecture marks the entire elliptic curve section “for information only”. If exam time is short, spend it on the rest of module 6 instead. What follows is the full treatment for anyone who wants it regardless.
Intuition
Every scheme so far builds its hard problem out of modular arithmetic on ordinary integers: factoring for RSA, the discrete logarithm for classical Diffie-Hellman. Elliptic curve cryptography keeps the same idea, picking an operation that is easy to run forward and believed hard to reverse, but changes what the numbers are. The elements are no longer integers mod ; they are points on a curve, and the operation is no longer multiplication; it is a geometric rule for combining two points into a third. The payoff for the added complexity is a discrete logarithm problem that is harder per bit, so the same security comes from a much shorter key.
Mechanism
The curve. An elliptic curve is the set of points satisfying plus one extra point, , the point at infinity. It is not a real coordinate pair, but an identity element added so every point has an inverse under the group operation defined below.
Point addition, geometrically. Take two distinct points and on the curve. Draw the straight line through them. Because the curve is cubic, that line intersects it at exactly one more point. Reflect that third point across the -axis: the result is .
Point negation. The reflection of a point across the -axis is its negative: . Three points that lie on one straight line always sum to zero: when , , are collinear.
Point doubling. When , there is no second point to draw a line through, so use the tangent line at instead. The tangent meets the curve at one further point; reflecting that point across the -axis gives . Repeating this, and combining it with ordinary addition, is how (the point added to itself times) is computed efficiently for large , the same way repeated squaring makes fast.
Mechanism
Over a finite field. For cryptography the curve is drawn over rather than the reals, written : The curve is now a finite set of points plus , exactly the kind of finite structure a discrete logarithm problem needs.
Worked example
AnswerCorrected: 49 mod 23 = 3 and 739 mod 23 = 3, so 3 congruent to 3 confirms (9,7) lies on E_23(1,1). The source states this reduction as 2, which is a defect in the original slides.
Take : . Check whether lies on the curve.
- Right-hand side: with , : .
- Left-hand side: .
- Reduce both sides mod 23. : , . So the left side is .
- : , . So the right side is also .
- , so the point satisfies the equation, and lies on .
Aside
This example is a documented source defect (docs/FACTS.md S3), reproduced here corrected. The original
slides write the right-hand side as , where the looks like a slip of combining into a single stray term instead of the two separate terms and that actually needs.
Separately, the slides reduce both and to ; both should be . The final
conclusion, that is on the curve, still holds either way, purely because the arithmetic error was
symmetric on both sides. The detailed table of every point on that the slides go on to describe
did not survive PDF extraction, so it is not reproduced here.
Mechanism
Over a binary field. Elliptic curves can also be built over , the same binary-field construction used for AES’s finite fields, using a different equation: Coordinates and coefficients are field elements (bit strings), and addition is XOR throughout, including subtraction, since the two are identical in a field of characteristic 2: adding an element to itself always gives zero.
Worked check, . Take as the irreducible polynomial and as a generator, so every non-zero field element is some power . Take the curve with , , and check whether lies on it.
First, the powers of needed, each computed by multiplying the previous one by and reducing mod whenever the result overflows 4 bits (in which case is replaced by , since ):
, , , , , , .
Substituting into with , , , :
In binary, using the powers above: on the left, on the right. XOR each side: on the left; on the right. Both sides equal , so lies on the curve.
Mechanism
The elliptic curve discrete logarithm problem (ECDLP). Given points and on with , finding is believed infeasible for a large enough curve: no method faster than trying values of is known. The lecture’s small example, on , finds for and by brute force, listing every multiple of in turn:
matches , so . This only worked because the curve is tiny. With chosen from a space of real-world size, listing every multiple is infeasible, which is exactly the property the scheme relies on.
Mechanism
Elliptic curve Diffie-Hellman (ECDH). Both parties, and any attacker, already know the system-wide public parameters: the curve , a base point , and ‘s order (the smallest with , chosen as a large prime). Key agreement mirrors classical Diffie-Hellman with scalar point multiplication in place of modular exponentiation:
- Alice picks a private scalar and publishes .
- Bob picks a private scalar and publishes .
- Alice computes ; Bob computes .
Both reach the same point, for the same reason as classical DH: the two scalars commute. Recovering from and alone is the ECDLP, believed infeasible.
Mechanism
EC ElGamal encryption. The message is first encoded as a curve point . Public parameters: the curve , a generator of large order .
| Alice (sender) | Bob (receiver) | |
|---|---|---|
| 1 | Picks private key | |
| 2 | Publishes | |
| 3 | Picks a fresh random for this message | |
| 4 | Sends | Receives |
| 5 | Recovers |
The mask cancels because . Bob reconstructs the same mask Alice applied, using his private key against Alice’s , and subtracts it back out.
Worked example
AnswerBob's public key is (197,167). Alice sends {(136,128), (246,174)}. Bob subtracts the mask and recovers Alice's message point (112,26).
System parameters: : , generator .
- Bob’s private key: .
- Bob’s public key: .
- Alice’s message, already encoded as a point: . She picks a fresh .
- Alice computes .
- Alice computes the mask .
- Alice masks the message: .
- Alice sends to Bob.
Bob computes , the same mask Alice applied, reconstructed from his own private key and the first half of the ciphertext.
Bob subtracts: , recovering Alice’s message point exactly.
Threat
Reusing the random across two different EC ElGamal messages lets an attacker who has both ciphertexts XOR them together, eliminating the mask and exposing a direct relationship between the two message points, the same failure mode as reusing a one-time pad key.
Control
Choose fresh, at random, for every single message. A one-time mask stops being one-time the moment it is reused, so the fix is procedural, not mathematical: never let repeat.
Mechanism
Security and key size. ECC’s security rests on the ECDLP being hard to solve for given and .
The lecture states the ECDLP is harder, bit for bit, than the classical discrete logarithm or RSA problems,
which is why comparable security needs a much shorter key: 256-bit ECC keys are described as very common,
with 384-bit for higher security. The slides go on to compare these figures directly against RSA key sizes in
a table that did not survive PDF extraction. That specific side-by-side comparison is not reproduced here, but
the general shape of it (ECC keys are much shorter than RSA keys for equivalent security) is the fact the
practice quiz tests, and is stated directly above.
Exam detail
None of the curve arithmetic on this page is examinable. The one fact from this section that appears in the Week 5 practice quiz without a “non-examinable” flag is the general comparison: ECC keys are shorter than RSA’s for equivalent security, because the ECDLP is harder per bit. Treat that one sentence as fair game and everything else here as background.
Pitfall
The binary-field curve equation, , is not the prime-field equation with a different modulus swapped in: it has an extra term and no linear term. Do not mix the two forms up if you are reading both.
Source
Week 5 slides PDF