Skip to main content

ECPy

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,
                       0xe6b865e529b8ecbf71cf966e900477d49ced5846d7662dd2dd11ccd55c0aff7f,
                       cv))
pv_key = ECPrivateKey(0xfb26a4e75eec75544c0f44e937dcf5ee6355c7176600b9688c667e5c283b43c5,
                  cv)


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

Point sample

from ecpy.curves     import Curve,Point

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

History

1.2.4

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

1.2.3

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

1.2.2

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

1.2.1

Missing README update

1.2.0

Fix rfc6979. Now conform to RFC and fully compat with python-ecdsa (https://github.com/warner/python-ecdsa).

1.1.0

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

1.0.1beta

Merge PR11, fixing an overflow with secp521k1

1.0.0beta

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 setup.py install

From sources

Clone the git repository

Rebuild the tarball

$ python3 setup.py 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

Release files for ECPy 1.2.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ECPy 1.2.4
File Size Uploaded
ECPy-1.2.4.tar.gz 38.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ECPy 1.2.4
File Interpreter ABI Platform
ECPy-1.2.4-py3-none-any.whl Python 3 none any Details

Total release size: 81.5 kB

Release files / ECPy-1.2.4.tar.gz

Download URL ECPy-1.2.4.tar.gz
Size 38.5 kB
Tags Source
SHA-256 checksum
How to use checksums
63677045989f9964309a0e83ecfae4b475eebd4dfb70ab95526a8d77626c6386
BLAKE2b-256 checksum
How to use checksums
8336dfa52250b71c9730660de1123a9bdd5e3e091a5caed6968afeafea219b39
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.6.0 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.8.5

Release files / ECPy-1.2.4-py3-none-any.whl

Download URL ECPy-1.2.4-py3-none-any.whl
Size 43.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0d69ae9424c1875d9ab2163cdbdf91826d5bea5adce6a28b653eb97359330061
BLAKE2b-256 checksum
How to use checksums
0e5215432c8352922723466a13dc15ffe81a0319282352410ae6e75da62836c3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.6.0 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.8.5

Release history Release notifications | RSS feed

1.2.5

2 release files

This release

1.2.4 This release

2 release files

1.2.3

1 release file

1.2.1

1 release file

1.2.0

1 release file

1.1.0

1 release file

1.0.1

1 release file

1.0.0

1 release file

0.10.0

1 release file

0.9.1

1 release file

0.9.0

1 release file

0.8.3

1 release file

0.8.2

1 release file

0.8.1

1 release file

0.8.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page