1348 Views 6 Replies Latest reply: Mar 4, 2012 9:47 AM by ptc-4476568
5 posts since
Feb 24, 2012
Currently Being Moderated

### Feb 29, 2012 8:15 AM

I have just created some functions to calculate the public and private keys given two prime numbers. The problem is that is taking to long to cipher and decipher a simple message of 9 numbers.

So, could anybody help me with that?

Thanks

Luiz Carlos

Attachments:
• 440 posts since
Apr 22, 2010
Currently Being Moderated
Feb 29, 2012 12:17 PM (in response to ptc-4476568)

In the dcif program, I think you have a problem with the "while",  dosn't stop.

Try the attached, I saved as M12.  It takes a while to calculate cif when saving or opening in 12, don't know why.  But in M15, this delay does not happen.

Attachments:
• 440 posts since
Apr 22, 2010
Currently Being Moderated
Feb 29, 2012 4:43 PM (in response to ptc-4476568)

Luiz,

For the results of the mc1, mc2, etc. you used the symbolic equal, just use the equal sign as you did for m1, m1, etc.

For the md functions, need to do the same, however the error says that a number greater than 10^307 was encountered.  For md1, you have 217^137, similar for the others.  So I guess you need to do someting different here.

Wayne

• 440 posts since
Apr 22, 2010
Currently Being Moderated
Mar 1, 2012 8:44 AM (in response to ptc-4476568)

Luiz,

I put the "break if"  temporarily as break in the while loop, but should have used just a limit on the number of iterations.

with the cif=13 fixed, so just looking at the dcif function, without limit on the iterations, some valuse of p, result in very long calculation times, I gave up on p=14 (with q left the same).  Can you put a limit on the iterations, or some other iteration limit in the program for dcif

Can you put limits in cif and dcif on the magnitude in a random way?

Those seem to be the problems, large numbers and no limits on the iterations in dcif.

Wayne

#### More Like This

• Retrieving data ...

#### Legend

• Correct Answers - 3 points