Skip to main content

Python Cryptonight

Project description

# Python CryptoNight implementation

[![Build Status](https://travis-ci.org/ph4r05/py-cryptonight.svg?branch=master)](https://travis-ci.org/ph4r05/py-cryptonight)

Python binding for Monero hash functions `cn_fast_hash`, `cn_slow_hash`.

- `cn_fast_hash` is used mainly for hashing to scalars / EC points.
- `cn_slow_hash` is CryptoNight hash function used for mining and encryption key derivation for encrypted wallet
files.

Py2, Py3 compatible + tests.

## Usage

```python
import binascii
import pycryptonight

pycryptonight.cn_fast_hash(b'1')
# hexcoded: b'c89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc6

pycryptonight.cn_slow_hash(b'1')
# hexcoded: b'cbdfba46388e040422b4a9daa471726be659ae184ee86420c2795647f0b301d5

# variant 1:
pycryptonight.cn_slow_hash(binascii.unhexlify(b'38274c97c45a172cfc97679870422e3a1ab0784960c60514d816271415c306ee3a3ed1a77e31f6a885c3cb'), 1) # variant 1
# hexcoded: b'ed082e49dbd5bbe34a3726a0d1dad981146062b39d36d62c71eb1ed8ab49459b
```

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

py_cryptonight-0.1.0.tar.gz (278.6 kB view details)

Uploaded Source

File details

Details for the file py_cryptonight-0.1.0.tar.gz.

File metadata

  • Download URL: py_cryptonight-0.1.0.tar.gz
  • Upload date:
  • Size: 278.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for py_cryptonight-0.1.0.tar.gz
Algorithm Hash digest
SHA256 b0153944b2da28ca43d65d14bca054ac4a7798341d8fc079e613e517de595fed
MD5 7739a997b96015ea5a7183ff255e387e
BLAKE2b-256 3c5eafbadb5f10fa87e672cfc5fdcc7ecf70d45082b9907933ae261d70bc7405

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