Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.
Math 152 - Intro to Mathematical Software
2017-03-17
Kiran Kedlaya; University of California, San Diego
adapted from lectures by William Stein, University of Washington
Lecture 28: Elliptic curve cryptography; and what next?
Announcements:
Last lecture! Remember, there is no final exam for this course.
Remaining office hours this week:
Peter: today 3-4 in APM 6132.
Homework due Friday, 8pm. Peer grading due Sunday, 8pm.
Last call for course evaluations (CAPE)! Evaluations close Monday, March 20 at 8am. (These are needed in part to justify rerunning this course in the future.)
Elliptic curve cryptography
So far, the public key cryptography techniques we have discussed are:
Diffie-Hellman, whose security depends on the difficulty of computing discrete logarithms;
RSA, whose security depends on the difficulty of integer factorization.
While these problems remain fairly difficult with standard techniques, some improvements have been made over the years. In practice, the best-performing methods for large problem sizes (for both discrete logarithms modulo a prime and integer factorization) are forms of the number field sieve (see https://en.wikipedia.org/wiki/General_number_field_sieve).
For this reason, it is desirable to look for variants. One commonly used variant is elliptic curve cryptography. This uses concepts which are somewhat more sophisticated than the ones needed so far, but which (in various forms) have been known to mathematicians for many centuries!
An elliptic curve is (in its simplest form) an equation of the form for some values and . (Note that the plot of such a curve is not an ellipse! The name arises from the original study of these curves in connection with the computation of the arclength of a sector of an ellipse.)
An amazing feature of elliptic curves is the group law: there is a natural way to add points on the curve! Explaining why this works is somewhat out of scope for this course, but we can at least experiment with this in Sage. (Warning: to make this statement completely correct, we must add one point at infinity corresponding to the vertical asymptote; this point will be the identity element for the group law.)
To make this relevant for cryptography, instead of working over the rational numbers, we work over the integers modulo a prime number . In this context, the set of solutions is finite; in fact, it has size roughly . (To be precise, there is a theorem of Hasse that says that the size differs from by no more than .)
We can try to imitate the mechanism of Diffie-Hellman; that mechanism used only the fact that multiplication of the nonzero residue classes modulo defines a commutative group structure. Since the elliptic curve group law has the same feature, we could try using it instead!
However, there is a catch. Remember that for Diffie-Hellman modulo a prime , if factors nontrivially then that factorization can be used to simplify the discrete logarithm problem. (Structurally, the abelian group we are working in has a product structure, and we can compute the discrete logarithm separately on each factor of the product.)
There is a similar catch here, except that must be replaced by the order of the corresponding group, i.e., the number of points on the elliptic curve mod (including the point at infinity). But this isn't given by such an obvious formula...
The problem of counting these solutions was originally addressed by Gauss in certain special cases. As noted earlier, it was shown by Hasse (1930s) that the count is always plus an error term no bigger than .
One way to compute the order is to use the "baby step-giant step" method demonstrated for discrete logarithms on Monday. Hasse's bound cuts down the runtime of this from to .
There is also a more sophisticated algorithm due to Schoof (1980s) that actually makes this problem polynomial-time (in the logarithm of , not in ). This is the tip of a very large iceberg of computational number theory, which is both interesting in its own right (at least to me) and applicable to cryptography in various ways. (Besides this construction, there is a whole field of lattice-based cryptography that uses different number-theoretic ideas to fight off attacks based on the potential feasibility of quantum computation.)
What next?
There is currently a campus-wide initiative to develop an undergraduate degree program in data science, with Python as the primary programming language. Courses in various departments related to this program should be starting to come online in the near future (including a more permanent version of this course in the math department).
If any particular topics in this course piqued your interest, you may be able to follow up on them.
Abstract algebra: 100A-C, 103A-B.
Combinatorics and graph theory: 154, 184.
Cryptography: 187A-B. In particular, 187B is a new course on "mathematics of modern cryptography" taught by Prof. Bucur (starting this spring).
Data science: 189 (inference), or better yet the new data science major: http://www.ucsd.edu/catalog/curric/DS.html. In particular, DS10 (starting next fall) will be an introduction to Python programming.
Number theory: 104A-C.
Statistics: 181A-B, 183, and especially 185 (computational statistics).
For additional advice, feel free to ask me by email, or set up (also by email) an appointment to talk in person.
Some interest has been expressed in setting up an informal seminar next quarter to follow up on the use of Python in scientific computation. If this progresses further, I'll make an announcement by email.
There are lots of career opportunities for which a good handle on mathematical computation is a big asset. For example, a friend of mine who runs a biochem/comp bio/med lab in Boston is looking to hire a data scientist! Contact me for details.
Finally, thanks for being my "experimental subjects" in this course! This has been a tremendous learning opportunity for me on various fronts, and I look forward to using what I learned to developing a refined version of this course for future cohorts of students.