Ok - i will try to ask my question as clear as possible. Im getting a little deeper into the RSA-cryptosystem. At one point i'm a little confused. We have a plaintext $x$ and ciphertext $y$, with
$x \in\Bbb Z_n = \{0,...,n-1\} $.
Additonally we choose $p$ and $q$ as primes. My source says $x$ must be less than $n$, which really makes sense to me. It proves that the RSA scheme works by using Euler's Theorem for:
$$ \\ $$
First case: $gcd(x,n)=1$
$d_{k_{pr}}(y) \equiv ( x^{\Phi(n)} )^t \cdot x \equiv 1\cdot\ x \equiv x\ mod\ n $
$$ \\ $$
Second case: $gcd(x,n) = gcd(x,p\cdot q) \ne 1$
- So we can assume $x$ to be: $\qquad x = r \cdot p\ $ or $\ x = s \cdot q \qquad$ ($r\lt q$ and $s \lt p$)
- Without loss of generality: $\qquad \ \ x=r\cdot p$
- Implict we have: $\qquad \qquad \quad \ \ \ gcd(x,q)=1$
Euler's Theorem holds in the following form:
$\qquad 1 \equiv 1^t \equiv (x^{\Phi(q)})^t\ mod\ q. $
Substitution:
$\qquad (x^{\Phi(n)} )^t \equiv (x^{(p-q)(q-1)})^t \equiv ((x^{\Phi(q)})^t)^{p-1} \equiv 1^{(p-1)} = 1\ mod\ q. $
Using the definition of the modulo operator, we can show that:
$ \\ \qquad (x^{\Phi(n)})^t \quad = 1 + u \cdot q \\ \qquad x \cdot (x^{\Phi(n)})^t = x + x \cdot u \cdot q \\ \qquad x \cdot (x^{\Phi(n)})^t = x + (r\cdot p) \cdot u \cdot q \\ \qquad x \cdot (x^{\Phi(n)})^t = x + r \cdot u \cdot n \\ \qquad x \cdot (x^{\Phi(n)})^t \equiv x\ mod\ n . $ $$ \\ $$ This proof seems plausible to me. Now my questions:
If $x \in \Bbb Z_n = \{0, ..., n-1 \}$ for $n=p \cdot q$, what happens to $n$ when $p$ and $q$ are not prime. Does this restrict the choice of an input $x$. For example, has $x$ to be less than $min(q,p)$? In this lecture Prof. Dr. Spannagel tolds the students that $x$ should be choosen always less than $min(q,p)$, to ensure that $gcd(x,n)=1$.
In addition, what happens if $p = q$ for $p$ and $q$ are prime. Does this affect our proof in case two?
The questions are not about argueing about the security of RSA and well choosen parameters $p$ and $q$. It's more about the restrictions on $n$ we will cause by choosing these factors.
Thanks in advance.
\Phi
) for Euler's totient, not $\varphi$ (\varphi
) as Knuth, your video, and others, or $\phi$ (\phi
) as the original RSA article. $\endgroup$ – fgrieu♦ Feb 16 '14 at 16:58