Pyodide-compatible ctypes interface for libsodium. This is a refactored pysodium wheel designed specifically for WebAssembly environments.
import micropip
await micropip.install("pychloride")pip install pychlorideimport 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)- Bundles a WebAssembly-compiled
libsodium.sofor use in Pyodide - Includes explicit
argtypesdefinitions for ctypes WASM compatibility - Loads libsodium from the package directory instead of system paths
The version follows the pattern X.Y.Z.P where:
X.Y.Zis the upstream pysodium versionPis the pychloride patch version
Based on pysodium by Stefan Marsiske.
BSD 2-Clause License (same as original pysodium). Third-party notices for the
bundled libsodium binary are in THIRD_PARTY_LICENSES.md.