Advaita Saha

TECH

Underneath Modern Cryptography : Introduction to Elliptic Curves

Why do we care so much about cryptograhy?

Cryptography is the guardian of our digital world. It keeps our data, identities, and communications safe in an era of constant connectivity. Without it, our online lives would be vulnerable to cyber threats and privacy breaches. In essence, cryptography is the bedrock of trust in the digital age, ensuring our security and privacy online.

Let’s get few basics cleared up

Cryptography is basically based on a mathematical problem which is very hard to be solved by computers. Cryptography is a field that deals with securing information by converting it into a form that is unintelligible to unauthorized individuals. The basis of cryptography lies in the use of mathematical algorithms and techniques to protect data confidentiality, integrity, and authenticity.

The strength of cryptography lies in the fact that these mathematical problems are computationally hard to solve. For example, factoring large numbers into their prime factors is a time-consuming task for classical computers, especially when dealing with extremely large numbers. This difficulty forms the basis of many cryptographic algorithms, making it infeasible for an attacker to reverse-engineer the original message from the ciphertext without knowledge of the secret key.

Like the prime numbers we talked about, in cryptography we don’t deal with our usual number system, rather we operate within mathematical groups. A group is a set of elements with a binary operation that satisfies a few set of properties. Majority of the algorithms use what we know as the multiplicative group G\mathbb G of integers modulo a sufficiently large prime pp.

So why groups suddenly, leaving our normal number system? For this we need to understand about the Discrete Logarithm Problem (DLP). The DLP is the basis of many cryptographic algorithms, including the Diffie-Hellman key exchange, ElGamal encryption, and the Digital Signature Algorithm (DSA). But more on that later.
Modern cryptography often uses groups, instead of the normal number system (integers) because these groups offer specific mathematical properties that make encryption and security algorithms more robust against attacks, including the difficulty of solving certain mathematical problems, like the discrete logarithm problem, which underlie many cryptographic schemes. These groups provide a foundation for building secure encryption and digital signature systems. And modern cryptography specifically use what we call Elliptic Curve Groups. So let’s have a dive into this modern cryptography, but before that let’s understand what are two of the most important problems in cryptography.

The Discrete Logarithm Problem

The discrete logarithm problem is a fundamental mathematical problem in the field of number theory and plays a central role in modern cryptography, particularly in the security of public-key cryptosystems. The discrete logarithm problem is defined as for a given group G\mathbb G with generator gg and an element hGh \in \mathbb G. G\mathbb{G} is a multiplicative group.

G:{1,g,g2,g3,,gp1}\mathbb{G} : \{1, g, g^2, g^3, \ldots, g^{p-1}\}

Now the problem says, the follows

givenyG,findxsuchthatgx=yExample : Find xsuch that 3x=4mod7\begin{gathered} \text{given} \: y \in \mathbb{G}, \: \text{find} \: x \: \text{such} \: \text{that} \: g^x = y \\ \text{Example : Find } x \: \text{such that } 3^x = 4 \: \text{mod} \: 7 \end{gathered}

Here finding xx is the discrete logarithm problem. The discrete logarithm problem is considered to be computationally infeasible. This means that it is believed that no efficient algorithm exists for computing discrete logarithms in general.

The Computational Diffie-Hellman Assumtion

The Computational Diffie-Hellman Assumption (CDH) is a foundational assumption in cryptography, particularly in the context of the Diffie-Hellman key exchange protocol and related cryptographic systems. This assumption forms the basis for the security of many encryption and key exchange schemes.
This is like an extension to the Discrete Logarithm Problem. The CDH problem is defined as follows: given a group G\mathbb{G} with generator gg and elements gag^a and gbg^b, find gabg^{ab}.

Given a group :G,with generator :g,g,gx,gyG,it is hard to find :gxygivengxandgy\begin{gathered} \text{Given a group :} \: G, \text{with generator :} \: g, \\ g, g^x, g^y \in G, \\ \text{it is hard to find :} \: g^{xy} \: \text{given} \: g^x \: \text{and} \: g^y \end{gathered}

Elliptic Curve Cryptography (ECC)

Our primary example for the group G\mathbb G was the multiplicative group (or subgroup) of integers modulo a sufficiently large prime pp. This group is problematic for a number of reasons, most notably because the discrete log problem in this group is not sufficiently difficult. The best known algorithm, called the general number field sieve (GNFS). It was used in 2019 to solve a discrete log problem modulo a general 795-bit prime. This algorithm is the reason why, in practice, we must use a prime pp whose size is at least 2048 bits. High security applications must use even larger primes. Arithmetic modulo such large primes is slow and greatly increases the cost of deploying cryptosystems that use this group.

