rsa.mws

>    r := rand(10^80)();
s := rand(10^80)();
p := nextprime(r);
q := nextprime(s);

r := 19669081321110693270343633073697474256143563558458718976746753830538032062222085

s := 74121768604305613921745580037409259811952655310075487163797179490457039169594160

p := 19669081321110693270343633073697474256143563558458718976746753830538032062222257

q := 74121768604305613921745580037409259811952655310075487163797179490457039169594213

>    n := p*q;

n := 1457907094342636571934108159685862980326515914911824861643397522980497550736230615496046802186876835611836753440525199587698019954839165932427842278373706998741
n := 1457907094342636571934108159685862980326515914911824861643397522980497550736230615496046802186876835611836753440525199587698019954839165932427842278373706998741

>    m := (p-1)*(q-1);

m := 1457907094342636571934108159685862980326515914911824861643397522980497550736230521705196876770569643522623642333791131491479151420633025388494521283302475182272
m := 1457907094342636571934108159685862980326515914911824861643397522980497550736230521705196876770569643522623642333791131491479151420633025388494521283302475182272

>    a := 2^16+1;

a := 65537

>    isprime(a);
gcd(a,m);

true

1

>    b := eval(1/a mod m);

b := 341802989220968474720655078407209434254191022363248073594317758527173121550607778293183240178522095499109087453784896094825475099226794560236481979918863102913
b := 341802989220968474720655078407209434254191022363248073594317758527173121550607778293183240178522095499109087453784896094825475099226794560236481979918863102913

>    u := (x,a,n) -> Power(x,a) mod n:
v := (x,b,n) -> Power(x,b) mod n:

>    y := u(5,a,n); x :=v(y,b,n);

y := 446699826528570457727849702847882456011063958845436575406364845773934883185785904969215738362722324430978629195687422700096164664107349103915395164169538874261
y := 446699826528570457727849702847882456011063958845436575406364845773934883185785904969215738362722324430978629195687422700096164664107349103915395164169538874261

x := 5

>    y := u(5555555,a,n); x :=v(y,b,n);

y := 1147485184705833377942512574740846170403996437660509062849944198978921435199101454365297758360485834930395148468929743228559012581301259654960708045052058906765
y := 1147485184705833377942512574740846170403996437660509062849944198978921435199101454365297758360485834930395148468929743228559012581301259654960708045052058906765

x := 5555555

>    y := u(19669081321110693270343633073697474256143563558458718976746753830538032062222085,a,n); x :=v(y,b,n);

y := 1343795289780167291856602299951908402216897154304074170847570748628483158764468826385782345381659701504276890355768287670539838111270462148247893555697801721742
y := 1343795289780167291856602299951908402216897154304074170847570748628483158764468826385782345381659701504276890355768287670539838111270462148247893555697801721742

x := 19669081321110693270343633073697474256143563558458718976746753830538032062222085

>    y := u(0417181903041104171816191819160017030817021604180017,a,n); x :=v(y,b,n);

y := 1445271342077333850810587930721246119637276300086542923991011323094820891531712659656668032513734254782932933643187458814460659880338609653396403575967077856790
y := 1445271342077333850810587930721246119637276300086542923991011323094820891531712659656668032513734254782932933643187458814460659880338609653396403575967077856790

x := 417181903041104171816191819160017030817021604180017

>    x := convert("Bom dia, a vossa missão para hoje é codificar esta mensagem.", bytes);

x := [66, 111, 109, 32, 100, 105, 97, 44, 32, 97, 32, 118, 111, 115, 115, 97, 32, 109, 105, 115, 115, 227, 111, 32, 112, 97, 114, 97, 32, 104, 111, 106, 101, 32, 233, 32, 99, 111, 100, 105, 102, 105, 9...
x := [66, 111, 109, 32, 100, 105, 97, 44, 32, 97, 32, 118, 111, 115, 115, 97, 32, 109, 105, 115, 115, 227, 111, 32, 112, 97, 114, 97, 32, 104, 111, 106, 101, 32, 233, 32, 99, 111, 100, 105, 102, 105, 9...

>    y := u(6611110932100105974432973211811111511597321091051151152271113211297114973210411110610132233329911110010510210599971143210111511697321091011101159710310110946,a,n);

y := 140736130039645009553739676541143047902524954980168653943014705737735095573192897333167451007982416950493423412264886041794764390363145867609223703907448682207
y := 140736130039645009553739676541143047902524954980168653943014705737735095573192897333167451007982416950493423412264886041794764390363145867609223703907448682207

>    x :=v(y,b,n);

x := 6611110932100105974432973211811111511597321091051151152271113211297114973210411110610132233329911110010510210599971143210111511697321091011101159710310110946
x := 6611110932100105974432973211811111511597321091051151152271113211297114973210411110610132233329911110010510210599971143210111511697321091011101159710310110946

>    x := convert([66, 111, 109, 32, 100, 105, 97, 44, 32, 97, 32, 118, 111, 115, 115, 97, 32, 109, 105, 115, 115, 227, 111, 32, 112, 97, 114, 97, 32, 104, 111, 106, 101, 32, 233, 32, 99, 111, 100, 105, 102, 105, 99, 97, 114, 32, 101, 115, 116, 97, 32, 109, 101, 110, 115, 97, 103, 101, 109, 46],bytes);

x :=

>   

>