The keys for the RSA algorithm are generated the following way:-
- Choose two large and distinct prime numbers $p$ and $q$.
- Take the product $n =p \times q$
- Compute the number of integers less than n that are coprime with n (otherwise known as the totient): $\phi(n)=(p-1)\times (q-1)$
- Choose an integer e such that $1< e< \phi(n)$ and $e$ and $\phi(n)$ are coprime (i.e. share no common factors other than 1)
- Compute a value for d such that it satisfies the relation: $(d \times e)\ \% \ \phi(n) = 1$
- The public key is $(e,n)$
- The private key is $(d,n)$
- To encrypt m using the public key use the relation: $c = m^{e} \ \% \ n$
- To decrypt c using the private key use the relation: $m = c^{d} \ \% \ n$
Given,
P=31 , Q=23 , e=223 , n=713 , m=439
$\phi(n)=(p-1)\times(q-1)$
$\phi(n)=30\times22$
$\phi(n)=660$
Now from step 5 Compute a value for d such that it satisfies the relation: $(d \times e)\ \% \ \phi(n) = 1$
it is satisfy when d=367
$(367 \times 223)\ \% \ 660 = 1$
Hence, Option(A)367 is the correct choice.
Algo. Reference :-https://www.cs.utexas.edu/~mitra/honors/security.html