21.2 Elliptic Curves Mod p

If p is a prime, we can work with elliptic curves mod p using the aforementioned ideas. For example, consider

E:y2x3+4x+4(mod5).

The points on E are the pairs (x, y) mod 5 that satisfy the equation, along with the point at infinity. These can be listed as follows. The possibilities for x mod 5 are 0, 1, 2, 3, 4. Substitute each of these into the equation and find the values of y that solve the equation:

x0y24y2, 3(mod5)x1y294y2, 3(mod5)x2y2200y0, 3(mod5)x3y2433no solutionsx4y2844y2, 3(mod5)x=y=.

The points on E are (0, 2), (0, 3), (1, 2), (1, 3), (2, 0), (4, 2), (4, 3), (, ).

The addition of points on an elliptic curve mod p is done via the same formulas as given previously, except that a rational number a/b must be treated as ab1,  where b1b1(modp). This requires that gcd(b, p)=1.

More generally, it is possible to develop a theory of elliptic curves mod n for any integer n. In this case, when we encounter a fraction a/b,  we need to have gcd(b, n)=1. The situations where this fails form the key to using elliptic curves for factorization, as we’ll see in Section 21.3. There are various technical problems in the general theory that arise when 1<gcd(b, n)<n,  but the method to overcome these will not be needed in the following. For details on how to treat this case, see [Washington]. For our purposes, when we encounter an elliptic curve mod a composite n,  we can pretend n is prime. If something goes wrong, we usually obtain useful information about n,  for example its factorization.

Example

Let’s compute (1, 2)+(4, 3) on the curve just considered. The slope is

m32412(mod5).

Therefore,

x3m2x1x222144(mod5)y3m(x1x3)y12(14)22(mod5).

This means that

(1, 2)+(4, 3)=(4, 2).

Example

Here is a somewhat larger example. Let n=2773. Let

E:y2x3+4x+4(mod2773), andP=(1, 3).

Let’s compute 2P=P+P. To get the slope of the tangent line, we differentiate implicitly and evaluate at (1, 3):

2ydy=(3x2+4)dxdydx=76.

But we are working mod 2773. Using the extended Euclidean algorithm (see Section 3.2), we find that 231161(mod2773),  so we can replace 1/6 by 2311. Therefore,

m767×23112312(mod2773).

The formulas yield

x323122111771(mod2773)y32312(11771)3705(mod2773).

The final answer is

2P=P+P=(1771, 705).

Now that we’re done with the example, we mention that 2773 is not prime. When we try to calculate 3P in Section 21.3, we’ll obtain the factorization of 2773.

21.2.1 Number of Points Mod p

Let E:y2x3+bx+c(modp) be an elliptic curve, where p5 is prime. We can list the points on E by letting x=0, 1, , p1 and seeing when x3+bx+c is a square mod p. Since half of the nonzero numbers are squares mod p,  we expect that x3+bx+c will be a square approximately half the time. When it is a nonzero square, there are two square roots: y and y. Therefore, approximately half the time we get two values of y and half the time we get no y. Therefore, we expect around p points. Including the point ,  we expect a total of approximately p+1 points. In the 1930s, H. Hasse made this estimate more precise.

Hasse’s Theorem

Suppose E(modp) has N points. Then

|Np1|<2p.

The proof of this theorem is well beyond the scope of this book (for a proof, see [Washington]). It can also be shown that whenever N and p satisfy the inequality of the theorem, there is an elliptic curve E mod p with exactly N points.

If p is large, say around 1020,  it is infeasible to count the points on an elliptic curve by listing them. More sophisticated algorithms have been developed by Schoof, Atkin, Elkies, and others to deal with this problem. See the Sage Appendix.

21.2.2 Discrete Logarithms on Elliptic Curves

