New Pragmatic Algorithms to Improve Factoring of Large Numbers

: Rivest, Shamir, Adleman, RSA algorithm is a popular public key cryptosystem and is known to be secure, however, this fact relies on the difficulty of factoring large numbers. No algorithm has been published that can factor all integers in polynomial time. This paper proposes a new function that can be used to improve the process of factoring integer numbers. It gets the factor faster than known methods. By making use of such proposed function, corresponding two algorithms are proposed and pseudocoded. The utilization of these algorithms along with the basics of the theory of numbers led to three other new factoring algorithms. The five algorithms are implemented and verified using Python Language. The tabulated results that represent the time of factorization versus the number of digits of the large number have indicated the applicability of the last three algorithms.


Introduction
Integer factorization is a classical problem in computer science and number theory [2], [3]. When the numbers are very large, no efficient, integer factorization algorithm is known. Several cryptographic systems are based on the hardness of factorization problems have been proposed. Among them, the RSA system is the most famous and widely used [2]. Actually, not all numbers of a given length are equally hard to factor. This fact is obvious from Table 2 (Sec. 4). The hardest instances of that problem occur when the corresponding to prime numbers are both large, randomly chosen and about the same size (but not too close).
Zaki and Hussein [1], proposed a function that has been used as fitness function in genetic algorithms to improve the heuristic search for factoring integer numbers. The fastest general-purpose factorization algorithm is the Number Field Sieve (NFS), [4]- [7]. This paper is organized as follows. In section 2, related works are discussed and a mathematical background is given in section 3. The proposed function in [1] is extended in section 4. Additional new algorithms for factoring integers will be discussed in section 5. Finally, the paper is concluded in section 6.

Related Work
Many references, [4]- [7] have explained methods of factoring integers, to attack the public key [3], such as Elliptic Curves, Continued Fraction, Quadratic Sieve and Number Field Sieve (NFS). Implementation of any of these methods, takes impractical factoring time.
Abd El-Mageed and Hussein [1] have proposed function that used as fitness function to improve the heuristic search and gave genetic algorithms in order to factor the integer number. However, the time complexity of a genetic algorithm is O (a 3 ) where a is the number of the constituents prime factors of the underlying integers. Here, the proposed algorithms, depend on a new function that can optimize memory and time of implementation for factoring integers.
It can be noticed that, on the research level several quantum systems have solved the quantum factorization problem [9] [10] and achieved noticeable success [11]. However, in practice, RSA is still popular and widely spread.

Mathematical Background
Suppose we want to factor the composite number N. We choose a bound, and identify the factor base, P, the set of all primes less than or equal to the chosen bound. Next, we search for positive integers z such that both z and (z+N) have all of their prime factors in P. We can therefore write, ∈ P and = 1, 2,…, number of primes in P and similarly: {\displaystyle z+n=\prod _{p_{i}\in P}p_{i}^{b_{i}}} But z and (z+N) are congruent modulo N, and each integer z yields a multiplicative relation (mod N) among the elements of P, i. e.

=
(3) {\displaystyle \prod _{p_{i}\in P}p_{i}^{a_{i}}\equiv \prod _{p_{i}\in P}p_{i}^{b_{i}}{\pmod {n}}} Where a and b are nonnegative integers. When we have generated enough of these relations one can use the methods of linear algebra to multiply together these various relations in such a way that the exponents of the primes are all even [8]. This will give us a congruence of squares of the form a 2 ≡b 2 (mod N), which can be turned into a factorization of N.

The Proposed Extended Function
The new proposed function gf (x, N) is defined as follows: where a is factor of N. Proposition 1. Let p be a factor of N, then, by repeating k*p (mod N), k>0, the result is p.
Because k*p is congruence of p.
The basic procedure of implementing gf (x, N), as such, is given algorithm that can be pointed out as follows: Algorithm 1 gf (x, N) (implementation of the function, given factor) Input: the number N to be factored and an element x in the interval [2, N-1] Output: the factor p of N or 1.  This clearly shows that egf (x, N) exceeds the co-domain of gf (x, N) which exceeds the co-domain of gcd (x, N), Table 1. Actually, any heuristic can use one of these algorithms, gf (x, n), or egf (x, n) as a fitness function to get the target factor

Other Three New Algorithms
Here, three proposed new factoring algorithms are The following algorithm for factoring, uses the iteration method to solve equation of degree 3 that equals to the integer n = p * q. 5-if p = q = 1, then set p = e gf (v, n) and q = n/p 6-return p, q Table 2, shows the relation between the number of decimal digits of N and time of implementation of basefact, iterfact, and propfact algorithms.

Conclusion
Integer factorization is an important computational problem, and it is the foundation of the RSA cryptosystem. Since the invention of the general number field sieve in 1993, there is no substantial progress on this problem.
The method that has been proposed here is actually new and it depends on the large co-domain of gf an egf functions. By extending these functions co-domain three algorithms are given.
These algorithms have been programmed in Python and implemented on a PC. This result puts a doubt on the conclusion of Rivest which states that factoring a 200 digit number requires four billion years on a computer that forms one instruction per micro second The promising results of the presented algorithms encourage us to enhance their implementation by making use of long integer architecture packages that can use gf or egf to decrease time of factorization. In the previous tables, time of implementation depends on the difference of two factors of factored number. In conclusion, it is clear that the proposed method is relatively simple, fast and scalable when compared to existing methods.