Monday, June 9, 2008

RSA Publick Key Factorization








Now that an algorithm is in place lets see if it works properly. Conventional methods of factorization is
1. first find square root of the number.
2. find the primes below the value.
3. divide the number by each prime number and decide the factors.

Lets take a small number for e.g. 21437689 -- just 8 digit number. you are given the fact that it has two numbers as factors and they are prime.
Assumptions:
The following steps are considered as a single operation.
1.taking square root.
2.iteration.

now as per conventional method
1.take the square root of the number. . so we get a result of 4631.
2.find primes below this number. Note for each number you have to traverse the square root of that number to decide if its a prime or not.
3. start dividing the number by the primes and decide which prime is divisible.

No of operations for each step
step 1: 1 for taking square root.
step 2: a min of 4631 iterations to find all primes.
step 3: assuming we found 500 primes. we have to iterate through them again.

we get 5132 steps. or a min of 4632 if we combine step 2 and step 3.

If we go by the above method we end up at just 473 steps in the new method.
the new method. iterates through a maximum of 945 steps if we include two more assumptions that squaring and { difference / comparison / addition} are considered as a individual steps.
the new method is approximately 10 times faster than the conventional method.

Attached is an octave program of my algorithm.

The next step is to study and compare the elliptic curve method idea.

No comments: