RSA ENCRYPTION ALGORITHM Pick two arbitrarily large distinct prime numbers $p, q$, and calculate $N=pq$. Find $\phi(N)=(p-1)(q-1)$ and choose an $e$ such that $\gcd(e, \phi(N))=1$; calculate $d=e^{-1} \pmod{\phi(N)}$ (i.e., the multiplicative inverse of $e$ modulo $\phi(N)$). The numbers $N, e$ are to be made available to the encryptor ("public"), while the others should be available only to the decryptor ("private"). To encrypt a text, use a predefined reversible algorithm to break it into blocks & convert each one into a number $x$ that is less than $N$. Calculate $E=x^e \pmod{N}$ for each $x$ to form a final sequence of encrypted numbers. To decrypt each $E$, calculate $x=E^d \pmod{N}$, and then apply the inverse of the aforementioned algorithm to $x$.