What do you do if the decryption key d is equal to 1?

246 Views Asked by At

To decrypt some M, we use the fact that M $\equiv$ $(M')^d$ mod n. To find d, I did $e^{\Phi((p-1)(q-1))}$ mod ((p-1)(q-1)).

In my particular case, n = 1643, e = 223, p = 31, q = 53. Therefore, d $\equiv$ $223^{\Phi((30)(52))}$ mod 1560 $\equiv$ $223^{384}$ mod 1560.

I am getting 1 for this last step, which does not seem to be right.

2

There are 2 best solutions below

0
On

Your decryption key should be 7

$d = e^{-1}(mod1560)$

$d = 223^{-1}(mod1560)$

Extended Euclidean Algorithm

$1560 = 223 * 6 + 222$

$223 = 222 * 1 + 1$

$222 = 1 * 222 + 0$

Go backward

$1 = 223 - 1*222$

$1 = 223 - 1 (1560 - 6*223)$

$1 = 7*223 - 1 *1560$

$1 = 7*223(mod1560)$

Therefore d=7

To check:

$ed \equiv 1 (mod1560)$

$223*7 \equiv 1 (mod1560)$

$1561 \equiv 1(mod1560)$

0
On

You have the wrong way to compute the decryption key. If $n=pq$, then public key $(n,e)$ has the private decryption key $d$ where $ed \equiv 1 \pmod{\phi(n)}$, not $e^{\phi(\phi(n))} \pmod {\phi(n)}$, as you think.

As here $\phi(n) = (p-1)(q-1) =1560$ you need to find the inverse of $223$ modulo $1560$. This is indeed $7$ as $7 \times 223 = 1561$ and can be found using the extended Euclidean algorithm.