Several other families of finite cyclic groups with an apparent hard discrete log have been proposed. Of all these proposals, the group of points of an elliptic curve over a prime finite field is the most suitable for practice, and is widely used on the Internet today. Also because ECC offers same security as of RSA in much smaller key sizes. You can see the significant improvemence in using Elliptic Curves over traditional RSA/AES.\

Key SizeECCRSA
801631024
1282833072
25657115360

By leveraging the difficulty of solving certain mathematical problems on elliptic curves, cryptographic systems can ensure the confidentiality and integrity of sensitive information. The use of elliptic curves in cryptography has gained significant attention due to their efficiency and robustness, making them a cornerstone of modern secure communication.

In short we can see it like a special group of points on a plane, which satisfy a certain mathematical equation. The equation is of the form

y2=x3+ax+b,satisfys4a3+27b20y^2 = x^3 + ax + b, \: \text{satisfys} \:\: 4a^3 + 27b^2 \neq 0

Here you can have 2 elliptic curve elements PGP \in G & QGQ \in G and you can add them to get a new element RGR \in G. The defination of addition method over this group, can be seen diagrammatically below

ecc-addition

You can multiply an element gGg \in G with a scalar aFpa \in \mathbb F_p, where pp is the curve order of group G:h=agG : h=ag. This is called scalar multiplication. There is no way to compute the product of two curve elements: the operation g1g2g_1 \ast g_2 is not defined, as opposed to multiplying by a scalar.

Another important property is that there is no efficient algorithm to compute discrete logarithms. The meaning of this is that given hh and gg with the property that h=agh=ag, if you don’t know aa it is computationally infeasible to find aa.

The equation mentioned about is called the Weierstrass equation. There are other forms of the equation, like the Montgomery form and the Edwards form, and also the twisted Edwards form.

Edwards Curves. Another way to describe an elliptic curve E/EpE/\mathbb{E_p} is in Edwards form, which is

x2+y2=1+dx2y2x^2 + y^2 = 1 + d x^2 y^2

where dFpd \in \mathbb{F_p} satisfies d0,1d \neq 0,1. Again, this curve can be put into Weierstrass form via a simple rational change of variable. The beauty of the Edwards form is that the chord and tangent addition law is extremely easy to describe. For points P=(x1,y1)P = (x_1,y_1) and Q=(x2,y2)Q = (x_2, _y2) in E(Fp)E(\mathbb F_p), we define

PQ:=(x1y2+x2y11+dx1x2y1y2,y1y2x1x21dx1x2y1y2)P \boxplus Q := \bigg(\frac{x_1y_2 + x_2y_1}{1+dx_1x_2y_1y_2}, \frac{y_1y_2 - x_1x_2}{1-dx_1x_2y_1y_2} \bigg)

Let E/FpE/\mathbb{F_p} be an elliptic curve and let E(Fp)E(\mathbb{F_p}) be the group of points on this curve that are defined over Fp\mathbb{F_p}. We know that E(Fp)E(\mathbb{F_p}) is a finite abelian group. Suppose that it also happens to be cyclic, meaning that E(Fp)E(\mathbb{F_p}) is generated by some point PE(Fp)P \in E(\mathbb{F_p}). We can now ask about the complexity of problems like discrete log, computational Diffie-Hellman (CDH), and decision Diffie-Hellman (DDH) in the group E(Fp)E(\mathbb{F_p}). The resulting systems are called elliptic curve cryptosystems.

As we will see, certain elliptic curve groups have an additional structure, called a pairing, that is enormously useful in cryptography. We will see many examples of encryption and signature schemes built using pairings. These systems exhibit powerful properties that are beyond what can be built using the multiplicative group of the integers modulo a prime. Some examples include aggregate signatures, broadcast encryption, functional encryption, and many others. Up until now, we used elliptic curves as an efficient group where the discrete log problem and its variants, CDH and DDH, are believed to be difficult.

This group makes it possible to instantiate efficiently many of the schemes described in earlier chapters. We now show that certain elliptic curves have an additional structure, called a pairing. The pairing enables a world of new schemes that could not be built from discrete log groups without this additional structure. The resulting schemes make up an important area called pairing based cryptography. Why pairing is so important ? This is because with pairing we cannot break the CDH assumption i.e cannot compute gxyg^{xy}. But given the value of gxyg^{xy} as hh, then we can check if it is true or not. This opens up the door to Zero-Knowledge Cryptography