Skip to main content

Elliptic Curve Cryptography

Main Source:

Elliptic Curve Cryptography is a form of public key cryptography that is based on the properties of elliptic curve when they are defined over finite fields.

Elliptic Curve

An elliptic curve is a mathematical curve defined by y2=x3+ax+by^2 = x^3 + ax + b.

Elliptic curve
Source: https://www.globalsign.com/en/blog/elliptic-curve-cryptography

aa and bb are the constants that defines the curve, and xx and yy are the coordinates of points on the curve. The equation represents the set of points (x,y)(x, y) that satisfy the equation.

The unique properties of elliptic curve is that they are symmetric around the x-axis. When you draw a line from two point, the line will always intersect another point somewhere.

Elliptic curve intersection
Source: https://www.globalsign.com/en/blog/elliptic-curve-cryptography (with modification)

The operation that involves taking two point and obtaining the intersection point is called the "dot" operation. We can keep repeating this operation, the intersection point will be reflected over the x-axis, and we will draw another line from the first point to the new reflected point.

Elliptic curve intersection repeat
Source: https://blog.cloudflare.com/a-relatively-easy-to-understand-primer-on-elliptic-curve-cryptography/

After doing a lot of dot operation, it is said to be hard to arrive again at the initial point.

ECDLP

The Elliptic Curve Discrete Logarithm Problem (ECDLP) is the problem of finding the scalar value kk in the equation kP=QkP = Q. In this equation, PP is a known point on the elliptic curve, QQ is another point on the curve, and kk is the scalar value that needs to be determined.

To relate this with the graphical illustration, we need to find how many times we need to do the dot operation in order to arrive at the same initial point. There is also a limit of how many dot operation we can do, it is denoted as nn. The nn should be a prime number, prime number is said to have unique properties that makes the problem becomes harder to solve.

So, when we have n=1000n = 1000, this mean there are 1000 possible addition or 1000 possible dot operation. Out of all 1000 operation, we will need to find the one number kk inside the range of nn that makes the intersection point same as the initial point.

ECDLP

As of now, there are no efficient algorithms that can find the value of kk, while the brute force algorithm is computationally infeasible for large nn. For example, if nn is a 256-bit prime, there are approximately 22562^{256} possible values of kk to check.

Relating the ECDLP problem to cryptography, the nn is the key size of the encryption, the value of kk is the private key that is kept secret and hard to be found, and the public key is all the multiple of initial point, it is the P, 2P, 3P, 4P or all the intersection in the graphical illustration.

Elliptic Curve Diffie-Hellman

The Diffie-Hellman key exchange is a traditional key exchange method. Elliptic Curve Diffie-Hellman (ECDH) is a key exchange algorithm based on the Diffie-Hellman (DH) protocol that utilizes elliptic curve cryptography (ECC).

Explanation

Just like the traditional Diffie-Hellman, two parties are going to share the same secret key.

  1. Key Generation:

    • Each party, let's say Alice and Bob, generates their own elliptic curve key pair, which consist of a private key and a corresponding public key.
    • The private key is denoted as aa for Alice and bb for Bob, and it's a randomly generated scalar value, which is an integer.
    • The public key is a specific point on the curve, it is obtained by scalar multiplication of private key and a chosen base point GG on the elliptic curve.
    • For Alice, it will be A=aGA = aG, for Bob, it will be B=bGB = bG.
  2. Key Exchange:

    • Alice sends her public key AA to Bob, and Bob sends his public key BB to Alice.
  3. Shared Secret Key Computation:

    • Alice computes the shared secret key S=aB=a(bG)=(ab)GS = aB = a(bG) = (ab)G.
    • Bob computes the shared secret key S=bA=b(aG)=(ab)GS = bA = b(aG) = (ab)G.

    ECDH
    Source: https://asecuritysite.com/ecdh

Security

The security of ECDH relates to the ECDLP problem. Even if the attacker intercepts the base point GG and the public key AA or BB, which is equal to aGaG or bGbG, it will be hard to find the value of aa or bb. Finding aa or bb is the same as finding the value of integer kk.