improvements in the index-calculus algorithm for solving...

25
The DLP Preliminaries ’Original’ Index-Calculus algorithm The Number Field Sieve, Index-Calculus Algorithm Improvements in the Index-Calculus algorithm for Solving the Discrete Logarithm problem over F p Raminder Ruprai October 29, 2007 Raminder Ruprai Improvements in the Index-Calculus algorithm for Solving the D

Upload: vukien

Post on 08-May-2019

217 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Improvements in the Index-Calculus algorithm for Solving ...prai175/ISGStudentSem07/IndexCalculus.pdf · Improvements in the Index-Calculus algorithm for Solving the Discrete Logarithm

The DLPPreliminaries

’Original’ Index-Calculus algorithmThe Number Field Sieve, Index-Calculus Algorithm

Improvements in the Index-Calculus algorithm forSolving the Discrete Logarithm problem over Fp

Raminder Ruprai

October 29, 2007

Raminder Ruprai Improvements in the Index-Calculus algorithm for Solving the Discrete Logarithm problem over Fp

Page 2: Improvements in the Index-Calculus algorithm for Solving ...prai175/ISGStudentSem07/IndexCalculus.pdf · Improvements in the Index-Calculus algorithm for Solving the Discrete Logarithm

The DLPPreliminaries

’Original’ Index-Calculus algorithmThe Number Field Sieve, Index-Calculus Algorithm

Summary

The Discrete Logarithm Problem

Preliminaries: Smoothness & The Subexponential Function

‘Original’ Index-Calculus Algorithm

Worked Example

The Number Field Sieve Improvements

Raminder Ruprai Improvements in the Index-Calculus algorithm for Solving the Discrete Logarithm problem over Fp

Page 3: Improvements in the Index-Calculus algorithm for Solving ...prai175/ISGStudentSem07/IndexCalculus.pdf · Improvements in the Index-Calculus algorithm for Solving the Discrete Logarithm

The DLPPreliminaries

’Original’ Index-Calculus algorithmThe Number Field Sieve, Index-Calculus Algorithm

The Discrete Logarithm Problem in general

The Discrete Logarithm Problem (DLP) in general is as follows: -Given a group G with a binary operation written multiplicatively,the DLP is, given a, b ∈ G where b ∈< a >, find an integer x suchthat

ax = b.

Raminder Ruprai Improvements in the Index-Calculus algorithm for Solving the Discrete Logarithm problem over Fp

Page 4: Improvements in the Index-Calculus algorithm for Solving ...prai175/ISGStudentSem07/IndexCalculus.pdf · Improvements in the Index-Calculus algorithm for Solving the Discrete Logarithm

The DLPPreliminaries

’Original’ Index-Calculus algorithmThe Number Field Sieve, Index-Calculus Algorithm

In a finite field of prime order..

The Discrete Logarithm problem in Fp (a finite field of prime orderp) which is represented by Z/pZ (or informally Zp), is givena, b ∈ Z ∗

p find an integer x such that,

ax ≡ b (mod p),

where a is a generator of Z ∗p .

Raminder Ruprai Improvements in the Index-Calculus algorithm for Solving the Discrete Logarithm problem over Fp

Page 5: Improvements in the Index-Calculus algorithm for Solving ...prai175/ISGStudentSem07/IndexCalculus.pdf · Improvements in the Index-Calculus algorithm for Solving the Discrete Logarithm

The DLPPreliminaries

’Original’ Index-Calculus algorithmThe Number Field Sieve, Index-Calculus Algorithm

Smoothness

For t, y ∈ N, we say t is y -smooth, if all the primes in the primefactorisation of t are ≤ y .For example: 100 = 22 × 52 so we say 100 is 5-smooth.

Raminder Ruprai Improvements in the Index-Calculus algorithm for Solving the Discrete Logarithm problem over Fp

Page 6: Improvements in the Index-Calculus algorithm for Solving ...prai175/ISGStudentSem07/IndexCalculus.pdf · Improvements in the Index-Calculus algorithm for Solving the Discrete Logarithm

The DLPPreliminaries

’Original’ Index-Calculus algorithmThe Number Field Sieve, Index-Calculus Algorithm

The subexponential function

The subexponential function can be used to describe the runningtime of algorithms which are slower than polynomial but fasterthan exponential. Given an algorithm M with argument p, we saythat M completes in: -

