Skip to main content

Encryption modules applied to NEM.

Project description

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.](test)

Install
------
```commandline
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`

*For windows*
Download [pythonlibs](https://www.lfd.uci.edu/~gohlke/pythonlibs/#gmpy)
`pip install gmpy2‑2.0.8‑cp36‑cp36m‑win_amd64.whl` If you use Python3.6 64bit

Samples1
------
```python
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)
```

Samples2
--------
Import setting at first, and you can select encode mode.
Please look at [allinone.py](test/allinone.py)
```python
from nem_ed25519.base import Encryption
ecc = Encryption()
```

Author
------
[@namuyan_mine](http://twitter.com/namuyan_mine/)

Licence
-------
MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nem_ed25519-0.0.9.tar.gz (6.3 kB view details)

Uploaded Source

File details

Details for the file nem_ed25519-0.0.9.tar.gz.

File metadata

  • Download URL: nem_ed25519-0.0.9.tar.gz
  • Upload date:
  • Size: 6.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.9.1 pkginfo/1.4.1 requests/2.18.4 setuptools/38.4.0 requests-toolbelt/0.8.0 tqdm/4.19.5 CPython/3.6.0

File hashes

Hashes for nem_ed25519-0.0.9.tar.gz
Algorithm Hash digest
SHA256 a1c9749a3c0e62a12521de06c0342d126c0ace87b30ed71a6a1851223d85f512
MD5 a5ede1628682e3830ddf899106dd82c5
BLAKE2b-256 f380c1f738999857820a84cc3cba5c032c4216231c5287ed745d257fd6e5e919

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page