Lably
Skip to content

Baby-step giant-step

Algorithm for solving the discrete logarithm problem

  • 2 min read
  • 3 chapters

Related on Lably

Through Algorithm and Big O notation

Many of the most commonly used cryptography systems are based on the assumption that the discrete log is extremely difficult to compute; the more difficult it is, the more security it provides a data transfer. One way to increase the difficulty of the discrete log problem is to base the cryptosystem on a larger group.

Theory

The algorithm is based on a space–time tradeoff. It is a fairly simple modification of trial multiplication, the naive method of finding discrete logarithms.

Given a cyclic group G of order n, a generator α of the group and a group element β, the problem is to find an integer x such that

αx=β.

The baby-step giant-step algorithm is based on rewriting x:

x=im+j
m=⌈n⌉
0≤i<m
0≤j<m

Therefore, we have:

αx=β
αim+j=β
αj=β(α−m)i

The algorithm precomputes αj for several values of j. Then it fixes an m and tries values of i in the right-hand side of the congruence above, in the manner of trial multiplication. It tests to see if the congruence is satisfied for any value of j, using the precomputed values of αj.

Sign in to keep reading

2 more chapters are free with a Lably account.

More in Topics in mathematics