-1

Let $n = 7$.

I try something like this:

$$ n =p = 7 \rightarrow \phi(n) = 6 $$ I chose $d = 17$ and $m = 3$. $$ e = d^{-1} \text{ mod } \phi(n) = 17^{-1} \text{ mod } 6 = 5 $$ $$ 17x \text{ mod } 6 = 1 $$ $$ x = 5 $$ What I should doing further ?

Walter White
  • 113
  • 2

1 Answers1

1

For the Pohlig-Hellman cipher, let's say you want to encrypt $M=3$ with $(e,d,p) = (5,17,7)$ as stated in your question. Then you do:

$$ C = M^e \text{ mod } n = 3^5 \text{ mod } 7 = 5$$

If you want to decrypt, then do:

$$ M = C^d \text{ mod } n = 5^{17} \text{ mod } 7 = 3$$,

As expected.

  • 2
    Yes. However the example uses $d=17\ge\phi(n)=6$ which is unusual. $d'=d\bmod\phi(n)=17\bmod6=5$ will do just as well as $d=17$. And then we realize the unfortunate coincidence $e=d'$, that is encryption and decryption are the same operation. Conclusion: $n=p=7$ was too small for a valid example; I vote for $n=p=29$, giving $e=d^{-1}\bmod\phi(n)=17^{-1}\bmod28=5$, thus$(e,d,p) = (5,17,29)$, $C = M^e \bmod n = 3^5 \bmod29 = 11$, $M = C^d \bmod n = 11^{17} \bmod29 = 3$. – fgrieu Jun 07 '17 at 13:48