Cryptography Stack Exchange is a question and answer site for software developers, mathematicians and others interested in cryptography. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to implement an e-voting algorithm, which is described at the paper "Internet Voting Protocol Based on Improved Implicit Security" by Abhishek Parakh & Subhash Kak.

At the Example 1 described in the paper where we have m1=85, at the step 2 it says

"2. Choose randomly and uniformly a number r1 = 101 and compute r2 = m1*(r1)^-1 = 85*(101)^-1=85*28=67mod257"

How is this possible? I mean how can 101^-1 be 28?

share|improve this question

migrated from Jan 17 '13 at 12:10

This question came from our site for professional and enthusiast programmers.

This really should have gone to Math.SE instead, it's purely a number-theoretical computation problem. Its relation to cryptography is incidental at best and is unlikely to ever help someone who's specifically studying the cited paper. – Thomas Jan 17 '13 at 12:41
If you want help implementing something from a paper, please add a link to the paper itself (pdf is good; something behind a paywall is not good). – D.W. Jan 17 '13 at 22:13
The wikipedia article is decent: Modular multiplicative inverse – CodesInChaos Jan 18 '13 at 14:11
up vote 6 down vote accepted

Notice that the result says 67 mod 257. All calculations here are being done modulo 257. So, 101^-1 is actually the modular inverse of 101 mod 257, which is 28. Similarly, 85 * 28 is also done modulo 257.

share|improve this answer
Thank you! That was very useful :) – Anonymous Jan 16 '13 at 0:35

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.