Why do we get like that the message?

  • Context: MHB 
  • Thread starter Thread starter evinda
  • Start date Start date
Click For Summary
SUMMARY

The discussion focuses on the RSA encryption algorithm, specifically the mathematical foundation behind the encryption and decryption processes. It details the selection of two large prime numbers, $p$ and $q$, to compute $n = pq$ and $\phi(n) = (p-1)(q-1)$. The public key is defined as $(n, e)$ and the private key as $(n, d)$, where $d$ is the modular inverse of $e$ modulo $\phi(n)$. The key conclusion is that $M^{ed} \equiv M \mod{n}$ holds true due to Euler's theorem, which states that if $M$ is coprime with $n$, then $M^{\phi(n)} \equiv 1 \mod{n}$.

PREREQUISITES
  • Understanding of RSA encryption algorithm
  • Familiarity with modular arithmetic
  • Knowledge of Euler's theorem
  • Basic concepts of public and private key cryptography
NEXT STEPS
  • Study the mathematical principles of RSA encryption in detail
  • Learn about modular exponentiation techniques
  • Explore advanced topics in number theory related to cryptography
  • Investigate the implications of RSA key sizes on security
USEFUL FOR

Cryptographers, computer scientists, and anyone interested in understanding the mathematical foundations of RSA encryption and its applications in secure communications.

evinda
Gold Member
MHB
Messages
3,741
Reaction score
0
Hello! (Wave)

When we encrypt with RSA, we choose two large arbitrary prime numbers $p$ and $q$.
We choose $n=pq$. We compute $\phi(n)=(p-1)(q-1)$.
We choose a number $e>1$ such that $e^{\phi(n)}\equiv 1 \pmod{n}$.

We compute the inverse of $e$, $d \equiv e^{-1}\pmod{\phi(n)}$.
The public key is $(n,e)$ and the private key $(n,d)$.

We encrypt a message $M$ as follows:

$$C(M)=M^e \mod{n}$$

We decrypt the message as follows:

$$M(C)=C^{d} \mod{n}$$

My question is the following:

Why do we have that $M^{ed}=M \mod{n}$, given that $ed=1 \mod{\phi{n}}$ and not modulo $n$ ? (Thinking)
 
Physics news on Phys.org
Hey evinda!

It's a consequence of Euler's theorem that says that if $a$ is coprime with $n$ that then $a^{\phi(n)}=1\bmod n$.

Let $k$ be such that $ed = k\phi(n) + 1$.
If $M$ is coprime with $n$ then it follows that:
$$M^{ed} = M^{k\phi(n) + 1} = (M^{\phi(n)})^k\cdot M = M\bmod n$$
🤔
 
Klaas van Aarsen said:
Hey evinda!

It's a consequence of Euler's theorem that says that if $a$ is coprime with $n$ that then $a^{\phi(n)}=1\bmod n$.

Let $k$ be such that $ed = k\phi(n) + 1$.
If $M$ is coprime with $n$ then it follows that:
$$M^{ed} = M^{k\phi(n) + 1} = (M^{\phi(n)})^k\cdot M = M\bmod n$$
🤔

Ah, I see... Thanks a lot! (Sun)
 

Similar threads

  • · Replies 1 ·
Replies
1
Views
1K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 0 ·
Replies
0
Views
2K
  • · Replies 4 ·
Replies
4
Views
1K
  • · Replies 8 ·
Replies
8
Views
2K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 15 ·
Replies
15
Views
2K
  • · Replies 7 ·
Replies
7
Views
2K
  • · Replies 6 ·
Replies
6
Views
2K