Skip to content
This repository has been archived by the owner on Oct 1, 2020. It is now read-only.

namuyan/nem-ed25519

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

nem-ed25519

NEM implementation ed26619 encryption modules for Python.
NEM use Keccak hash function, not same SHA3.

Require

Python3 (>=3.5)

how to use

Please look test codes folder.

Install

pip install nem-ed25519
 or
pip install git+https://github.com/namuyan/nem-ed25519.git

This version need GMP.
For Linux

apt-get install python3-gmpy2 libgmp3-dev libmpc-dev
apt install libmpfr-dev
pip install gmpy2

For windows
Download pythonlibs
pip install gmpy2‑2.0.8‑cp36‑cp36m‑win_amd64.whl If you use Python3.6 64bit

Samples1

from nem_ed25519.key import secret_key, public_key, get_address
# secret key
sk = secret_key()
# public key
pk = public_key(sk)
# compressed key
ck = get_address(pk, main_net=True)
 
from nem_ed25519.signature import sign, verify
# sign message
sign = sign(msg=b'hello world', sk=sk, pk=pk)
# verify message
verify(msg=b'hello world', sign=sign, pk=pk)
 
from nem_ed25519.encrypt import encrypt, decrypt
# encrypt/decrypt message
sk1 = secret_key()
pk1 = public_key(sk1)
enc = encrypt(sk=sk, pk=pk1, msg=b'Hot potato.')
dec = decrypt(sk=sk1, pk=pk, enc=enc)

bench

branch name master pure rust-ver
address generate 5.8mS 98.2mS 0.045mS
sign/verify 3.211mS 34mS 0.13mS
encrypt/decrypt 2.92mS 20mS 0.246mS

Author

@namuyan_mine

Licence

MIT

About

NEM encryption lib.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages