Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/netesf13d/py-ecc
Python implementation of elliptic curve cryptography
https://github.com/netesf13d/py-ecc
cryptanalysis cryptography elliptic-curve-cryptography
Last synced: 6 days ago
JSON representation
Python implementation of elliptic curve cryptography
- Host: GitHub
- URL: https://github.com/netesf13d/py-ecc
- Owner: netesf13d
- License: gpl-3.0
- Created: 2024-04-15T15:41:52.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2024-10-21T21:29:05.000Z (27 days ago)
- Last Synced: 2024-10-22T17:03:25.602Z (26 days ago)
- Topics: cryptanalysis, cryptography, elliptic-curve-cryptography
- Language: Python
- Homepage:
- Size: 75.2 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# py-ecc
Python implementation of elliptic curve cryptography primitives, elliptic curve algebra, and some cryptanalysis algorithms. It is intended for educational purposes, and the implementation aims to expose as much as possible the components to experiment with them. The jupyter notebook _ecc_examples.ipynb_ illustrates the use of the package.
## Overview
The package provides:
* Elliptic curve cryptography algorithms
- Elliptic Curve Digital Signature Algorithm (ECDSA)
- Edwards Curve Digital Signature Algorithm (EdDSA)
- Elliptic Curve Diffie-Hellman (ECDH) key exchange
* Elliptic curve algebra with different forms of curves
- Weierstrass curves (the canonical form)
- Montgomery curves
- (twisted) Edwards curves
* Some cryptanalysis algorithms
- Attacks on the discrete logarithm problem
- Partially known nonces attack on ECDSAHowever, this package does NOT provide:
* A fast and secure implementation of the algorithms and elliptic curve algebra.
* Support for elliptic curves over finite fields $\mathrm{F}_q$ with non-prime $q$ (eg $q = 2^m$).
* Random key generation for the various protocols.## Dependencies
Apart from the `cryptanalysis` module, the package uses only the standard
library. Third party packages are necessary to run cryptanalysis algoritms:
- [numpy](https://numpy.org/)
- [sympy](https://www.sympy.org/) (for integer factorization)
- [python-flint](https://pypi.org/project/python-flint/) (for LLL reduction)## Notes
The typing annotations in the code are by no means rigorous. They are made to facilitate the understanding of the nature of various parameters.
## References
* [_SEC 1: Elliptic Curve Cryptography_](https://www.secg.org/sec1-v2.pdf)
* [_SEC 2: Recommended Elliptic Curve Domain Parameters_](https://www.secg.org/sec2-v2.pdf)
* [RFC 6090](https://www.rfc-editor.org/rfc/rfc6090) _Fundamental Elliptic Curve Cryptography Algorithms_
* [RFC 6979](https://www.rfc-editor.org/rfc/rfc6979) _Deterministic Usage of the Digital Signature Algorithm (DSA) and Elliptic Curve Digital Signature Algorithm (ECDSA)_
* [RFC 7748](https://www.rfc-editor.org/rfc/7748) _Elliptic Curves for Security_
* [RFC 8032](https://www.rfc-editor.org/rfc/rfc8032) _Edwards-Curve Digital Signature Algorithm (EdDSA)_
* [https://safecurves.cr.yp.to/](https://safecurves.cr.yp.to/) ; detailed info about the security of ECC