## Example of the Pohlig-Hellman Technique for finding discrete logarithms

Let the prime p = 8101, and a generator of Z_{8101} be a = 6. Find x so that
a^{x} = 7531 mod 8101.

Observe that p-1 = 8100 = (2^{2})(3^{4})(5^{2}), is a product of small primes. We shall determine
the numbers x_{2} = x mod (2^{2}), x_{3} = x mod (3^{4}) and x_{5} = x mod (5^{2}).

### Determination of x_{2}.

Since x_{2} is a number mod 4, we have x_{2} = c_{0} + c_{1} (2), with the coefficients being either
0 or 1. We determine these coefficients as follows.
7531^{(p-1)/2} = 7531^{4050} = -1 and as this = a^{c0 (p-1)/2}, we have c_{0} = 1.

Now, divide 7531 by a^{c0} to get

7531(a^{-1}) = 7531(6751) = 8006 mod p.

8006^{(p-1)/4} = 8006^{2025} = 1 and as this = a^{c1 (p-1)/2}, we have c_{1} = 0.

x_{2} = c_{0} + c_{1} (2) = 1 + 0(2) = 1.

### Determination of x_{3}.

Since x_{3} is a number mod 81, we have x_{3} = c_{0} + c_{1} (3) + c_{2} (9) + c_{3} (27), with the
coefficients being either 0, 1 or 2. It will be of use to know the numbers a^{(p-1)/3} = 5883,
and a^{2(p-1)/3} = 2217.
7531^{(p-1)/3} = 2217, so c_{0} = 2.

Now divide 7531 by a^{c0} to get

7531(a^{-2}) = 6735 mod p.

6735^{(p-1)/9} = 1, so c_{1} = 0.

Now divide 6735 by a^{3c1} to get

6735(a^{0}) = 6735 mod p.

6735^{(p-1)/27} = 2217, so c_{2} = 2.

Now divide 6735 by a^{9c2} to get

6735(a^{-18}) = 6992 mod p.

6992^{(p-1)/81} = 5883, so c_{3} = 1.

x_{3} = 2 + 0(3) + 2(9) + 1(27) = 47.

### Determination of x_{5}.

Since x_{5} is a number mod 25, x_{5} = c_{0} + c_{1} (5), with the coefficients being either 0, 1,
2, 3 or 4. We need to compute a^{(p-1)/5} = 3547, a^{2(p-1)/5} = 356, a^{3(p-1)/5} = 7077,
a^{4(p-1)/5} = 5221.
7531^{(p-1)/5} = 5221, so c_{0} = 4.

Divide 7531 by a^{c0} to get

7531(a^{-4}) = 7613 mod p.

7613^{(p-1)/25} = 356, so c_{1} = 2.

x_{5} = 4 + 2(5) = 14.

### Determination of x.

We now use the Chinese Remainder Theorem to compute the common solution of the
congruences,
- x = 1 mod 4
- x = 47 mod 81
- x = 14 mod 25.

M_{1} = 8100/(4) = 2025

y_{1} = M_{1}^{-1} mod 4, y_{1} = 1.
M_{2} = 8100/81 = 100

y_{2} = M_{2}^{-1} mod 81, y_{2} = 64.

M_{3} = 8100/25 = 324

y_{3} = M_{3}^{-1} mod 25, y_{3} = 24.

x = 1(2025)(1) + 47(100)(64) + 14(324)(24) =** 6689** mod 8100.

Return to index (non-frame version)