Implementing the D-H algorithm on elliptic curves
In this section, we will implement the D–H algorithm on elliptic curves. We saw the D–H algorithm in Chapter 3, Asymmetric Encryption. You should remember that the problem underlying the D–H key exchange is the discrete logarithm. Here, we will demonstrate that the discrete logarithm problem could be transposed on elliptic curves too.
First of all, we are dealing with an elliptic curve (mod p
). The base point or generator point is the first element in the D–H original algorithm represented by (g
), and here we denote it by (G
). Let's look at some elements to take into consideration:
G
: This is a point on the curve that generates a cyclic group.Cyclic group means that each point on the curve is generated by a repeated addition (we have seen point addition in the previous section).
- Another concept is the order of G denoted by (
n
):ord(G) = n
The order of (
G
) = (n
) is the size of the group...