Registry / auth-security / starkbank-ecdsa

starkbank-ecdsa

JSON →
library2.3.1pypypi✓ verified 24d ago

StarkBank ECDSA is a lightweight and fast pure Python library for Elliptic Curve Digital Signature Algorithm (ECDSA). As of version 2.2.0, it provides tools for generating private/public keys, signing data, and verifying signatures. The library maintains a steady release cadence, with several updates per year.

pip install starkbank-ecdsa
INSTALL
IMPORT
SIG · STARKBANK-ECDSA
S
starkbank-ecdsa
auth-securitypythonv2.3.1
Install
1.6s avg
Import
19ms
Disk
16MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v2.3.1 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.020s · 18MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 1.6s · import 0.018s · 18MB
16MB installed
● package 16MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

PrivateKey
from ellipticcurve import PrivateKey
from starkbank_ecdsa import PrivateKey
PublicKey
from ellipticcurve import PublicKey
Ecdsa
from ellipticcurve import Ecdsa

This quickstart demonstrates how to generate ECDSA private and public keys, sign a 32-byte message hash, and verify the resulting signature using `starkbank-ecdsa`.

import hashlib from starkbank_ecdsa import PrivateKey, PublicKey, Ecdsa # 1. Generate a new private key private_key = PrivateKey.generate() print(f"Private Key: {private_key.toPem().decode().strip()}") # 2. Get the corresponding public key public_key = private_key.public_key() print(f"Public Key: {public_key.toPem().decode().strip()}") # 3. Data to sign (must be a 32-byte hash) message = "This is a test message for ECDSA signing and verification." message_hash = hashlib.sha256(message.encode()).digest() print(f"Message hash (bytes): {message_hash.hex()}") # 4. Sign the message hash signature = Ecdsa.sign(message_hash, private_key) print(f"Signature (hex): {signature.toHex()}") # 5. Verify the signature is_valid = Ecdsa.verify(message_hash, signature, public_key) print(f"Signature is valid: {is_valid}") # Example of invalid signature (tampered message) invalid_message_hash = hashlib.sha256(b"tampered message").digest() is_invalid = Ecdsa.verify(invalid_message_hash, signature, public_key) print(f"Signature with tampered message is valid: {is_invalid}")
Debug
Known issues
breakingThe PyPI package name changed from `ecdsa` to `starkbank-ecdsa` starting with version 2.0.0. Installations and imports must be updated.
fix
Update your `requirements.txt` or `pyproject.toml` to `starkbank-ecdsa` and change all imports from `from ecdsa import ...` to `from starkbank_ecdsa import ...`.
affects: >=2.0.0
gotchaThe library primarily targets and is optimized for the `secp256k1` elliptic curve. While other curves might technically be supported via explicit `Curve` object instantiation, `PrivateKey.generate()` defaults to `secp256k1`. Users requiring different curves should verify compatibility and usage carefully.
fix
If you need a different curve, ensure you are explicitly instantiating it (e.g., `private_key = PrivateKey.generate(curve=MyCustomCurve)`), but note that support for curves beyond `secp256k1` is not prominently featured or extensively tested.
affects: All versions
gotchaThis is a pure Python implementation of ECDSA. For highly performance-critical applications or scenarios requiring FIPS compliance, consider alternatives that utilize C extensions (e.g., `cryptography` library) which can offer significant speed advantages and certified implementations.
fix
Evaluate performance needs. For most standard applications, `starkbank-ecdsa` is sufficient. For extreme throughput, benchmark against `cryptography`'s ECDSA features.
affects: All versions
Upgrade
Version history
2.3.1latest on PyPI · released Apr 23, 2026
Audit
Dependencies

No dependency data recorded yet.

Agent activity
50 hits · last 30 days
node
44
Bingbot
1
OpenAI (training)
1
Resources
starkbank-ecdsa — pip install starkbank-ecdsa · libregistry