Registry / auth-security / eciespy

eciespy

JSON →
library0.4.6pypypi✓ verified 88d ago

Elliptic Curve Integrated Encryption Scheme (ECIES) for secp256k1 and curve25519 in Python. Current version 0.4.6, supports Python >=3.9. Active development with multi-curve support and custom key pair generation.

pip install eciespy
INSTALL
IMPORT
SIG · ECIESPY
E
eciespy
auth-securitypythonv0.4.6
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

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

encrypt
✓ from ecies import encrypt
✗ from eciespy import encrypt
eciespy is the package name but the module is ecies
decrypt
✓ from ecies import decrypt
✗ from eciespy import decrypt
Same as encrypt, use ecies module

Basic encrypt/decrypt with secp256k1 keys.

import os from ecies import encrypt, decrypt # Generate a private key (hex) private_key = os.urandom(32).hex() # Derive public key (hex, uncompressed) # ecies can also use Ethereum-style keys # For quickstart, we use a known key pair: privkey = '0x0000000000000000000000000000000000000000000000000000000000000001' pubkey = '0x79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798' # Encrypt plaintext = b'Hello, ECIES!' ciphertext = encrypt(pubkey, plaintext) # Decrypt assert decrypt(privkey, ciphertext) == plaintext print('Success!')
Debug
Known issues
breakingIn v0.4.5, functions in ecies.utils are deprecated and will be removed after v0.5.0. Use ecies.keys or ecies.consts instead.
fix
Replace ecies.utils.xxx with new API from ecies.keys or ecies.consts.
affects: >=0.4.5
deprecatedThe eth-keys dependency is optional since v0.4.4 and will be removed eventually. Ethereum-style keys may stop working.
fix
Switch to homemade key pairs via ecies.keys.HomemadeKey or use the built-in key generation.
affects: >=0.4.4
gotchaKeys must be hex strings with or without '0x' prefix. Encryption expects uncompressed public key (130 hex chars with '04' prefix) or compressed (66 hex chars).
fix
Ensure public key is valid uncompressed '04' + 64 bytes or compressed '02'/'03' + 32 bytes.
affects: all
Errors
Common errors & fixes
ImportError: cannot import name 'encrypt' from 'eciespy'
Wrong import path; the package is 'eciespy' but the module is 'ecies'.
fix
Use 'from ecies import encrypt, decrypt' instead of 'eciespy'.
ValueError: Public key format is not correct
Public key not in valid hex, or missing '04' prefix for uncompressed key.
fix
Ensure public key is hex (130 or 66 characters) and starts with '04' for uncompressed.
AttributeError: module 'ecies.utils' has no attribute 'generate_key_pair'
Function was deprecated and moved in v0.4.5.
fix
Use 'from ecies.keys import generate_key_pair' or HomemadeKey.
Upgrade
Version history
0.4.6latest on PyPI · released Jul 21, 2025
Audit
Dependencies

No dependency data recorded yet.

Agent activity
29 hits · last 30 days
node
27
OpenAI (training)
1
Resources
eciespy — pip install eciespy · libregistry