polynomial time if the expected running time is O((log p)c),

exponential time if the expected running time is O(pc),

for some positive c .

Raminder Ruprai Improvements in the Index-Calculus algorithm for Solving the Discrete Logarithm problem over Fp

Page 7: Improvements in the Index-Calculus algorithm for Solving ...prai175/ISGStudentSem07/IndexCalculus.pdf · Improvements in the Index-Calculus algorithm for Solving the Discrete Logarithm

The DLPPreliminaries

’Original’ Index-Calculus algorithmThe Number Field Sieve, Index-Calculus Algorithm

The subexponential function

The subexponential function is then

Ln[v ; c] = e(c+o(1))(log n)v (log log n)1−v.

When v = 1 we have nc i.e. exponential time

When v = 0 we have (log n)c i.e. polynomial time

So the closer we head towards v = 0 the faster our algorithm is.Informally we let c be a general constant and n be the knownargument, in this case our big prime p, so we just denote thesubexponential function as L(v).

Raminder Ruprai Improvements in the Index-Calculus algorithm for Solving the Discrete Logarithm problem over Fp

Page 8: Improvements in the Index-Calculus algorithm for Solving ...prai175/ISGStudentSem07/IndexCalculus.pdf · Improvements in the Index-Calculus algorithm for Solving the Discrete Logarithm

The DLPPreliminaries

’Original’ Index-Calculus algorithmThe Number Field Sieve, Index-Calculus Algorithm

Worked ExampleRunning time of the original Index-Calculus Algorithm

’Original’ Index-Calculus algorithm - Setup

A Factor base F is chosen consisting of small primese.g. F = [2, 3, 5, 7, 11, 13, 17, 19, 23, . . .].

A matrix M is created so that the columns represent thediscrete logs to the base a (loga) of elements of F . The rowsof the matrix will represent relations which we now need tofind/construct.

Raminder Ruprai Improvements in the Index-Calculus algorithm for Solving the Discrete Logarithm problem over Fp

Page 9: Improvements in the Index-Calculus algorithm for Solving ...prai175/ISGStudentSem07/IndexCalculus.pdf · Improvements in the Index-Calculus algorithm for Solving the Discrete Logarithm

The DLPPreliminaries

’Original’ Index-Calculus algorithmThe Number Field Sieve, Index-Calculus Algorithm

Worked ExampleRunning time of the original Index-Calculus Algorithm

Generating Relations

Pick a random integer v ∈ [1..p − 1] and compute

c ≡ av (mod p)

c is an element of Z ∗p but we treat it as an integer and

factorise it. If all the factors of c are in F then we say that cis F-smooth.

Given that c = pb11 · pb2

2 · . . . · pbnn where all the pi ∈ F then

v ≡ b1 loga p1 + b2 loga p2 + . . .+ bn loga pn (mod p − 1).

Raminder Ruprai Improvements in the Index-Calculus algorithm for Solving the Discrete Logarithm problem over Fp

Page 10: Improvements in the Index-Calculus algorithm for Solving ...prai175/ISGStudentSem07/IndexCalculus.pdf · Improvements in the Index-Calculus algorithm for Solving the Discrete Logarithm

The DLPPreliminaries

’Original’ Index-Calculus algorithmThe Number Field Sieve, Index-Calculus Algorithm

Worked ExampleRunning time of the original Index-Calculus Algorithm

Filling in the Matrix & Solving

From this relation we then add a sparse row to the matrix Mwhich has entries bi in the column representing loga pi and 0’selsewhere. In addition we add v to the solution vector S.

We want to solve MX = S for X , where X is a vector whoseelements are loga pi . This is solved over p − 1 which is notprime so some elements will not have inverses.

Therefore we continue finding relations until we have morerows that columns i.e. more relations that elements in thefactor base.

When enough relations are found we solve for the discrete logsof the elements in the factor base.

Raminder Ruprai Improvements in the Index-Calculus algorithm for Solving the Discrete Logarithm problem over Fp

Page 11: Improvements in the Index-Calculus algorithm for Solving ...prai175/ISGStudentSem07/IndexCalculus.pdf · Improvements in the Index-Calculus algorithm for Solving the Discrete Logarithm

The DLPPreliminaries

’Original’ Index-Calculus algorithmThe Number Field Sieve, Index-Calculus Algorithm

Worked ExampleRunning time of the original Index-Calculus Algorithm

