Skip to main content

Python binding to the Monocypher library

Project description

monocypher-py

Build Status codecov Documentation Status

Python bindings for Monocypher 3.1.0 using the cffi library. Monocypher is a small, fast, easy to deploy, and easy to use cryptography library. monocypher-py provides both high- (a-la PyNaCl) and low-level APIs around Monocypher. There is no aim for drop-down compatibility with PyNaCl (especially since Monocypher uses different primitives compared to NaCl).

high-level api

>>> from monocypher.public import PrivateKey, Box
>>> sk_a = PrivateKey.generate()
>>> sk_b = PrivateKey.generate()
>>> box = Box(sk_a, sk_b.public_key)
>>> box.encrypt(b'hello world!')
b'\xdbZn...'

low-level api

>>> import monocypher.bindings as mc
>>> sk_a_bytes = sk_a.encode()
>>> pk_b_bytes = sk_b.public_key.encode()
>>> shared_key = mc.crypto_key_exchange(sk_a_bytes, pk_b_bytes)
>>> box.shared_key() == shared_key
True

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

monocypher-py-0.0.3.tar.gz (56.5 kB view details)

Uploaded Source

File details

Details for the file monocypher-py-0.0.3.tar.gz.

File metadata

  • Download URL: monocypher-py-0.0.3.tar.gz
  • Upload date:
  • Size: 56.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.4

File hashes

Hashes for monocypher-py-0.0.3.tar.gz
Algorithm Hash digest
SHA256 9f1da74704ade57be8f1f93c75526342b0c4515a9548a388cc2f6ddc62ac94a3
MD5 21ebaf76c43932007ca4979a32b57185
BLAKE2b-256 ad9ab8981f6f6ea67b448c3d19e3d4b5f3f12209cafd5725520726236c527d17

See more details on using hashes here.

Provenance

Supported by

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