Crypto Tutorial 5 b032110318

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 4

TUTORIAL 5

DANIAL IRFAN AKMAL BIN AKMAL


B032110318

1. Take your i = 10 + (ID mod 100 or nearest assigned number)


i = 10 + 18
i = 18

For i = 18, P1(x1,y1) is (34, 25)


Choose a prime number. Let p=257

2. Choose a random sample, a = -4 and b = 7 for the curve


E:y2 = x3 + ax + b
Such that 4a3 + 27b2 ≠ 0 (mod p)
3. Choose a base point P1 (x1, y1) = (xi, yi). Compute P2 (x2,y2) = 2 ⊗ P1 (x1,y1)
Double Point
Let (x1, y1) be a point on a elliptic curve E(Fp) and (x1, y1) ≠ (x2,-y2)
Then let (x2,y2) = 2 ⊗ P1 (x1,y1) such that

Then x2 = c2 – 2x1 and y2 = c (x1 – x2) – y1.


Take 2y1 = 2 ∙ 25 = 50 mod 257

Then, we need to compute an compute an inverse of denominator


(2y1)-1 ≡ (50)-1 = 293 (mod 257) using Extended Euclidean Algorithm.

b= a∙ q +r u v w = u-v∙q
257 50 5 7 0 1 -5
50 7 7 1 1 -5 36

The answer is (50)-1 = 36 + 257 = 293


Second, we compute the slope of the tangent line.

= [3(34)2 + (-4)](293) = 3464 ∙ 293


= 241 ∙ 293 = 241 (mod 257)

Third, we can start compute the


x2 = c2 – 2x1 = 241 - 2∙34
= 173 (mod 257)

Fourth, we can compute.


y2 = c(x1 – x2) – y1
= 243(-34 – 188) – 25
= 243(-222) – 25
= 243(-222+257) – 25
= 243(35) – 25
= 8480
= 256 (mod 257)

So, double point here is P2 (x2,y2) = (173, 256)

4. Add Point
To compute P3(x3, y3) = P1(x1, y1) ⊕ P2(x2, y2) = (34,25) ⊕ (173, 256)

Let us add 2 points P1(x1, y1) ⊕ P2(x2, y2) = (34,25) ⊕ (173, 256).
First, we compute denominator of the slope of secant line, (x2 -x1) = 173 – 34 = 139
Using Extended Eucladian Algorithm
b= a∙ q +r u v w = u-v∙q
257 139 1 118 0 1 -1
139 118 1 21 1 -1 2
118 21 5 13 -1 2 -11
21 13 1 8 2 -11 -9
13 8 1 5 -11 -9 -20
8 5 1 3 -9 -20 11
5 3 1 2 -20 11 -31
3 2 1 1 11 -31 44

Second, we need to an inverse of the denominator, (x2 -x1)-1 = 139-1 ≡ 44 (mod 257)
Let us compute the numerator = y2 -y1 = 256 – 25 = 231
Third, the slope of secant line shall be.

= 231.44 ≡ 10164 = 141 (mod 257)


Finally, we can compute the add point.

x3 = m2 – (x1 + x2) = 1412 – (173 + 34) = 92 – (173 + 34) = -47 +257 ≡ 210 (mod 257).

and

y3 = m(x1 – x3) – y1 = 141(173 – 210) – 25 = 141(-37) – 25

= 141(-37+257) – 25

= 141(220) – 25 = 180 - 25 ≡ 155 (mod 257)

Final answer is 3 ⊗ (34, 25) = (210, 155)

You might also like