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)
M = (27, 40) - (27, 3)
(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?