0

I'm currently studying the RSA algorithm and while I understand why if $b$ is the inverse of $a$ in $\Bbb Z_n $ then $ab \equiv 1\pmod{n}$. I don't quite understand why $x^{ab} \equiv x \pmod{n}$. Can I just replace $ab$ with $1$? A proof showing why this holds would be really helpful.

Shaun
  • 44,997
sliiime
  • 51
  • When $a\in\mathbb Z_n$, the expression $x^a\pmod n$ is not well-defined... – Kenta S Apr 07 '21 at 19:01
  • You misread, it should say $,ab\equiv 1\pmod{\color{#c00}{\phi(n)}},$ and proofs are in the linked dupe. Post further question in comments here or there if anything remains unclear. – Bill Dubuque Apr 07 '21 at 19:05
  • @BillDubuque I didn't misread, they mistyped. My comment is legitimate as a response to the question they asked. – Kenta S Apr 07 '21 at 19:28
  • @KentaS Now you have misread. My prior comment is to the OP, not you (if it was addressed to you it would begin like this comment at-you) – Bill Dubuque Apr 07 '21 at 19:30
  • @BillDubuque Sorry; my bad. I guess I misread your message. – Kenta S Apr 07 '21 at 21:28
  • @BillDubuque Yes,I did actually misread the proof...It's clear now,thanks a lot! – sliiime Apr 08 '21 at 00:31

1 Answers1

2

Rather, we have $$ x^{ab}\equiv x\pmod n$$ if $$ ab\equiv 1\pmod{\phi(n)}\quad\text{and}\quad \gcd(x,n)=1.$$