Skip to main content

Discrete Mathematics · Divisibility, modular arithmetic, and elementary number theory

RSA decryption needs Euler, and Euler needs a coprime message

Problem

Let $p=5$ and $q=13$, and set $n=pq=65$. Let $e=5$. 1. Compute $\varphi(n)$ from the product formula, and prove that $\gcd(e,\varphi(n))=1$. Find the unique $d$ with $1\le d<\varphi(n)$ and \[ ed\equiv 1\pmod{\varphi(n)}. \] Do not invert $e$ modulo $n$. 2. Prove Euler's theorem: if $\gcd(a,n)=1$, then $a^{\varphi(n)}\equiv 1\pmod n$. Your proof should use that multiplication by $a$ permutes $(\mathbb Z/n\mathbb Z)^\times$. 3. Let $m$ be an integer with $\gcd(m,n)=1$, and set $c\equiv m^e\pmod n$. Using only Euler's theorem and the congruence $ed\equiv 1\pmod{\varphi(n)}$, prove \[ c^d\equiv m\pmod n. \] Then, for the plaintext $m=11$, compute the ciphertext $c\equiv 11^e\pmod n$ and verify $c^d\equiv 11\pmod n$. Record both residues in $\{0,1,\ldots,n-1\}$. 4. Let $m'=10$. Compute $\gcd(m',n)$ and prove that Euler's theorem does not apply to $m'$ modulo $n$, by showing $ (m')^{\varphi(n)}\not\equiv 1\pmod n$. Explain why quoting Euler on $m'$ cannot justify RSA decryption of $m'$, even if some other argument (not requested here) might still recover $m'$. Also explain why the private exponent must be an inverse of $e$ modulo $\varphi(n)$ rather than modulo $n$. Do not treat $n$ as prime, do not replace $\varphi(n)$ by $n-1$, and do not skip the coprime-message hypothesis.

Hint

$\varphi(65)=4\cdot 12=48$. The inverse of $5$ modulo $48$ satisfies $5d=48k+1$; try $k=3$.

Check your work

Work the problem yourself first. Then open it in Training to check your answer and read the full worked solution.

The answer check and full solution for this problem come with ProofAnvil Practice membership ($19 USD monthly). See membership. Or start with the free Discrete Mathematics sample problem: Try the free sample problem.

More Discrete Mathematics practice problems

Back to Discrete Mathematics

An original ProofAnvil practice problem, written for this course. ProofAnvil is a practice course, not a homework-answer service.