Elliptic Curve Cryptography (ECC)
Elliptic Curve Cryptography (ECC)
(max.)
ECC -
Introduction
• An elliptic curve the set of points that satisfy a specific
mathematical
is equation.
𝑦2 = 𝑥3 + 𝑎𝑥 + 𝑏(𝑓𝑜𝑟 𝑠𝑜𝑚𝑒
𝑐𝑜𝑛𝑠𝑡𝑎𝑛𝑡𝑠)
𝐷𝑒𝑡𝑒𝑟𝑚𝑖𝑛𝑎𝑛𝑡 4𝑎3 + 27𝑏2 ≠ 0
𝑦2 = 𝑥3 + b=2.𝑎𝑥 + 4𝑎3+27𝑏2 ≠ 0
𝑏 2 3
E.g. (x,y)=(2,4) for a=3,
4 = 2 + 3.2 + 4. 33+27. 22 ≠
0
2
16 = 8 + 6 +
2
4.27+27.4 ≠
16 0
=16
Types of Elliptic
curves
1. Elliptic curves on real numbers.
2. Elliptic curves on complex numbers.
3. Elliptic curves on finite fields. E.g. GF(2), GF(5), GF(8).
Hence the equation for elliptic curve over finite field,
• 𝑦2 ≡ 𝑥3 + 𝑎𝑥 + 𝑏 𝑚𝑜𝑑 𝑝, 𝑎 < 𝑝, 𝑏 < 𝑝
• 4𝑎3+27𝑏2 (𝑚𝑜𝑑 𝑝) ≠ 0
How to construct an elliptic curve
over finite field?
• Consider Z/11 = {0 , 1, 2, 3, 4, 5, 6, 7, 8, 9, 10}.
• p=11, a=1, b=1. 4𝑎3+27𝑏2 (𝑚𝑜𝑑 𝑝) ≠
0
4.13+27. 12 (𝑚𝑜𝑑 11)
4+27 (𝑚𝑜𝑑 11)
≠0
≠0
31 (𝑚𝑜𝑑 11) ≠ 0
31 (𝑚𝑜𝑑 11) ≠ 0
How to construct an elliptic curve over finite
field? Cntd..
𝑦2 ≡ 𝑥3 + 𝑎𝑥 + 𝑏 𝑚𝑜𝑑 𝑝 𝑦2𝑚𝑜𝑑 11 𝑥3 + 𝑥 + 1 (mod 11)
+𝑏 𝑝
1 1 (y=1) 3 (x=1)
𝑚𝑜𝑑
2 4 (y=2) 0 (x=2)
𝑦2𝑚𝑜𝑑 11 = 𝑥3 + 𝑥 11
3 9 (y=3) 9 (x=3)
+1
4 5 (y=4) 3 (x=4)
(0,1), (0,10), (1,5), (1,6), (2,10), (3,3), (3,8), (4,5), 5 3 (y=5) 10 (x=5)
(4,6), (6,5), (6,6), (8,2), (8,9).
Set of points generated: 6 3 (y=6) 3 (x=6)
Y 7 5 (y=7) 10 (x=7)
Plot
16
8 9 (y=8) 4 (x=8)
14
12 9 4 (y=9) 2 (x=9)
10
10 1 (y=10) 10 (x=10)
8
0 1 2 3 4 5 6 7 8 9
Checking if a point falls on the
curve?
• (3,8)= 82𝑚𝑜𝑑 11 = 33 + 3 𝑚𝑜𝑑
+1 11
9 = 31 𝑚𝑜𝑑 11
9=9
ECC – Addition (1)
“POINT
DOUBLING”
ECC – Addition (3)
Problem (For two distinct points, P≠Q)
• For E29 (16, 14), consider the point P = (5, 25) and Q=(12, 7).
Compute the value of P+Q.
• p = 29, a = 16, b = 14
• P = (5, 25), Q = (12, 7)
• x1 = 5, y1 = 25, x2 = 12, y2 = 7
1. X3 = (λ2 – x1 – x2) mod p
2. Y3 = (λ (x1 – x3) – y1) mod p
3. y2 – y1mod p
X2 – x 1
Calculate λ value 7-1 mod 29
7 x ? mod 29 = 1
• y2 – y 1
Possible values are 1 to n-1, so, 1 – 28
mod p
X2 – x 1 29/7 = 4.14,
7 x 5 mod 29 = 35 mod 29 = 6 – wrong
7 – 25 mod 29 Try with multiples of 29
12 – 5 29 x 2 = 58
7 x ? mod 58 = 1
= -18 / 7 mod 29 58 / 7 = 8.2
7 x 9 mod 58 = 63 mod 58 = 5 – wrong
= -18 (1/7) mod 29
Similarly, when we try with
= -18(7-1) mod 29 29 x 3, 29 x 4, 29 x5 - wrong
= -18 x 25 mod 29 Finally,
= -450 mod 29 29 x 6 = 174
7 x ? mod 174 = 1
= 29 – (450 mod 29) 174 / 7 = 24.85
7 x 25 mod 174 = 175 mod 174 = 1-Right
= 29 – 15 7 x 25 mod 29 = 1 – Right
14
Answer is 25
Alternative Method to find multiplicative inverse value
(EEA Method)
q a b r t1 t2 t
4 29 7 1 0 1 -4
7 7 1 0
• Here, moduli is 29 and final t value also a small number than moduli.
• If final t value is bigger number than moduli, we can not do this addition.
Calculate x3 value
• X3 = λ2 – x1 – x2 mod p
• λ = 14, x1 = 5, x2 = 12, p = 29
• X3 = 142 – 5 – 12 mod 29
• X3 = 196 – 17 mod 29
• X3 = 179 mod 29
• X3 = 179 mod 29
• X3 = 5
Calculate y3 value
• Y3 = λ (x1 – x3) – y1 mod p
• λ = 14, x1 = 5, x3 = 5, y1 = 25, p = 29
• Y3 = 14 (5 – 5) – 25 mod 29
• Y3 = – 25 mod 29
• Y3 = 29 - ( 25 mod 29)
• Y3 = 29 – 25
• Y3 = 4
• Alternate Method
• Y3 = – 25 mod 29
• When you have negative value (But, it must be smaller than moduli. Here
25 is lesser than 29, For ex, -30 is not applicable here), So, Add -25 with
mod value.
So, -25 + 29 = 4
• Y3 = 4 mod 29
• Y3 = 4.
Checking (x3, y3) lies on the curve E29 (16, 14)
• Y32 mod p = x33 + ax3 + b (mod p)
• Y3=4, p = 29, x3= 5, a = 16, b = 14
• 42 mod 29 = 53 + 16 x 5 + 14 (mod 29)
• 16 mod 29 = 125 + 80 + 14 (mod 29)
• 16 = 219 mod 29
• 16 = 16
• Hence, P + Q = (5, 4)
P+Q = (6,3)
P = (3,5)
Q = (4,5)