# RSA algorithm check if ive done it right please

• Jan 5th 2010, 06:18 AM
RSA algorithm check if ive done it right please
Using an RSA code with the encryption integer e = 3 and distinct primes 3, 41 encode the message M = 5. Determine the decryption integer and check your encoded message by decoding it.

to get the decryption integer:

mod n (3-1) * (41-1) = 80

e*d = 1 mod 80

3*d = 1 mod 80

d = 27

to check message

im not sure how to do any help please?
• Jan 5th 2010, 02:36 PM
Bacterius
Say $\displaystyle p = 3$, $\displaystyle q = 41$, so $\displaystyle n = 123$, and $\displaystyle \varphi{(n)} = (p - 1)(q - 1) = 80$.
Say $\displaystyle e = 3$. Use the extended Euclidian algorithm to find that $\displaystyle d = 27$ (because $\displaystyle 27 \times 3 \equiv 1 \pmod{\varphi{(n)}}$.
Now, $\displaystyle M = 5$, so $\displaystyle C \equiv 5^e \pmod{123}$, so $\displaystyle C = 2$.
Now, $\displaystyle C = 2$, so $\displaystyle M \equiv 2^d \pmod{123}$, so $\displaystyle M = 5$.

Thus this is correct.