https://github.com/epicchainlabs/epicchain-native-cryptographic
The Native EpicChain Cryptographic Functions for Python is a library that provides developers with a set of native Python functions for cryptographic operations specific to the EpicChain blockchain.
https://github.com/epicchainlabs/epicchain-native-cryptographic
blockchain-cryptography blockchain-security crypto-operations cryptographic-functions decentralized-security epicchain-crypto-python epicchain-integration epicchain-security python-blockchain-dev python-library
Last synced: about 1 year ago
JSON representation
The Native EpicChain Cryptographic Functions for Python is a library that provides developers with a set of native Python functions for cryptographic operations specific to the EpicChain blockchain.
- Host: GitHub
- URL: https://github.com/epicchainlabs/epicchain-native-cryptographic
- Owner: epicchainlabs
- License: other
- Created: 2024-04-04T19:23:48.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-04-04T19:27:13.000Z (about 2 years ago)
- Last Synced: 2024-12-21T09:17:06.961Z (over 1 year ago)
- Topics: blockchain-cryptography, blockchain-security, crypto-operations, cryptographic-functions, decentralized-security, epicchain-crypto-python, epicchain-integration, epicchain-security, python-blockchain-dev, python-library
- Language: C++
- Homepage:
- Size: 9.77 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.rst
- License: LICENSE.txt
Awesome Lists containing this project
README
EpicChainVM
------
C++ implementations of cryptographic functions used in the EpicChain Blockchain with bindings for Python 3.10 & 3.11.
The current version supports `mmh3` and EllipticCurve functions by wrapping (part of `smhasher `_ and `micro-ecc `_)
and exposing helper classes. ``SECP256R1`` (a.k.a ``NIST256P``) and ``SECP256K1`` are the only curves exposed, but others can easily
be enabled if needed.
Installation
~~~~~~~~~~~~
::
pip install EpicChaincrypto
Or download the wheels from the Github releases page.
Windows users
=============
If installing fails with the error ``No Matching distribution found`` then upgrade your Python installation to use the latest post release version (i.e. ``3.10.8`` instead of ``3.10.0``)
Usage
~~~~~
::
import hashlib
import os
from epicchaincrypto import ECCCurve, ECPoint, sign, verify, mmh3_hash_bytes, mmh3_hash
curve = ECCCurve.SECP256R1
private_key = os.urandom(32)
public_key = ECPoint(private_key, curve)
signature = sign(private_key, b'message', curve, hashlib.sha256)
assert verify(signature, b'message', public_key, hashlib.sha256) == True
assert mmh3_hash("foo", signed=False) == 4138058784
assert bytes.fromhex("0bc59d0ad25fde2982ed65af61227a0e") == mmh3_hash_bytes("hello", 123)
Any hashlib hashing function can be used. Further documentation on the classes can be queried from the extension module
using ``help(epicchaincrypto)``.
Building wheels
~~~~~~~~~~~~~~~
Make sure to have ``wheel`` and ``CMake`` installed. Then call ``python setup.py bdist_wheel``.