# RSA Coding Question

I have been given that N=143 and the encoder E=7. An encrypted message 48 was received. I have to find the decoder and use it to compute the original message.

This is how I did it but i'm not sure if I did it right: I let $M$ = the original message, then $$M^7 \equiv 48mod143$$ and we want some decoder $D$ such that $$48^D \equiv Mmod143$$ Then i did $$7D = 1(mod(p-1)(q-1))$$ $$7D \equiv 1(mod143)$$ $$7(41) \equiv 1(mod43)$$ I found 41 by trial and error. Using this i found that $$48^41 \equiv 81(mod143)$$ Does this mean the original message is 81?

• $\LaTeX$ hints: for multicharacter exponents, enclose them in braces, so 48^{41} gives $48^{41}$, for modulus, use \pmod, so 81 \pmod {143} gives $81 \pmod {143}$ – Ross Millikan Mar 15 '16 at 2:09

As you say, you want $7D \equiv 1 \pmod {(p-1)(q-1)}$, but it is $pq=143$, so you want $7D \equiv 1 \pmod {120}$, not $\pmod {143}$
• Ok, so then D would equal 103? And then i have to find the remainder when $48^{103}$ is divided by 102? Which equals 72, so is 72 the original message? – user319635 Mar 15 '16 at 2:47
• $D=103$ is correct, but you need to review how to use it. You can check your decryption with your first equation $M^7 \equiv 48 \pmod {143}$ No, the message is not $72$ – Ross Millikan Mar 15 '16 at 2:50
• You recover the message by raising the encrypted message to the decryption exponent, so $M=48^{103} \pmod {143}$ – Ross Millikan Mar 16 '16 at 2:23