Chapter 9 Factorising and DL Using A Factor Base
Chapter 9 Factorising and DL Using A Factor Base
9
The two intractable problems which are at the heart of public key cryptosystems, are the infeasibility of factorising large integers and of solving the
discrete logarithm (DL) problem. In Chapter 8 some simple schemes for
solving these problems were presented. In this chapter the more powerful
(and complex) methods based on factor bases are presented.
9.1
It is shown below that the time (T ) taken by these methods can be ap1a
proximated by ln T = c(ln n)a (ln ln n)
, this is sometimes written as
1
ln T = L(c, a, n), where a = 2 and c is 2, 2 or 1 depending on the method.
(In the faster and even more complex Number Field Sieve a = 13 .)
These methods are known as sub-exponential. If a = 1 we have T = nc ;
the time depends exponentially on the absolute value of n. If a = 0 we have
T = (ln n)c ; the time depends exponentially on the log, i.e. the length of n ,
i.e. much faster. For intermediate values of a we have a compromise: Faster
than exponential but not as fast as ordinary arithmetic.
The existence of these sub-exponential techniques is a weakness in many
crypto systems based on modular arithmetic. One of the attractions of using
Elliptic Curves (EC) techniques for cryptographic algorithms is that there
are no known sub-exponential methods of attack.(See Chapter 10).
(0.1)
(p(j)e(i,j) ) < n
(0.2)
where the product is over j = 1, m and p(j) stands for the j th prime number.
That is, y(i) is represented in terms of a Factor Base of m primes. If this
can be done for a good number, M say, of x(i), then the solutions can be
cobbled together multiplicatively to produce a right-hand side that is all
squares, thus
(Over selection of x(i)2 ) =
(0.3)
for some f (j). Equation ?? has the required form of equation ??. It is clear
that constructing the selection is equivalent to raising each y(i) to a power
c(i) = 0 or 1 and solving
P
for c(i), with j = 1, m. For M greater then m this can always be done; but to
avoid bad solutions it may be necessary to use M = 2m, say. Therefore the
time taken by the procedure is determined by m, the size of the factor base,
which in turn controls the probability of finding the congruences (equation
2
??). If m is small the probability of finding a relatively random y(i) which can
be expressed as in equation ?? is very small. (Remember that the probability
of an arbitrary integer, X, not having a prime factor greater than its square
root is about 0.3; while the probability of its not having a prime factor greater
1
then X 9 is about 109 .) But make m large and the factor base is large and
the calculations become very lengthy. Somewhere in between is an optimum
value for m.
Differing techniques are used by the various factorising methods based on
equation ?? to generate the congruence (see equation ??). The essence of
these differences is the way in which each tries to ensure that y(i), while still
relatively random, is confined within some range significantly smaller than
(0, n), so that the probability of equation ?? holding is not too small.
j=1 (n(j).ln(p(j)))
ln n
n
) = r, say
(n(j)) ( lnlnp(m)
(mr )
n.r!
1
r!
ln n
since r = ln
, if we take p(m) = m(ln m), so that ln (p(m)) = ln m
m
approximately.
The random y(i) are sieved (trial divisions by the first m primes) to test
if they can be factorised solely in terms of those primes. Each such sieving
takes a time of the order of (m.(ln n)). A selection is then made from the M
equations ?? to form equation ??. In modulo-2 arithmetic the time taken is
insignificant. In the worst case, when n is the product of only two primes, so
that each quadratic residue has four roots of which two are bad, there is
a probability of failure to produce a satisfactory y equal to 0.5. k repeated
attempts with different selections reduce this probability to 2k . Thus we
may take M = Order (m). With this approximation the central part of the
factorising process takes a time, T , allowing for the probable failure of the
sieving operation:
n
)
T=(m2 )( Pln
(n,m)
(0.4)
ln nln ln m
x
(0.5)
(0.6)
(0.7)
ln nln ln m
2x
(0.8)
giving for the new equation ?? ln m = ((ln n)(ln ln n)/(8)) 2 and for the
new equation ?? ln T (2(ln n)(ln ln n))0.5
In short, because the continued fractions produce good approximations
to n0.5 , the range of x2 (mod n) is significantly reduced, m can be reduced,
and ln T is reduced by a factor 20.5 .
The CF algorithm runs as follows:
If (kn)0.5 is approximated by a continued fraction (q(0), q(1), . . . , q(m)) =
A(m)
, with the qs integers, then the usual recurrence relation A(m) =
B(m)
q(m).A(m 1) + A(m 2), enables A(m) to be found. q(m) itself may
be found from
q(m) = b(q(0) + (m)
c
(m)
with (m) = q(m 1)(m 1) (m 1)
and (m) (m 2) = q(m 1)((m 1) (m))
Using these auxiliary quantities , it can be shown that A(m)2 mod n =
(m + 1).((1)m+1 ) so that A(m)2 mod n may be found directly by iterating
the above three equations. The initial values are q(0) = b(kn)0.5 c, (0) =
0, (1) = q(0), (0) = 1, (1) = kn q(0)2 .
(0.9)
an(i) mod p =
Qm
j=1
p(j)e(i,j)
i = 1, M
(0.10)
This is the same procedure as the central part of Dixons method for factorisation except that we use an(i) instead of x(i)2 . Consequently the time T 1
7
(0.11)
Note that this is the minimum time occurring when ln m = ((ln p)(ln ln p)/(4)) 2 ,
as per equation ??.
Stage 2
We suppose p(j) = aN (j) for some N (j). (This is certainly true if a is primitive, if a is not primitive see below). Substituting in equation ?? and taking
logarithms gives
Pm
n(i)=
j=1
(0.12)
These linear equations are then inverted to find the N (j). The inversion is
performed modulo each of the prime factors of (p 1), and the results are
put together using the Chinese Remainder Theorem. The time taken is T 2
and is given by
ln T2 = 3(ln m)
(0.13)
(0.14)
Stage 3
We now have from Stage 2 p(j) = aN (j) , so we take an arbitrary s and try to
express b.as mod p in terms of the factor base. We try sufficient values for s
until we have success:
b.as mod p =
Qm
j=1
(0.15)
x+s =
j=1
(0.16)
(0.17)
(0.18)
00
m
bs mod p =
p(j)e (j) = aN (j).e (j)
Pj=1
m
00
then
s.(log b) =
j=1 (N (j).e (j)) mod (p 1)
so (log b) = x can be found if s has an inverse s1 mod (p 1).
If a is not primitive we find c primitive mod p and use the method to find r
0
in a = cr mod p. Then the problem pj = aNj mod p becomes pj = cNj mod p
with Nj0 = rNj . Solve for Nj0 and then find Nj = r1 Nj0 mod (p 1).
9
0.5
ln T1 = 2(ln m)
(0.19)
(0.20)
10
362
372
382
392
402
412
422
432
442
452
462
472
=
=
=
=
=
=
=
=
=
=
=
=
473
400
325
248
169
88
5
80
167
256
347
440
=
=
=
=
=
=
-11 43
-24 52
-52 13
-23 31
-132
-23 11
N F (not f actorisable)
NF
= 24 5
NF
= 28
NF
3
= 2 5 11
First Try
412 422 472 = 26 52 112 mod 1769
or (1329)2 = (440)2 mod 1769
or (1769)0 = 0 mod 1769
Second Try
372 402
(1480)2
(1480 - 260)(1480 + 260)
17401220
4
2
2 3 5 29 61
1769
=
=
=
=
=
=
24 52 132
(260)2
0 mod 1769
0 mod 1769
0 mod 1769
2961
11