1

I'm working on a RSA encryption algorithm, and I can put in the formula and get the result I want, but I'm trying to understand how it is doing what it's doing.

So the theorem in its basic form is:

If GCD(x, y) = 1; and x < y; then xφ(y) ≡ 1 (mod y)

So for 8 and 21:

8φ21 ≡ 812 ≡ 1 (mod 21)

Where Φ(n) is all the numbers that are relatively prime to n for 1 to n - 1 (i.e. all the numbers in that range than have no factors in common with n other than 1).

But my question is why is this the case? Why is xφ(y) always congruent with 1 for a modulo of y? (When GCD(x, y) = 1; and x < y). I can't seem to get my head around what is going on conceptually, even though I can use the formula in practice. Any advice will be greatly appreciated.

advert665
  • 137
  • 1
    http://en.wikipedia.org/wiki/Euler's_theorem – vadim123 Feb 25 '14 at 01:12
  • I have read that, but that doesn't exactly make things clearer – advert665 Feb 25 '14 at 01:14
  • Perhaps you can explain a bit more to help us understand why the link doesn't make sense. Some information on your background would be good (have you seen group theory?), specific statements in the link you don't understand would be better. – RghtHndSd Feb 25 '14 at 01:18
  • No I haven't seen group theory, I will look that up now. I'm coming at this from a basic programming perspective where I understand the formula to the point that I can use it for what I need to, but understanding the direct proof is a bit beyond my current ability. I guess I was implicitly hoping that someone here could break that down a bit. – advert665 Feb 25 '14 at 01:28

1 Answers1

2

Here is the proof in the case $x=3$, $y=10$. We start with the numbers $1,3,7,9$ which are coprime to $10$, and multiply them all by $3$ to get $$3\times1\equiv3\,,\quad 3\times3\equiv9\,,\quad 3\times7\equiv1\,,\quad 3\times9\equiv7\pmod{10}\ .$$ Multiplying all these, $$(3\times1)\times(3\times3)\times(3\times7)\times(3\times9)\equiv 3\times9\times1\times7\pmod{10}\ .$$ Now we can cancel $1\times3\times7\times9$ to find $$3^4\equiv1\pmod{10}\ .$$ IMHO this is one of the best proofs in elementary number theory: it not only shows that the result is true, but also makes it clear why the exponent has to be the number of residues modulo $10$ which are coprime to $10$. Of course to give a complete proof there are a couple of things you have to do.

(1) For any $x$ and $y$, show that if you take the coprime residues modulo $y$ and multiply them all by $x$, you get the same residues back again.

(2) Explain why the residues can then all be cancelled.

I suspect it is these details that are causing you difficulty. But if you concentrate on the main idea, as illustrated by one example, it should help you to understand what is going on. Good luck!

David
  • 82,662
  • Thanks a lot for that answer that makes it all a lot clearer, it gives me a basis for understanding what the proof is supposed to be showing. It almost seems like luck that the residues come out the same - though presumably that's what (1) and (2) will clear up. – advert665 Feb 25 '14 at 02:27