Pohlig–Hellman algorithm

This is an old revision of this page, as edited by Xqbot (talk | contribs) at 00:42, 19 November 2009 (robot Modifying: ru:Алгоритм Полига — Хеллмана). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

In mathematics, the Pohlig–Hellman algorithm is an algorithm for the computation of discrete logarithms in a multiplicative group whose order is a smooth integer. The algorithm is based on the Chinese remainder theorem.

The algorithm was discovered by Roland Silver, but first published by Stephen Pohlig and Martin Hellman (independent of Silver).

We will explain the algorithm in terms of the group formed by taking all the elements of Zp which are coprime to p, and leave it to the advanced reader to extend the algorithm to other groups by using Lagrange's Theorem.

Input Integers p, g, e.
Output Integer x, such that e ≡ gx (mod p).
  1. Determine the prime factorization of the order of the group (the totient in this case)  :
  2. From the remainder theorem we know that x = a1 p1 + b1. We now find the value of b1 for which the following equation holds using a fast algorithm such as Baby-step giant-step :
    (using Euler's theorem)

    Note that if then the order of g is less than φ(p) and must be 1 for a solution to exist. In this case there will be more than one solution for x less than φ(p), but since we are not looking for the whole set, we can require that b1=0.

    The same operation is now performed for p2 up to pn.

    A minor modification is needed where a prime number is repeated. Suppose we are seeing pi for the k+1-th time. Then we already know ci in the equation x = ai pik+1 + bi pik+ci, and we find bi the same way as before.
  3. We end up with enough simultaneous congruences so that x can be solved using the Chinese remainder theorem.

Complexity

The time complexity of the Pohlig–Hellman algorithm is   for a group of order n, but it is more efficient if the order is smooth.

References

  1. S. Pohlig and M. Hellman. "An Improved Algorithm for Computing Logarithms over GF(p) and its Cryptographic Significance", IEEE Transactions on Information Theory 24 (1978), pp. 106–110.