Skip to main content

Pure Pyhton Elliptic Curve Library

Project description


ECPy (pronounced ekpy), is a pure python Elliptic Curve library providing ECDSA, EDDSA (Ed25519), ECSchnorr, Borromean signatures as well as Point operations.

Full html documentation is available here.

ECDSA sample

from ecpy.curves     import Curve,Point
from ecpy.keys       import ECPublicKey, ECPrivateKey
from ecpy.ecdsa      import ECDSA

cv   = Curve.get_curve('secp256k1')
pu_key = ECPublicKey(Point(0x65d5b8bf9ab1801c9f168d4815994ad35f1dcb6ae6c7a1a303966b677b813b00,
pv_key = ECPrivateKey(0xfb26a4e75eec75544c0f44e937dcf5ee6355c7176600b9688c667e5c283b43c5,

signer = ECDSA()
sig    = signer.sign(b'01234567890123456789012345678912',pv_key)

Point sample

from ecpy.curves     import Curve,Point

cv = Curve.get_curve('secp256k1')
P  = Point(0x65d5b8bf9ab1801c9f168d4815994ad35f1dcb6ae6c7a1a303966b677b813b00,
k  = 0xfb26a4e75eec75544c0f44e937dcf5ee6355c7176600b9688c667e5c283b43c5
Q  = k*P
R  = P+Q



Fix issue 19


Fix ECDSA when mesaage hash length is greater than domain order length

Move from distutils to setuptools


Fix ECSchnorr when r is greater than order. Main use case is when using a hash function with bitlength greater than curve size.


Fix ECDSA with rfc6979. Field was used instead of order for max random.


Missing README update


Fix rfc6979. Now conform to RFC and fully compat with python-ecdsa (


Fix DER encoding for length greater than 128

Declare ONE infinity point per curve. Consider global (non attached to a curve) infinity point as deprecated

Fix infinity point management in ECDSA

Fix issue #13


Merge PR11, fixing an overflow with secp521k1


Initial 1.x series (Beta)

Quick Install

From Pypi

$ pip install ECPy

From Github

From tarball dist

Download last dist tarball.

Untar it

$ tar xzvf ECPy-M.m.tar.gz

install it (or use it as is…)

$ python3 install

From sources

Clone the git repository

Rebuild the tarball

$ python3 sdist

Continue with the created tarball dist.

Generate the documentation

You can regenerate the doc from git clone

$ cd doc
$ make singlehtml

Documentation is in build dir

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ECPy-1.2.5.tar.gz (38.5 kB view hashes)

Uploaded Source

Built Distribution

ECPy-1.2.5-py3-none-any.whl (43.1 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page