Fermat Factorisation

Used when p and q are numericaly close

If pp and qq are numerically close, we can use Fermat Factorisation.

During Fermat Factorisation, we hope to find aa and bb such that

a2āˆ’b2=Na^2 - b^2 = N

Because that then means we can factorise the left-hand expression into

(a+b)(aāˆ’b)=N(a+b)(a-b)=N

As thus we get the two factors of NN as (a+b)(a+b) and (aāˆ’b)(a-b).

The reason we use this when pp and $q$ are numerically close is because the closer they are to each other the closer they are to N\sqrt{N}. If we say a=Na=\sqrt{N} rounded up to the nearest number, we can calculate b2=a2āˆ’Nb^2 = a^2-N (as rearranged from before) until bb is a whole number, after which we've solved the equation.

An example of this attack can be found in this writeup, which may make it a bit clearer.

Last updated

Was this helpful?