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