Skip to main content

IndDem

Shanks Discrete Logarithm Demonstration

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

Shanks’ method

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