Thursday, November 22, 2012

Fermat's Factorization Running Time

Let N = pq is any odd composite. Let d = 2n be the difference between the two closest factors of 'N'. ( For e.g., 105 = 3x35 = 5x21 = 7x15
here 15 and 7 is close to each other compare to other. Therefore d = 15 - 7 = 8 therefore n = d/2 = 4 ). Let 's' be the floor value of square root of 'N'. Let N = a^2 - b^2 be the Fermat factorization of N. In order to attain best case scenario a - s <= 2 following are the required condition for factors of N. I call these factors as Best Fermat Factors.

Case1: If 'n' is odd then p should be (n(n-4) + 7)/4 and q should be (n(n+4) + 7)/4Case2: If 'n' is even & m = n/2 is odd then p should be (m(m -2) + 2) and q should be (m(m + 2) + 2)Case3: If 'n' is even & m = n/2 is also even then p should be (m - 1)^2 and q should be (m + 1)^2

(Note: Try the practical testing using any numbers even very big numbers then you can understand my ideas. I used the smaller numbers as an inductive proof for simplicity. Please read the 3 cases and its note point. May be explanations won't be in a polished way, please adjust.)

Note:
Here p = 13 and q = 31 for the given d = 2x9 running time complexity is 2 for Fermat factorization. The other set of factors with same difference like (11, 29), (9, 27)..... (3, 21) the running time complexity will increase gradually and worst case will occur. And the few set of factors greater than p and q with same difference like (15, 33), (17, 35)... will remain same time complexity for Fermat factorization. Let M = rs where s - r = q - p (where q and p are best Fermat factors) and r < p and s < q then time complexity will increase compared to N = pq. For e.g., 11x29 = 319 = 20^2 - 9^2 floor of square root of 319 is 17. Now 20 - 17 = 3 complexity increased compared to Best Fermat factors (13, 31)

Note:
Here p = 37 and q = 65 for the given d = 2x14
running time complexity is 2 for Fermat factorization. The other set of
factors with same difference like (35,63), (33,61)..... (3, 31) the
running time complexity will increase gradually and worst case will occur. And the few set of factors
greater than p and q with same difference like (39,67), (41,69)...
will remain same time complexity for Fermat factorization.

Note:
Here p = 49 and q = 81 for the given d = 2x16
running time complexity is 2 for Fermat factorization. The other set of
factors with same difference like (47,79), (45,77)..... (3, 35) the
running time complexity will increase gradually and worst case will occur. And the few set of factors
greater than p and q with same difference like (51,83), (53,85)...
will remain same time complexity for Fermat factorization.

Conclusion:
Hence irrespective of the difference there exist Best Fermat Factors, so that factorization complexity is easy. The logic that odd composite with least difference will be factored easily and large difference would factored hardly is wrong. Hardness is depends upon the how much the factors are deviated from the Best Fermat Factors. And i had a new methodology to factorize the given number based on above properties.