# how do you calculate the private exponent in asymmetric key encryption [duplicate]

Here is an excellent paper on the math of asymmetric key encryption: http://www.mathaware.org/mam/06/Kaliski.pdf

See the example on Page 6.

The public key = $55$ Primes used to calculate public key are $5$ and $11$.

$e = 3$

Now see the appendix: $L = \mathrm{LCM}(p-1, q-1) = 20$

The paper states $de = 1 \mod L$

I can't figure out how he gets the value of $d = 7$

• Except for the value of $e$, and the use of $\varphi(n)=(p-1)\cdot(q-1)$ rather than $\mathrm{LCM}(p-1, q-1)$, this question is a duplicate of this one which has a fair answer, and others.
– fgrieu
Jan 14, 2014 at 15:24

You compute the modular inverse of $e \pmod {20}$ with the Extended Euclidean Algorithm, but in this simple case with $e=3$ you can guess $d=7$ because $3\times 7 = 21$.

• Is there any simple method to demonstrate the concept of public key/private key, i.e, just to illustrate the concept, not necessarily for security? Jan 15, 2014 at 3:24
• Can d be 47 instead of 7? de % L = 47*3 % 20 = 121 % 20 = 1 Oct 4, 2022 at 20:40