Pohlig–Hellman algorithm: Difference between revisions

Content deleted Content added
Line 3:
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 '''Z'''<sub>''p''</sub> which are [[coprime]] to ''p'', and leave it to the advanced reader to extend the algorithm to other groups by using [[Lagrange's_theorem_s theorem (group_theorygroup theory)|Lagrange's theorem]].
 
:'''Input''' Integers ''p'', ''g'', ''e''.
Line 9:
 
:#Determine the prime factorization of the order of the group (the [[totient]] in this case) : <br><center><math>\varphi(p)= p_1\cdot p_2 \cdots p_n</math></center>
:#From the [[Chinese remainder theorem]] we know that ''x'' = ''a''<sub>1</sub> ''p''<sub>1</sub> + ''b''<sub>1</sub>. We now find the value of ''b<sub>1</sub>'' for which the following equation holds using a fast algorithm such as [[baby-step giant-step]] :<br> <center><math>
\begin{align}e^{\varphi(p)/p_1} & \equiv (g^x)^{\varphi(p)/p_1} \pmod{p} \\
& \equiv (g^{\varphi(p)})^{a_1}g^{b_1\varphi(p)/p_1} \pmod{p} \\