Using the code letter —> ASCII code, we may convert a message to a number which
ID: 3625090 • Letter: U
Question
Using the code letter —> ASCII code, we may convert a message to a number which may be encoded using RSA encryption.
I You are being sent a message by a person using the public keys
e = 5
n = 10000000000000000000000000000000000000000000000000000000000000000000 00000000001303000000000000000000000000000000000000000000000000000000000
00000000000000000001677
You know that the prime factors of n (p,q) are 1080 + 129 and 1081 + 13.
The message that you receive is:
171663025402460977622167329685993830535731580891747046636110368514563694 0917318030944670995296787214763010980624647595563042087651843371811104110637591483189485
Decode the message
2.For the second one, we dont know the prime factors of n.
II Another person, using public keys e = 25321
n = 37204186365662500024623831156995119467210709249126725418523591574 139020033511028918571432582488846791924429175543703756628158927523
sends the message
152606837522848180659635203925910013212795607887296214931764821178978 22167068533147992066452088710306603587771528140997336771820692
Decode the message.
Explanation / Answer
(n) = (p-1)(q-1) = (1080 + 128)(1081 + 12) = 1000000000000000000000000000000000000000000000000000000000000000000000
0000000012920000000000000000000000000000000000000000000000000000000000
0000000000000000001536
d = e-1 mod (n) = 5-1 mod (n) = 8000000000000000000000000000000000000000000000000000000000000000000000
0000000103360000000000000000000000000000000000000000000000000000000000
000000000000000001229
To decode the cyphertext C and find the message M, we need to find Cd mod n :
C =
171663025402460977622167329685993830535731580891747046636110368514563694 0917318030944670995296787214763010980624647595563042087651843371811104110637591483189485
M = Cd mod n =
1211111170321040971181010320991111091121081011161011000321120971141160
32111110101
b)
For this part, I guess what you mean is to code the message and find the cyphertext, because without knowing the factorization of n, it is almost impossible to decode the RSA encrypted message. We have:
e = 25321
n = 37204186365662500024623831156995119467210709249126725418523591574 139020033511028918571432582488846791924429175543703756628158927523
M = 152606837522848180659635203925910013212795607887296214931764821178978 22167068533147992066452088710306603587771528140997336771820692
C = Me mod n =
2630723629389431500033026954577912255203978193828792841553015992418918
4201617124360488965967635797172396293067700169824892528283826
-----------------------------------------------------------------------------
P.S. To do the modular arithmetic, I used the following codes in Mathematica:
part (a):
Phin = (10^80 + 128)*(10^81 + 12);
e = 5;
d = PowerMod[e, -1, Phin];
cypher = 1716630254024609776221673296859938305357315808917470466361103
6851456369409173180309446709952967872147630109806246475955630420876518
43371811104110637591483189485 ;
n = 100000000000000000000000000000000000000000000000000000000000000000
0000000000001303000000000000000000000000000000000000000000000000000000
00000000000000000000001677 ;
M = PowerMod[cypher, d, n]
Part (b):
e = 25321 ;
n = 372041863656625000246238311569951194672107092491267254185235915741
39020033511028918571432582488846791924429175543703756628158927523;
M = 152606837522848180659635203925910013212795607887296214931764821178
97822167068533147992066452088710306603587771528140997336771820692;
Cypher = PowerMod[M, e, n]
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.