Skip to content

Pyodide compatible ctypes interface for libsodium. Refactored pysodium wheel.

License

Notifications You must be signed in to change notification settings

WebOfTrust/pychloride

Repository files navigation

pychloride

Pyodide-compatible ctypes interface for libsodium. This is a refactored pysodium wheel designed specifically for WebAssembly environments.

Installation

For Pyodide/PyScript

import micropip
await micropip.install("pychloride")

For standard Python (if you have libsodium installed)

pip install pychloride

Usage

import pychloride

# Generate a keypair
pk, sk = pychloride.crypto_box_keypair()

# Sign a message
sign_pk, sign_sk = pychloride.crypto_sign_keypair()
signature = pychloride.crypto_sign_detached(b"Hello World", sign_sk)

Differences from pysodium

  • Bundles a WebAssembly-compiled libsodium.so for use in Pyodide
  • Includes explicit argtypes definitions for ctypes WASM compatibility
  • Loads libsodium from the package directory instead of system paths

Versioning

The version follows the pattern X.Y.Z.P where:

  • X.Y.Z is the upstream pysodium version
  • P is the pychloride patch version

Credits

Based on pysodium by Stefan Marsiske.

License

BSD 2-Clause License (same as original pysodium). Third-party notices for the bundled libsodium binary are in THIRD_PARTY_LICENSES.md.

About

Pyodide compatible ctypes interface for libsodium. Refactored pysodium wheel.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages