Why is RSA easily cracked if N is prime? This question was part of an assignment.
Here's my reasonning:


If N is prime and N=p*q, then p=1 and q=N (or the opposite).
e * d ≡ 1 mod ((p-1) * (q-1)), but ((p-1) * (q-1))=0 here.
e * d ≡ 1 mod 0, so e=d.
We now have the private key.


Is this correct?
Is this correct?


Sadly no.

First here's a simple counter-example: $n=11,e=3\Rightarrow d=7\neq 3$, also note that $(5^3)^3\equiv 9\not\equiv 5\pmod {11}$ and $(5^3)^7\equiv 5\pmod {11}$.

Concretely the mistake in the calculations is finding the order for exponent (e.g. the totient function of the modulus), which the calculations hard-code to $\varphi(pq)=(p-1)(q-1)$ which is only true for $p,q\in\mathbb P$.
The fix is to use the proper formula which obviously is $\varphi(1\cdot q)=q-1$. Now you can proceed normally in calculating $d$ as solution to $e\cdot d\equiv 1\pmod{q-1}$.