Solving for DLP

We now know logapi ∀pi ∈ FThen we take random j ’s until ajb is F-smooth. Therefore wecan write

ajb ≡ pd11 pd2

2 . . . pdnn (mod p)

for pi ∈ F . Then we get

j + logab ≡ d1 loga p1 + d2 loga p2 + . . .+ dn loga pn.

We know j , all the di ’s and all the discrete logs of theelements of the factor base so we can re-arrange the equationto find loga b.

Raminder Ruprai Improvements in the Index-Calculus algorithm for Solving the Discrete Logarithm problem over Fp

Page 12: Improvements in the Index-Calculus algorithm for Solving ...prai175/ISGStudentSem07/IndexCalculus.pdf · Improvements in the Index-Calculus algorithm for Solving the Discrete Logarithm

The DLPPreliminaries

’Original’ Index-Calculus algorithmThe Number Field Sieve, Index-Calculus Algorithm

Worked ExampleRunning time of the original Index-Calculus Algorithm

Example with p = 1009

Given a prime p = 1009 and base element 11 we want to find xsuch that

11x ≡ 946 (mod 1009)

The size of the factor base should be around L(1/2) for thisalgorithm so take our factor base to be F = {2, 3, 5, 7, 11, 13}.We need at least 6 relations but we have 1 already

log11 11 ≡ 1 (mod 1008)

We continue by choosing random powers of 11 mod 1009 andsee whether they are F-smooth.

Raminder Ruprai Improvements in the Index-Calculus algorithm for Solving the Discrete Logarithm problem over Fp

Page 13: Improvements in the Index-Calculus algorithm for Solving ...prai175/ISGStudentSem07/IndexCalculus.pdf · Improvements in the Index-Calculus algorithm for Solving the Discrete Logarithm

The DLPPreliminaries

’Original’ Index-Calculus algorithmThe Number Field Sieve, Index-Calculus Algorithm

Worked ExampleRunning time of the original Index-Calculus Algorithm

Example cont.2

We get the following

11300 = 112 mod 1009 which factorises as 24 × 7,1123 = 390 mod 1009 which factorises as 2× 3× 5× 13,

11900 = 400 mod 1009 which factorises as 24 × 52,11134 = 768 mod 1009 which factorises as 28 × 3,11797 = 165 mod 1009 which factorises as 3× 5× 11,1143 = 65 mod 1009 which factorises as 5× 13.

Raminder Ruprai Improvements in the Index-Calculus algorithm for Solving the Discrete Logarithm problem over Fp

Page 14: Improvements in the Index-Calculus algorithm for Solving ...prai175/ISGStudentSem07/IndexCalculus.pdf · Improvements in the Index-Calculus algorithm for Solving the Discrete Logarithm

The DLPPreliminaries

’Original’ Index-Calculus algorithmThe Number Field Sieve, Index-Calculus Algorithm

Worked ExampleRunning time of the original Index-Calculus Algorithm

Example cont.3

These can then be transformed into the associated congruences asfollows,

log11 11 ≡ 1 (mod 1008),4 log11 2 + log11 7 ≡ 300 (mod 1008),

log11 2 + log11 3 + log11 5 + log11 13 ≡ 23 (mod 1008),4 log11 2 + 2 log11 5 ≡ 900 (mod 1008),

8 log11 2 + log11 3 ≡ 134 (mod 1008),log11 3 + log11 5 + log11 11 ≡ 797 (mod 1008),

log11 5 + log11 13 ≡ 43 (mod 1008).

Raminder Ruprai Improvements in the Index-Calculus algorithm for Solving the Discrete Logarithm problem over Fp

Page 15: Improvements in the Index-Calculus algorithm for Solving ...prai175/ISGStudentSem07/IndexCalculus.pdf · Improvements in the Index-Calculus algorithm for Solving the Discrete Logarithm

The DLPPreliminaries

’Original’ Index-Calculus algorithmThe Number Field Sieve, Index-Calculus Algorithm

Worked ExampleRunning time of the original Index-Calculus Algorithm

Example cont.4

The matrix, M, that we get from these congruences is

0 0 0 0 1 04 0 0 2 0 01 1 1 0 0 14 0 2 0 0 08 1 0 0 0 00 1 1 0 1 00 0 1 0 0 1

We also get a solution vector

S = (1, 300, 23, 900, 134, 797, 43)T .

