# Elliptical Curve Cryptography decryption resulting point at infinity?

I am building a web app to encrypt and decrypt using an ECC algorithm.

I use the following curve parameters:

Prime p = 43
a = 7
b = 3

public key e1 = 11
private key d = 3
let say i want to encrypt character that is on point (38, 12)


So I calculate its cipher which results in

c1 = (11, 32)
c2 = (27, 40)


I'm sure that both of my cipher is correct because I already calculated it manually.

The problem is, when I want to decrypt it, I have to calculate

M = c2 - d * c1
d * c1 = (27, 3)


so,

M = (27, 40) - (27, 3)


Since point (27, 40) and (27, 3) is a straight line, it will resulting point infinity. Beacuse we can’t calculate the lambda since

x2-x1 = 21 - 27 = 0


and the lambda formula is

y2-y2 / x2-x1


and we can’t divide number to zero.

How to solve this problem? How do I get my original point if my cipher resulting point at infinity?

• 'Since point (27, 40) and (27, 3) is a straight line, it will resulting point infinity.'; actually, not. $(27, 40) - (27, 3) = (27,40) + (27,40)$, that is, we have a point doubling... Commented Feb 24, 2018 at 18:37
• how can (27, 3) can turn to (27, 40) and not (27, -3)? please explain, i dont understand, hehe
– hphp
Commented Feb 24, 2018 at 18:56
• @hphp: $(27,40)$ and $(27,-3)$ represent the same point. Computations are done in $\mathbb{F}_{43}$: $-3 \bmod 43 = 40$. Commented Feb 24, 2018 at 19:11

Since point $(27, 40)$ and $(27, 3)$ is a straight line, it will resulting point infinity.'; actually, not. $(27,40)−(27,3)=(27,40)+(27,40)$, that is, we have a point doubling...
how can $(27, 3)$ can turn to $(27, 40)$ and not $(27, -3)$?
$(27,40)$ and $(27,−3)$ represent the same point. Computations are done in $\mathbb F_{43}: −3\bmod43=40$