In the following will denote a prime greater than , and the field of integers modulo . We will be talking about “addition”, as previously studied, on a cubic curve given in Weierstrass form, i.e., , with coefficients in , and points of will be pairs of elements in . A reference for this material is the book A Course in Number Theory and Cryptography by Neal Koblitz, published in 1987 by Springer. Some information may also be found online; for example, one might look at Wikipedia.
The basic idea is to use the El Gamal method — which makes sense for a (large) finite cyclic group. The case where the finite cyclic group is the multiplicative group for some odd prime was discussed previously in the course. Here the task is to use the method with a cyclic subgroup of the points on an elliptic curve over , when is an odd prime.
As before, characters are represented by numbers; in particular, characters and standard symbols in U.S. English may be represented by their ASCII codes, which are integers from to . The question here is how to represent a number in this range by a point of . In the first place must be large enough that contains at least points. Since for a point of the second coordinate is the root of a quadratic polynomial in the first coordinate , letting be and then solving for will not lead to a root in unless the discriminant of the corresponding quadratic equation is the square of an element of . Precisely half of the non-zero elements of are squares, so the discriminant will be a square roughly half the time. Because of that cannot simply be but rather something determined by that offers a range of possible values of .
One chooses an integer so that is an acceptably small probability of failure to find a for given . The idea then is, for a given value , to try as many as different values of until there is found a with on . The values of one tries are The event that one does not find a after trying all of these values has probability . If a is found, then the point becomes the point of the curve representing the number . There is no secrecy in this. The original number may be recovered from as the largest integer strictly smaller than or where the function returns the least non-negative residue of an integermod. It is necessary that if this method is to be viable for representing integers by a point on a given curve over .
Inasmuch as the basic El Gamal technique needs a cyclic group, in order to be sure that the points on an elliptic curve obtained by the method of the previous section to represent codes all lie in a cyclic subgroup of , it is almost necessary to choose and so that the entire group is cyclic. This is, in particular, the case if the size of is square-free.
Here the question is encoding for secrecy of the points on a curve. Suppose that is a point, regarded as the “base”, of large order relative to the arithmetic on . This applies, in particular, when the group of points of in is cyclic and is a generator. For example, if the number of all points of happens to be prime, which is far from always true, then any point of other than the origin has order . As suggested above, for any the number of its points is usually somewhere around since there are two points on for each of the roughly values of for which there is a except for the case when leads to a quadratic equation for having discriminant . In this scheme a single point on will be encrypted by a pair where both and are points of .
The designer of the scheme picks the prime , the curve , a “base point” on of large order, all of which are to be public, and a secret element of . With those items fixed, the designer publishes one more point on that is determined by the formula . For given and , the scheme's “public key” is the pair of points and on .
A user of this scheme may encode a point of as follows: (i) draw a random value modulo the order of and then (ii) produce the pair of points using the formulae: Anyone who knows the secret value as well as the published data may recover the original point from the pair using the simple formula Security for this system relies on it being difficult to ascertain even though and are both known.