3
$\begingroup$

An implication of Fermat's Little Theorem is the following:

If $p$ is prime, and $a$ is not a multiple of $p$, then $$r \equiv s \pmod {p-1} \implies a^r \equiv a^s \pmod p.$$

I need this implication to prove the verification of the Elgamal signature, but I honestly do not see how to derive from Fermat's Little Theorem to this implication and I could not find any proof of this.

Any help would be much appreciated!

$\endgroup$
5
$\begingroup$

Assume without loss of generality that $r\geq s$, so $r=s+k(p-1)$ for some $k\geq 0$. Then $a^r=a^sa^{k(p-1)}$. Can you see how to get from here to what you want?

| cite | improve this answer | |
$\endgroup$
  • $\begingroup$ Yes, because $a^{k(p-1)}= a^{(p-1)^k} = 1^k = 1$. Thank you! $\endgroup$ – Joey Jun 10 '18 at 10:22
0
$\begingroup$

There is a more universal Theorem to get it.
The Theorem lies in 《elementary number thoery 6th》 Theorem 9.2.
It can be used to prove the verification of the Elgamal signature and DSA.
DSA is a much more popular variant of the Elgamal signature.

Theorem 9.2 If $a$ and $n$ are relative prime integers with $n>0$,then $a^i \equiv a^j \pmod n$,where i and j are nonnegative integers, if and only if $i \equiv j \pmod {ord_n^a}$

Specially, when $p$ is a prime integer, ${ord_p^a}=\varphi(p)=p-1$ , so we get the result:
Corollary If $a$ and $p$ are relative prime integers, and $p$ is a prime integer,then $a^i \equiv a^j \pmod p$,where i and j are nonnegative integers, if and only if $i \equiv j \pmod {p-1}$

hence:

$$i \equiv j \pmod {p-1} \Leftrightarrow a^i \equiv a^j \pmod p.$$

That is the answer.

| cite | improve this answer | |
$\endgroup$
  • $\begingroup$ Who is the author of the book you reference? $\endgroup$ – Alex J Best Oct 1 '19 at 22:05
  • $\begingroup$ Kenneth H. Rosen $\endgroup$ – 孙海城 Oct 2 '19 at 0:22

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.