Overview

6 Finding good cryptographic elliptic curves

This chapter explains how to search for elliptic curves that are suitable for cryptography by combining mathematical ideas with practical software tools. The main goal is to find curves whose group structure makes them secure and efficient for protocols from earlier chapters. To do that, the chapter uses PARI/gp and its library interface, showing how these tools can compute curve properties such as the number of points on a curve and help verify curve implementations during development.

A major focus is the process of testing ordinary elliptic curves over large prime fields. The chapter introduces the curve equation, the relationship between the field prime and the curve’s cardinality through Hasse’s theorem, and the idea that a useful curve should have a large prime factor in its group order, preferably with a small cofactor. It then describes a search strategy: generate candidate curves, compute their number of points, strip away powers of two, check for small unwanted factors, and keep only those with a sufficiently large prime remainder. The chapter also shows how to set up this process in both interactive PARI/gp sessions and C code using libpari.

The final part explains why certain curves are rejected as unsuitable. A curve is not “good” just because its point count has a large prime factor; it also needs to resist attacks that exploit weak structure, especially small cofactors or small field extensions. The chapter notes that the curves found by the search method tend to have large enough extension degree to avoid the MOV attack and cofactor 1, which removes another class of weaknesses. It closes by emphasizing that curve selection is context-dependent: security, speed, and implementation details all matter, so finding a strong curve may require testing several field primes and running many searches before settling on a final choice.

General curve-finding algorithm
figure
Accept or reject curve
figure

Summary

  • Ordinary elliptic curves over finite fields are defined by the equation \[E:y^2=x^3+a_4 x+a_6\text{ mod }p\]and \(a_6\neq 0\).
  • The cardinality of an elliptic curve is\[\#E=p+1-t\]where \(|t|<2\sqrt{p}\) and \(t\) is called the trace of Frobenius.
  • PARI/gp is both a math calculator and library with an API for computing cardinality and factors of elliptic curves.
  • For this book, specific primes are chosen for several security levels. The form is \(h\cdot 2^n+1\).
  • Libpari requires specific initialization. Requesting gigabytes helps with very large primes.
  • Finding good curves for cryptography demands a small cofactor and one large prime for cardinality. For ordinary curves, demanding a cofactor of 1 is possible and highly recommended for best security.
  • Bad curves for cryptography have too low an embedding degree or too many small cofactors. For random ordinary curves, both conditions are avoidable with careful searching.

FAQ

What is the purpose of using PARI/gp in this chapter?PARI/gp is used as a mathematician’s tool to compute elliptic curve properties, especially the number of points on a curve. It helps check whether a curve is suitable for cryptography and is also useful for debugging elliptic curve code.
Why does the chapter focus on finding “good” elliptic curves?Good cryptographic curves make attacks harder by forcing an attacker to work against many possible curve choices. The chapter’s goal is to find curves with properties that are secure and practical for cryptographic applications.
What does it mean for an elliptic curve to be “good” for cryptography?A good curve typically has a large prime cardinality, a small cofactor, and a large field extension so it resists common attacks. These properties reduce the chance of easier subgroup or mapping-based attacks.
How does PARI/gp represent an elliptic curve over a finite field?In PARI/gp, an elliptic curve can be created with ellinit([a4, a6], p), where p is the prime defining the finite field. The bracketed pair [a4, a6] is required because gp treats it as a vector input.
What information does the E.group command return in PARI/gp?E.group returns the group order, cyclic structure, and generators of the elliptic curve. In particular, it gives the number of points on the curve and the point or points that generate the group.
Why does the code remove powers of 2 from the curve cardinality?The algorithm strips off powers of 2 first so it can examine the odd part of the curve order. This makes it easier to determine whether the remaining factor is prime or has only small acceptable cofactors.
What role does gcdii() play in the curve-search program?gcdii() is used to detect whether the curve cardinality shares small factors such as 3, 5, 7, or 11. If small factors are present, the program removes them and checks whether what remains is a large prime.
Why does the program ignore curves with too many small factors?Curves with too many small factors have large cofactors or weak structure, which is undesirable for cryptography. The program keeps only curves that leave a sufficiently large prime factor after removing small primes and powers of 2.
What is the trace of Frobenius and why is it important?The trace of Frobenius is the value t in the relation #E = p + 1 - t. It helps relate the field prime to the curve cardinality and shows how close the curve order is to the field size.
Why are some curves considered “bad” even if they have a large prime cardinality?Even with a large prime cardinality, a curve may still be weak if its field extension is too small, because that can make it vulnerable to attacks like MOV. A curve is only considered secure if it also avoids these lower-dimensional weaknesses.

pro $24.99 per month

  • access to all Manning books, MEAPs, liveVideos, liveProjects, and audiobooks!
  • choose one free eBook per month to keep
  • exclusive 50% discount on all purchases
  • renews monthly, pause or cancel renewal anytime

lite $19.99 per month

  • access to all Manning books, including MEAPs!

team

5, 10 or 20 seats+ for your team - learn more


Close
choose your plan

team

monthly
annual
$49.99
$499.99
only $41.67 per month
  • five seats for your team
  • access to all Manning books, MEAPs, liveVideos, liveProjects, and audiobooks!
  • choose another free product every time you renew
  • choose twelve free products per year
  • exclusive 50% discount on all purchases
  • renews monthly, pause or cancel renewal anytime
  • renews annually, pause or cancel renewal anytime
  • Elliptic Curve Cryptography for Developers Elliptic Curve Cryptography for Developers ebook for free
Close
choose your plan

team

monthly
annual
$49.99
$499.99
only $41.67 per month
  • five seats for your team
  • access to all Manning books, MEAPs, liveVideos, liveProjects, and audiobooks!
  • choose another free product every time you renew
  • choose twelve free products per year
  • exclusive 50% discount on all purchases
  • renews monthly, pause or cancel renewal anytime
  • renews annually, pause or cancel renewal anytime
  • Elliptic Curve Cryptography for Developers Elliptic Curve Cryptography for Developers ebook for free
Close
choose your plan

team

monthly
annual
$49.99
$499.99
only $41.67 per month
  • five seats for your team
  • access to all Manning books, MEAPs, liveVideos, liveProjects, and audiobooks!
  • choose another free product every time you renew
  • choose twelve free products per year
  • exclusive 50% discount on all purchases
  • renews monthly, pause or cancel renewal anytime
  • renews annually, pause or cancel renewal anytime
  • Elliptic Curve Cryptography for Developers Elliptic Curve Cryptography for Developers ebook for free