I never had an overflow error in Mathematica, the following happened.
I demo-ed the principle of RSA-encryption as follows:
n = 11*13
m = EulerPhi[
Try using PowerMod
in the decyphering operation:
n = 252097800611*252097800629;
m = EulerPhi[n];
e = 7;
Print[GCD[e, m]];
d = PowerMod[e, -1, m];
Print[{"n" -> n, "m" -> m, "e" -> e, "d" -> d}];
Grid[
Join[{
{"Input", "Encrypted", "Decrypt with Mod", "Decrypt with PowerMod"}},
Table[{i, (j = Mod[i^e, n]), Mod[j^d, n], PowerMod[j, d, n]}, {i, 40}]],
Frame -> All]