Raminder Ruprai Improvements in the Index-Calculus algorithm for Solving the Discrete Logarithm problem over Fp

Page 16: Improvements in the Index-Calculus algorithm for Solving ...prai175/ISGStudentSem07/IndexCalculus.pdf · Improvements in the Index-Calculus algorithm for Solving the Discrete Logarithm

The DLPPreliminaries

’Original’ Index-Calculus algorithmThe Number Field Sieve, Index-Calculus Algorithm

Worked ExampleRunning time of the original Index-Calculus Algorithm

Example cont.5

Solving MX = S for X we get the following discrete logs: -

log11 2 = 886, log11 3 = 102, log11 5 = 694,log11 7 = 788, log11 11 = 1, log11 13 = 357.

We now have to attempt to find a power, γ, of 11 such that946× 11γ is F-smooth. After a few attempts we get γ = 491 andtherefore:

946× 11491 ≡ 624 = 24 × 3× 13 (mod 1009)

Going back to our original DLP, 11x ≡ 946, then we have that

x ≡ 4 log11 2 + log11 3 + log11 13− 491 ≡ 488

So the solution to the DLP is x = 488Raminder Ruprai Improvements in the Index-Calculus algorithm for Solving the Discrete Logarithm problem over Fp

Page 17: Improvements in the Index-Calculus algorithm for Solving ...prai175/ISGStudentSem07/IndexCalculus.pdf · Improvements in the Index-Calculus algorithm for Solving the Discrete Logarithm

The DLPPreliminaries

’Original’ Index-Calculus algorithmThe Number Field Sieve, Index-Calculus Algorithm

Worked ExampleRunning time of the original Index-Calculus Algorithm

Running Time

Proposition

Given a number n ≤ L(s). The probability that n is L(t)-smooth isL(t − s).

So to obtain enough relations to solve the linear algebra is thereciprocal of that, L(s − t). What does that mean here?

c = av can have any value in Z ∗p so has order of magnitude p

or L(1). To minimise the running time of the algorithm thefactor base has to have size L(1/2) therefore the probabilitythat a c is F-smooth is L(1/2− 1).

So to generate enough relations we get a running time ofO(L(1/2)).

Raminder Ruprai Improvements in the Index-Calculus algorithm for Solving the Discrete Logarithm problem over Fp

Page 18: Improvements in the Index-Calculus algorithm for Solving ...prai175/ISGStudentSem07/IndexCalculus.pdf · Improvements in the Index-Calculus algorithm for Solving the Discrete Logarithm

The DLPPreliminaries

’Original’ Index-Calculus algorithmThe Number Field Sieve, Index-Calculus Algorithm

The Number Field Sieve

In the Number Field Sieve Index-Calculus Algorithm relationsare constructed in a different way.

Motivation: In order to reduce the running time we attemptto reduce the size of the number we are factorising.

If we could restrict the magnitude of av to L(2/3) then wecould reduce the running time of the algorithm. But this ishard.

Raminder Ruprai Improvements in the Index-Calculus algorithm for Solving the Discrete Logarithm problem over Fp

Page 19: Improvements in the Index-Calculus algorithm for Solving ...prai175/ISGStudentSem07/IndexCalculus.pdf · Improvements in the Index-Calculus algorithm for Solving the Discrete Logarithm

The DLPPreliminaries

’Original’ Index-Calculus algorithmThe Number Field Sieve, Index-Calculus Algorithm

A Different way to get relations

Instead we do the following.

Choose a polynomial f with root α ∈ C and such thatf (m) ≡ 0 (mod p) for some integer m. There is ahomomorphism ψ : α→ m (mod p).

The factor base F will have two parts FQ (consisting of smallprime numbers) and FK (consisting of degree 1 prime ideals).

Now we choose c , d ≤ L(1/3) and consider c + dm. For everyc + dm there is an ideal (c + dα) associated with it.

Raminder Ruprai Improvements in the Index-Calculus algorithm for Solving the Discrete Logarithm problem over Fp

Page 20: Improvements in the Index-Calculus algorithm for Solving ...prai175/ISGStudentSem07/IndexCalculus.pdf · Improvements in the Index-Calculus algorithm for Solving the Discrete Logarithm

The DLPPreliminaries

’Original’ Index-Calculus algorithmThe Number Field Sieve, Index-Calculus Algorithm

Different way to get relations

Thus

