Demonstration of the RSA scheme from class on Mon Nov 17:

>    p:=nextprime(89156123486012398448956156123789431245123474145123541234651234651234);

p := 89156123486012398448956156123789431245123474145123541234651234651253

>    q:=nextprime(89123561237461237854326147123679452451234512452134521384751239452139452134);

q := 89123561237461237854326147123679452451234512452134521384751239452139452471
q := 89123561237461237854326147123679452451234512452134521384751239452139452471

>    n:=p*q;

n := 7945911231200282085203513169938042415200383423371443025317762476698253220078724644189653320133942839551797911504012198250125220328674054096163
n := 7945911231200282085203513169938042415200383423371443025317762476698253220078724644189653320133942839551797911504012198250125220328674054096163

>    ifactor(n);

Warning, computation interrupted

>    e:=615562346210787541293874612345123452134512347512345123451234513241;

e := 615562346210787541293874612345123452134512347512345123451234513241

>    gcd(e,(p-1)*(q-1));

1

>    d:=1/e mod ((p-1)*(q-1));

d := 6418775669391623354760002460099277765293628523136304905880931589357070275841407920026940424641144285766432388911183943527647124512086169465881
d := 6418775669391623354760002460099277765293628523136304905880931589357070275841407920026940424641144285766432388911183943527647124512086169465881

The plaintext message m :

>    m:=123456789000000000010203040506070809;

m := 123456789000000000010203040506070809

The ciphertext:

>    m1:=m &^ e mod n;

m1 := 4957000048758290327108625737441738607451048649030519595486504038232456452872466842511448755241161880636543056435988938304538095648581323788582
m1 := 4957000048758290327108625737441738607451048649030519595486504038232456452872466842511448755241161880636543056435988938304538095648581323788582

Decrypting the ciphertext to recover the plaintext:

>    m1 &^ d mod n;

123456789000000000010203040506070809

>