2

Is here some software, which is capable of factoring a 310-digit decimal integer number into primes? There was msieve, which I successfully used for 120-digit factoring, but 310 digit is greater than max allowed number of 308-digit for msieve.

PS: the number to factor have 2 prime factors, and p-1,p+1 and other easy and fast factoring methods are likely to fail.

UPDATE: Seems only GGNFS will work and there are some python scripts to automate factoring.

osgx
  • 90,338
  • 53
  • 357
  • 513
  • Do you just want the factors, or do you need some library that can do this programmatically? – Dave Orr May 11 '11 at 16:00
  • Also note that, at least for certain kinds of numbers, this is a rather hard problem. 310 decimals is 1030 bits, which is a key size that's never been factored. So if your number is a semiprime you are out of luck. – Dave Orr May 11 '11 at 16:06
  • I want the factors, but not in "black box" way. I want to have some "box", which can be used to begin factoring, also I want to see a sources of this "box". – osgx May 11 '11 at 16:41
  • 1
    I added this link to a wired article talking about a guy factoring significant semiprimes on Amazon EC2. – Cris Stringfellow Dec 18 '12 at 05:51

1 Answers1

2

Use Lenstra's EC algorithm if it's not a semiprime. Otherwise use Pomerance's NFS. Good introductions exist for both of these "boxes." My bet is to browse the homepages of Lenstra and Pomerance, they're both really good at exposition. Or check out "Number Theory: A Programmers Guide", by Mark Herkommer. It's just what you need, nothing more, and very clear.

EDIT: Although 1000 bit modulus may be a bit of a stretch, assuming you have conventional hardware.

EDIT: Sure, some additional links: http://tinyurl.com/herkAmzon for the Herkommer book.

A 1987 paper on EC factoring from Hendrik Lenstra's homepage : Factoring integers with elliptic curves, Ann. of Math. 126, 649-673..

From the vast net : A very simple Python source code for the above algorithm (which I haven't proofread)

Carl Pomerance's homepage and a relevant paper on the Number Field Sieve is here

However, you may also find useful this narrative on the sieve's development, or this exposition on the quadratic version also from Pomerance's page.

Check out this site dedicated to an implementation of the GNFS, but I strongly recommend finding a copy of the Herkommer book which contains clear simple source code on a few pages.

EDIT : Also consider running the factoring across the Elastic Compute cloud. I hear a guy does it overnight for $75 as per this WiRED article

Cris Stringfellow
  • 3,714
  • 26
  • 48
  • Can you giva some additional links (URLs)? – osgx Dec 23 '11 at 01:16
  • Is Herkommer's book available somewhere in digital form? Maybe you can share its PDF for download? If not, maybe you can share only GNFS source code from this book? – Arty Mar 31 '23 at 20:11