Pohlig-Hellman and BSGS implemented in Python.