View Full Version : need help in factoring algorithms
aravindsubramanian
Jul12-05, 04:17 AM
Rsa200, The 200 digit RSA challenge no is factored on may 9.
The German researchers, RSA has reformulated its challenge and now expresses numbers in bits (base 2) instead of decimal (base 10)
source
http://news.com.com/2061-10789_3-5702146.html
I'm still confused, it's just the same number with separators every 3 digits...
saltydog
Jul12-05, 08:17 AM
I'm still confused, it's just the same number with separators every 3 digits...
Yea right. And because of that I would ask aravindsubramanian to kindly prepare a short report detailing how RSA-200 was factored. Include the technique used, how long it took, what kind of computer resources were used, and what criteria was used in selecting the two primes in it's product. :smile: Or just ignore me. :yuck:
saltydog
Jul12-05, 08:56 AM
Yea right. And because of that I would ask aravindsubramanian to kindly prepare a short report detailing how RSA-200 was factored. Include the technique used, how long it took, what kind of computer resources were used, and what criteria was used in selecting the two primes in it's product. :smile: Or just ignore me. :yuck:
Aravindsubramanian, in case you're not already annoyed by me, here's two more:
Download the two prime factors in Mathematica and verify they work. You'll find out quick-like why you dont want any commas in there.
Finally, how do you check that these large numbers are in fact prime? . . . "why don't you Salty?". Suppose I could. Think one way has to do with Fermat's little theorem. Need to check . . .
Edit: Oh yea, I don't think they even need to be prime, just relatively prime. Huh Zurtex?
Finally, how do you check that these large numbers are in fact prime? . . . "why don't you Salty?". Suppose I could. Think one way has to do with Fermat's little theorem. Need to check . . .
Edit: Oh yea, I don't think they even need to be prime, just relatively prime. Huh Zurtex?
Fermat’s little Theorem is alright, but I'd rather go with the Miller Rabin Test, in my number theory course we integrated the two tests in to a single program for the minimum amount of run time needed to work out if the number is a prime to a certain level of probability.
Where n is the number I was fairly happy to reduce the probability of the number being not being prime down to less than 1/n which took a run time of about:
\text{O} \left( \frac{1}{\sqrt{2}} \left( \log n \right)^{2} \right)
Which was very useful as you can imagine.
saltydog
Jul12-05, 06:48 PM
Here's the Miller-Rabin test:
Let n be an odd prime and write:
(n-1)=d2^s
That is, remove all the s factors of 2.
Then one of the following must be true for some a\in[1,n-1]:
a^d\equiv 1(\bmod n)
or, letting:
k=d2^r
a^{k}\equiv -1(\bmod n)\quad\text{for some}\quad 0\leq r\leq (s-1)
So I wrote the Mathematica code below to implement this test (not shown is the routine to get s and d). It actually checks for composite by running through a total of amax trials, and all the values of r if the first test is not satisfied and if none are found, then judges the number to be composite. I checked the two prime factors of RSA-200. What I found interesting was the small number of factors of 2 in (n-1). The first prime had (in n-1), a single factor of 2 and the second had only two factors of 2.
Is this a characteristic feature of RSA primes?
MillerRabin[pval_, amax_] := Module[{a, s, d, r, aval, rsum, aexp},
(* get d and s for test *)
plist = GetSandD[pval];
s = plist[[1]];
d = plist[[2]];
For[a = 1, a <= amax, a++,
aval = Random[Integer, {1, pval - 1}];
If[PowerMod[aval, d, pval] != 1,
rsum = 0;
For[r = 0, r <= s - 1, r++,
aexp = d(2^r);
If[PowerMod[aval, aexp, pval] != pval - 1,
rsum += 1;
];
];
If[rsum == s,
Return["composite"];
];
];
];
Return["possible prime"];
];
http://mathworld.wolfram.com/Pollardp-1FactorizationMethod.html
RSA-200 is a really old number so yeah they are likely to have designed it such that it was a bit harder to factor by such methods.
The newer RSA numbers on the other hand have been made when the best methods available to attack such numbers are not bias to any particular type of numbers so I doubt they will have been made quite the same way.
aravindsubramanian
Jul13-05, 02:27 AM
Hai saltydog,
Rsa200 was factored using general number field sieve factoring agorithm.Sieving starts on christmas2003. The initial "sieving" step took the equivalent of 55 CPU-years on a single machine (2.2Ghz Opteron CPU).
see
http://en.wikinews.org/wiki/200_digit_number_factored
for more information
For primality testing we can use AKS primality testing algorithm.This is the only polynominal time algorithm available for primality testing.
TenaliRaman
Jul13-05, 02:51 AM
For primality testing we can use AKS primality testing algorithm.This is the only polynominal time algorithm available for primality testing.
Umm correction(!), it is the only "deterministic" polynomial time algorithm available for primality testing till Riemann Hypothesis is proved true. Otherwise we did have probabilistic algorithms earlier which worked in polynomial time.
-- AI
saltydog
Jul13-05, 08:00 AM
Assuming the truth of the generalized Riemann Hypothesis, if all values of a up to 2 (ln n)^2 are tested in the M-R test, then it becomes deterministic with a run-time of [itex]O(ln n)^4[/tex]
saltydog
Jul13-05, 08:08 AM
Hai saltydog,
Rsa200 was factored using general number field sieve factoring agorithm.Sieving starts on christmas2003. The initial "sieving" step took the equivalent of 55 CPU-years on a single machine (2.2Ghz Opteron CPU).
see
http://en.wikinews.org/wiki/200_digit_number_factored
for more information
For primality testing we can use AKS primality testing algorithm.This is the only polynominal time algorithm available for primality testing.
Hello Aravind, just suggestions. Probably knew it already huh? I noticed your thread on RSA. What's the largest primes you've ever used in an RSA encryption from scratch? I used two 266-digit primes to encrypt a treasure map once. Yea, you didn't know I was a pirate did you? :smile:
Oh yea, here it is: :smile:
58456532045607905647240679469702557176669352091387 75072416627214245140152870116034161541885368363410 15926767446223936487086729380578563273429545303354 88299933587281469305264002818829317027606951919353 40668749240028234022995575741115089948589742962213 86784608393260544702126406796897098959631948264896 98314330720583970863266677326008697955374252565491 5079519938492366869933223381055342706622
42503183918066564871917408501461836941765199676481 77084239142151758918836944419394662115440622205278 14839790244648360067898947829169131086041
TenaliRaman
Jul13-05, 11:41 AM
Assuming the truth of the generalized Riemann Hypothesis, if all values of a up to 2 (ln n)^2 are tested in the M-R test, then it becomes deterministic with a run-time of [itex]O(ln n)^4[/tex]
Post edited :rolleyes: :tongue:
-- AI
vBulletin® v3.8.7, Copyright ©2000-2012, vBulletin Solutions, Inc.