LEFT ≡ RIGHTc + dm ≡ ψ(c + dα)∏pi∈FQ

peii ≡ ψ(

∏pi∈FK

pfii )

Raminder Ruprai Improvements in the Index-Calculus algorithm for Solving the Discrete Logarithm problem over Fp

Page 21: Improvements in the Index-Calculus algorithm for Solving ...prai175/ISGStudentSem07/IndexCalculus.pdf · Improvements in the Index-Calculus algorithm for Solving the Discrete Logarithm

The DLPPreliminaries

’Original’ Index-Calculus algorithmThe Number Field Sieve, Index-Calculus Algorithm

Advantage, Quicker...or another problem?

So far, ok, but there looks to be a problem...

What do we do with the ‘stuff’ on the right.

As the prime factorisation of the ideal (c + dα) is differentfrom the prime factorisation of the number c + dm withenough relations we can cancel out all the prime ideals on theright to get 1.

With the number field, this is not a trivial issue as getting 1on the right is not as straight forward as just cancelling.

Raminder Ruprai Improvements in the Index-Calculus algorithm for Solving the Discrete Logarithm problem over Fp

Page 22: Improvements in the Index-Calculus algorithm for Solving ...prai175/ISGStudentSem07/IndexCalculus.pdf · Improvements in the Index-Calculus algorithm for Solving the Discrete Logarithm

The DLPPreliminaries

’Original’ Index-Calculus algorithmThe Number Field Sieve, Index-Calculus Algorithm

With the number field out of the way...

From the previous slide we have the following∏pi∈FQ

peii ≡ 1 (mod p).

Taking the logarithm to the base a of both sides we have∑pi∈FQ

ei loga pi ≡ 0 (mod p − 1).

With enough relations we can use linear algebra to solve forthe discrete logarithm of the primes in the factor base.

However, we still do not have loga b.

Raminder Ruprai Improvements in the Index-Calculus algorithm for Solving the Discrete Logarithm problem over Fp

Page 23: Improvements in the Index-Calculus algorithm for Solving ...prai175/ISGStudentSem07/IndexCalculus.pdf · Improvements in the Index-Calculus algorithm for Solving the Discrete Logarithm

The DLPPreliminaries

’Original’ Index-Calculus algorithmThe Number Field Sieve, Index-Calculus Algorithm

Solving the DLP for a specific b

In the Number field sieve algorithm this is not as trivial as before.Roughly speaking we have to do the following

we choose an l ∈ [1, p − 1] such that

alb ≡∏j

qj (mod p),

where the qj ’s are primes of ’medium’ size but do not have tobe distinct.

For each qj we need to set up a new factor base of primeideals over a different extension field.

We then need to find enough relations to cancel out all theprime ideals in order to find loga qj as a sum of discrete logsof elements in FQ. We know these from the previous slides sowe now know loga b!

Raminder Ruprai Improvements in the Index-Calculus algorithm for Solving the Discrete Logarithm problem over Fp

Page 24: Improvements in the Index-Calculus algorithm for Solving ...prai175/ISGStudentSem07/IndexCalculus.pdf · Improvements in the Index-Calculus algorithm for Solving the Discrete Logarithm

The DLPPreliminaries

’Original’ Index-Calculus algorithmThe Number Field Sieve, Index-Calculus Algorithm

So to conclude the running time is...

The running time using the Number Field Sieve as described byDaniel Gordon of the University of Georgia in 1992 is

O

(L

(1

3, 3

23

)).

When the DLP is over different types of finite fields such as Fpm

the constant can be improved.The crossover point between the ’Original’ Index-CalculusAlgorithm and the Number Field Sieve is 218 bits so one could saythat this algorithm is unpractical for reasonable numbers. Thenagain you wouldn’t be trying to solve an easy DLP...

Raminder Ruprai Improvements in the Index-Calculus algorithm for Solving the Discrete Logarithm problem over Fp

Page 25: Improvements in the Index-Calculus algorithm for Solving ...prai175/ISGStudentSem07/IndexCalculus.pdf · Improvements in the Index-Calculus algorithm for Solving the Discrete Logarithm

The DLPPreliminaries

’Original’ Index-Calculus algorithmThe Number Field Sieve, Index-Calculus Algorithm

Thank you

Any questions?

Raminder Ruprai Improvements in the Index-Calculus algorithm for Solving the Discrete Logarithm problem over Fp