Notepad/enter/Machine Tips (Quantum)/Math/Proof of a formula for modu...

54 lines
1.4 KiB
Markdown
Raw Blame History

This file contains invisible Unicode characters!

This file contains invisible Unicode characters that may be processed differently from what appears below. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to reveal hidden characters.

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

$$16^{54} \ mod \ 17=3^{24×54} \ mod \ 17 $$
Why?
[Public Key Cryptography: Diffie-Hellman Key Exchange (short version) - YouTube](https://www.youtube.com/watch?v=3QnD2c4Xovk) is a good video to understand asymmetric cryptography. There is a jump from 4:34 in the video that is not obvious to everyone.
The jump is from 1654mod17 to 324×54mod17, but why? From the comments of video, Im not the only one who is supprised by this jump.
First let me introduce a formula:
$$a^b\ mod \ p=((a \ mod \ p)^b) \ mod \ p \ \ \ \ (1)$$
Then the proof:
There must be one integer `n` to have
$$a \ mod \ p=anp \ \ \ \ (2)$$
so
$$((a \ mod \ p)^b) \ mod \ p=((anp)^b) \ mod \ p$$
With [Binomial theorem - Wikipedia](https://en.wikipedia.org/wiki/Binomial_theorem),
$$(anp)b=ab+(b1)ab1(np)+(b2)ab2(np)2+...+(np)b$$
We could see that all items are times of `p` except $a^b$,
$$((anp)bmodp)=(ab+(b1)ab1(np)+(b2)ab2(np)2+...+(np)b)modp=abmodp+0+0+...+0$$
Now we got
$$((anp)^b \ mod \ p)=a^b \ mod \ p$$
Use formula (2)
$$((amodp)b)modp=abmodp$$
Now let a as $3^{24}$, and b as 54 in formula (1):
$$
\\
\\begin{align}
3^{24×54}\ mod \ 17=((3^{24})^{54}) \ mod \ 17 \\ \\&= ((3^{24} \ mod \17)^{54})mod 17
\end{align}
= 16^{54}mod17$$
via [BrookHongs github](https://brookhong.github.io/2018/05/22/proof-of-a-formula-for-modulo.html)