Recall the classical discrete logarithm problem: We know that xgk(modp) for some k,  and we want to find k. There is an elliptic curve version: Suppose we have points A, B on an elliptic curve E and we know that B=kA(=A+A++A) for some integer k. We want to find k. This might not look like a logarithm problem, but it is clearly the analog of the classical discrete logarithm problem. Therefore, it is called the discrete logarithm problem for elliptic curves.

There is no good general attack on the discrete logarithm problem for elliptic curves. There is an analog of the Pohlig-Hellman attack that works in some situations. Let E be an elliptic curve mod a prime p and let n be the smallest integer such that nA=. If n has only small prime factors, then it is possible to calculate the discrete logarithm k mod the prime powers dividing n and then use the Chinese remainder theorem to find k (see Exercise 25). The Pohlig-Hellman attack can be thwarted by choosing E and A so that n has a large prime factor.

There is no replacement for the index calculus attack described in Section 10.2. This is because there is no good analog of “small.” You might try to use points with small coordinates in place of the “small primes,” but this doesn’t work. When you factor a number by dividing off the prime factors one by one, the quotients get smaller and smaller until you finish. On an elliptic curve, you could have a point with fairly small coordinates, subtract off a small point, and end up with a point with large coordinates (see Computer Problem 5). So there is no good way to know when you are making progress toward expressing a point in terms of the factor base of small points.

The Baby Step, Giant Step attack on discrete logarithms works for elliptic curves (Exercise 13(b)), although it requires too much memory to be practical in most situations. For other attacks, see [Blake et al.] and [Washington].

21.2.3 Representing Plaintext

In most cryptographic systems, we must have a method for mapping our original message into a numerical value upon which we can perform mathematical operations. In order to use elliptic curves, we need a method for mapping a message onto a point on an elliptic curve. Elliptic curve cryptosystems then use elliptic curve operations on that point to yield a new point that will serve as the ciphertext.

The problem of encoding plaintext messages as points on an elliptic curve is not as simple as it was in the conventional case. In particular, there is no known polynomial time, deterministic algorithm for writing down points on an arbitrary elliptic curve E(modp). However, there are fast probabilistic methods for finding points, and these can be used for encoding messages. These methods have the property that with small probability they will fail to produce a point. By appropriately choosing parameters, this probability can be made arbitrarily small, say on the order of 1/230.

Here is one method, due to Koblitz. The idea is the following. Let E:y2x3+bx+c(modp) be the elliptic curve. The message m (already represented as a number) will be embedded in the x-coordinate of a point. However, the probability is only about 1/2 that m3+bm+c is a square mod p. Therefore, we adjoin a few bits at the end of m and adjust them until we get a number x such that x3+bx+c is a square mod p.

More precisely, let K be a large integer so that a failure rate of 1/2K is acceptable when trying to encode a message as a point. Assume that m satisfies (m+1)K<p. The message m will be represented by a number x=mK+j,  where 0j<K. For j=0, 1, , K1,  compute x3+bx+c and try to calculate the square root of x3+bx+c(modp). For example, if p3(mod4),  the method of Section 3.9 can be used. If there is a square root y,  then we take Pm=(x, y); otherwise, we increment j by one and try again with the new x. We repeat this until either we find a square root or j=K. If j ever equals K,  then we fail to map a message to a point. Since x3+bx+c is a square approximately half of the time, we have about a 1/2K chance of failure.

In order to recover the message from the point Pm=(x, y) we simply calculate m by

m=x/K, 

where x/K denotes the greatest integer less than or equal to x/K.

Example

Let p=179 and suppose that our elliptic curve is y2=x3+2x+7. If we are satisfied with a failure rate of 1/210,  then we may take K=10. Since we need (m+1)K<179,  we need 0m16. Suppose our message is m=5. We consider x of the form mK+j=50+j. The possible choices for x are 50, 51, , 59. For x=51 we get x3+2x+7121(mod179),  and 112121(mod179). Thus, we represent the message m=5 by the point Pm=(51, 11). The message m can be recovered by m=[51/10]=5.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset