In order to encrypt a message, primes \(p\) and \(q\) are to be chosen. We can compute \(n\) by multiplying, \(pq\). The value of \(n\) is the value that is made public, however the primes \(p\) and \(q\) are kept a secret. Next \(\phi n\) is calculated also denoted as \(\phi n=\left(p-1\right)\left(q-1\right)\). Afterwards, the value \(d\) is chosen, and \(d\) has to be relatively prime to \(\phi n\), this can be done using Euclidean algorithm. The algorithm then shows how \(e\) is found by using the equation \(de+\phi nf=1\). The value of \(e\) is made public while the value of \(d\) is kept a secret.