Encryption

{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z} = 
\{0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,
23,24,25};

shifter=3;
CaesarsCode[letter_]:=Mod[letter+shifter,26]

CaesarsCode[z]

ToCharacterCode["Meet me at the Rick's cafe tonight."]

FromCharacterCode[%]

outcode=ToCharacterCode["Sell all your stocks today !"]

rule1=outcode->outcode+3;
newmsg=ReplaceAll[outcode,rule1]

FromCharacterCode[newmsg]

rule2=newmsg->newmsg-3;
oldmsg=ReplaceAll[newmsg,rule2];
\FromCharacterCode[oldmsg]

PrimeQ[13764533567789]

PrimeQ[5]

FactorInteger[24]

FirstPrimeAbove[n_] := Block[{k},
	k = n;
	While[!PrimeQ[k], k=k+1];
	\Return[k]]

FirstPrimeAbove[32425457553575359648346924569]

p = FirstPrimeAbove[17764767677736456486]
q = \FirstPrimeAbove[93434576534669845979]

n = p q

e = 25642467391
GCD[e, (p-1) (q-1)]

messagio = 24567654321

PowerMod[messagio, e, n]

d = PowerMod[e, -1, (p-1) (q-1)]

PowerMod[%%, d, n]

ToCharacterCode["ABCDEFGHIJKLMNOPQRSTUVWXYZ"]

ToCharacterCode["abcdefghijklmnopqrstuvwxyz"]

ToCharacterCode["!.,;:?+=%"]

origmsg="operation zebra"

neworigmsg=Characters[origmsg] /. "z" -> "["