-1
$\begingroup$

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 ?

$\endgroup$
  • $\begingroup$ ... forming a more specific question. $\endgroup$ – Paul Uszak Jun 6 '17 at 22:31
  • $\begingroup$ @Paul Uszak I wonder that i should use C = M^e mid n and M = C^d mod n $\endgroup$ – Walter White Jun 6 '17 at 22:37
  • $\begingroup$ The P-H cipher is popular today. @WalterWhite, yes, those are the formulas you use. Is there a question beyond that? $\endgroup$ – user47922 Jun 6 '17 at 23:50
  • $\begingroup$ @galvatron, thats all I woulded to know, thanks, for advice. $\endgroup$ – Walter White Jun 7 '17 at 8:44
  • $\begingroup$ What is the actual question here? I don't think a question "Am I doing this right, if I use the formulas I got from some source?" is actually useful to anyone else. $\endgroup$ – tylo Jun 7 '17 at 13:16
1
$\begingroup$

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.

$\endgroup$
  • 2
    $\begingroup$ 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$. $\endgroup$ – fgrieu Jun 7 '17 at 13:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.