Ask Your Question

Three-Pass Protocol

asked 2013-11-05 10:46:17 -0500

00Luca00 gravatar image

updated 2013-11-05 10:58:56 -0500

tmonteil gravatar image

I am currently trying to make an example for the three pass protocol. Maybe someone can tell me my mistake, because it doesn't work out. There is no error, but the numbers don't fit.

#Prime p = 8885569519.
#Let a = 7 and b = 17.
#Alice knows K = 263785119.

#Over the Ring mod p-1
R = IntegerModRing(8885569518)
K = 263785120
a = 11
b = 17

#Alice calculates K^a:
Ka = R(K)^a

#Bob calculates (K^a)^b:
Kab = R(Ka)^b

#Alice recives Kab and calculates((K^a)^b)^a^(-1).
#first a^(-1)
y = 1/R(a)
#then y*a % p-1 = 1 (p-1 = 8885569518)
Kaby = R(Kab)^y

#Kaby should be the same as K^b:
Kb = R(K)^b
#but it isn't

#The inverse of b:
z = 1/R(b)
KK = R(Kaby)^z

K^a^b^a^(-1) should be the same as K^b, but it doesn't work out. Does someone see my mistake?

Thank you and best, Luca

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted

answered 2013-11-05 12:29:02 -0500

While your computations for y and z are correctly done (I think) in Z/(p-1), your computations with K need to be done in Z/(p) instead. So add another ring:

R = IntegerModRing(8885569518)
S = IntegerModRing(8885569519)
K = 263785120
a = 11
b = 17

Ka = S(K)^a

y = 1/R(a)
edit flag offensive delete link more

answered 2013-11-06 10:14:14 -0500

this post is marked as community wiki

This post is a wiki. Anyone with karma >750 is welcome to improve it.

I found the problem. It was that if I calculated R(Ka^y) it simply should have been K, but it wasn't. So I tried

  'Kaby = R(K^(a*b*y))'

and this way it works and is the same as Kb. And also


So I didn't try your suggestion. But thanks a lot for the response!! :)

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools


Asked: 2013-11-05 10:46:17 -0500

Seen: 66 times

Last updated: Nov 06 '13