Skip to main content

IndDem

Shanks Discrete Logarithm Demonstration

Solve gx≡a(modp)g^x\equiv a\pmod p using baby steps and giant steps

Shanks’ method

We seek ii and jj such that gis+j≡a(modp)g^{is+j}\equiv a\pmod p.
  1. 1Find hh such that gh≡1(modp)gh\equiv1\pmod p.
  2. 2Construct and sort the values ahj(modp)ah^j\pmod p for 0≤j<s0\leq j<s.
  3. 3Search the table for successive values gis(modp)g^{is}\pmod p.
  4. 4A match gives ind⁡ga=is+j\operatorname{ind}_g a=is+j.