Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/david-r-cox/pydlp
Python implementation of the index calculus method for solving discrete logarithm problems
https://github.com/david-r-cox/pydlp
Last synced: about 2 months ago
JSON representation
Python implementation of the index calculus method for solving discrete logarithm problems
- Host: GitHub
- URL: https://github.com/david-r-cox/pydlp
- Owner: david-r-cox
- Created: 2016-11-08T19:38:49.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2020-03-17T15:56:55.000Z (almost 5 years ago)
- Last Synced: 2023-10-20T00:39:08.219Z (about 1 year ago)
- Language: Python
- Size: 5.86 KB
- Stars: 19
- Watchers: 4
- Forks: 4
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# pyDLP
Python implementation of the index calculus method for solving discrete logarithms.## About
[Index calculus](https://en.wikipedia.org/wiki/Index_calculus_algorithm) is a probabilistic method for solving [discrete logarithm](https://en.wikipedia.org/wiki/Discrete_logarithm) problems. As of this writing, there do not appear to be many implementations of index calculus. Hopefully this can serve as a useful reference.## Setup
This script requires that [SageMath](https://www.sagemath.org/) be installed to solve the system of linear equations. The `primefac` module is also required and can be installed with `pip install -r ./requirements.txt`## Usage
```
$ python2.7 ./pyDLP.py
p: 18443, g: 37, h: 211, B: 5
searching for congruences.
congruences: 6
bases: 3
converting to matrix format.
solving linear system with sage:
sage done.
checking congruences: Passed!checking dlog exponents:
37^5733 = 2 (mod 18443)
37^15750 = 3 (mod 18443)
37^6277 = 5 (mod 18443)
Passed!searching for k such that h*g^-k is B-smooth.
found k = 13999
Solving the main dlog problem:37^8500 = 211 (mod 18443) holds!
DLP solution: 8500
```