Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6795989
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T18:24:46+00:00 2026-05-26T18:24:46+00:00

I never had an overflow error in Mathematica, the following happened. I demo-ed the

  • 0

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[n]
 e = 7
 GCD[e, m]
 d = PowerMod[e, -1, m]
 cipher2[m_String] := Map[Mod[#^e, n] &, ToCharacterCode[m]]
 decipher2[x_Integer] := FromCharacterCode[Map[Mod[#^d, n] &, x]]

 In[207]:= cipher2["StackOverflow"]
 decipher2[cipher2["StackOverflow"]]
 Out[207]= {8,129,59,44,68,40,79,62,49,119,4,45,37}
 Out[208]= StackOverflow

No problem sofar.

Then I changed the prime numbers to a more realistically, but still very moderate size.

 n = 252097800611*252097800629

 In[236]:= cipher2["StackOverflow"]
 decipher2[cipher2["StackOverflow"]]

 Out[236]= {27136050989627, 282621973446656, 80798284478113, \
 93206534790699, 160578147647843, 19203908986159, 318547390056832, \
 107213535210701, 250226879128704, 114868566764928, 171382426877952, \
 207616015289871, 337931541778439}

 During evaluation of In[236]:= General::ovfl: Overflow occurred in computation. >>

 During evaluation of In[236]:= General::ovfl: Overflow occurred in computation. >>

 Out[237]= FromCharacterCode[{Overflow[], Overflow[], Overflow[], 
   Overflow[], Overflow[], Overflow[], Overflow[], Overflow[], 
   Overflow[], Overflow[], Overflow[], Overflow[], Overflow[]}]

Question : Have I simply gone through the limits of Mathematica? Have I used an incorrect approach? What is the by-pass, if any ??

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T18:24:47+00:00Added an answer on May 26, 2026 at 6:24 pm

    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]
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I had never had this error before, and I didn't move any file, or
I never had problems with any of my projects. Just recently when I ran
I never had any problems with Delete button on any browsers, but I had
[Update] Unfortunately I never had an opportunity to solve this problem. However, there are
I've never had to do this, but I'm binding a repeater to a generic
I've never had this issue before, so I'm somewhat lost. I'm getting two different
I've never had the need to really ever use any of the .NET Data
I've never had problems with references as in Python (implicit) or PHP (explicit &).
Usually I worked with PostgreSQL and never had a problem, but now I need
I started coding in C# and have never had the opportunity to use callbacks

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.