# Shamir three-pass protocol Elliptic Curve

I want to know how I can implement this protocol. I know how Shamir three pass protocol operates without elliptic curve, but I don't know how I can perform it with elliptic curve.

1. Alice convert the message in a point $$M$$ of the elliptic curve. Then she picks a random element $$k$$ that belongs to the finite field of elliptic curve. Then she encrypt with $$k \times M$$ to generate $$kM$$, right?

2. Bob picks a random element $$q$$ that belongs to the finite field. Then he encrpyt the point received from alice to generate $$q(kM)$$, for this he computes $$q \times (kM)$$.

3. Alice decrypt the message with the inverse of $$k$$.

It is possible? The function decrypt would be $$k^{-1} \times q(kM)$$? Then, Alice send $$qM$$ to Bob.

1. Bob decrypt wit the inverse of $$q$$. He decrypts in the same way that Alice does.

I think that this are the steps for this protocol but it does not work in my SAGE implementation. Can somebody indicate if I missed anything?

• I could solve the problem. This steps are correct but the problem was in the way to calculate $k^{-1}$. This must be the multiplicative inverse of $k$ over N=# E(Fp ), that is, the order of the elliptic curve. Thanks – Cugar19 Jan 13 at 20:03
• Glad you've got it solved. Unfortunately you cannot answer < 15 rep, but feel free to answer yourself if you have gained that amount of reputation. – Maarten Bodewes Jan 14 at 11:50