libnacl
Python bindings for libsodium based on ctypes
Decision gist · record as of 2026-08-14
Yes, if you need NaCl cryptography and libsodium is already available on your system. The package is stable, has no Python dependencies, and offers both low-level and high-level APIs. However, the aging maintenance status (last release 2023, infrequent commits) means you should verify that libsodium availability and the package's feature set meet your needs before adopting it for new projects; consider whether a more actively maintained alternative better suits your timeline.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- libsodium must be installed and available on your system; libnacl is a ctypes wrapper and does not bundle or compile the underlying C library.
- Low friction install with no Python runtime dependencies; the package requires libsodium to be available on the system but does not compile itself.
- Last release was in 2023, and the repository remains active with a recent commit in 2026, though the project is aging without frequent updates.
License · maintenance · safety
Apache-2.0 (permissive) — Apache-2.0 is a permissive license that allows commercial use, modification, and distribution with minimal restrictions; you may use this package in proprietary projects provided you include a copy of the license.
last release 2023-08-06 (1104 days) · last repo commit 2026-01-13 · 84 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 231,587 downloads/mo, #9,083 on PyPI
Alternatives
Verify before relying
pip install libnacl
import libnacl
import libnacl.utils
# Generate a keypair for public-key encryption
pk, sk = libnacl.utils.salsa_key()
# Or use high-level classes
from libnacl.public import SecretKey
secret_key = SecretKey()- Whether libsodium is typically pre-installed on major OS distributions or requires separate installation steps.
- Current maintenance cadence and whether the aging status reflects intentional stability or lack of active development.
- Performance characteristics compared to other libsodium bindings for Python.
What it is and what it does
Libnacl is a Python wrapper around libsodium (Daniel J. Bernstein's NaCl cryptography library) that exposes both low-level ctypes bindings and high-level Pythonic encryption classes. It provides authenticated encryption, digital signatures, key exchange, and other cryptographic primitives without requiring compilation of the binding itself—only libsodium must be present on the system.
The package is designed for portability and ease of distribution; a single binding file can be embedded directly into projects. It supports Python 3.4 through 3.11 and is classified as production-stable. The library has no Python runtime dependencies, making it lightweight to install, though you must have libsodium available as a system library.
Use it for
- Building encrypted messaging systems with authenticated encryption (SecretBox) for confidentiality and integrity.
- Implementing digital signature verification for message authentication and non-repudiation.
- Establishing secure key exchange between parties using public-key cryptography primitives.
- Embedding cryptographic bindings directly into standalone Python applications without external package dependencies.
- Prototyping or deploying cryptographic protocols that require low-level access to NaCl functions.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you need NaCl cryptography and libsodium is already available on your system.
The package is stable, has no Python dependencies, and offers both low-level and high-level APIs. However, the aging maintenance status (last release 2023, infrequent commits) means you should verify that libsodium availability and the package's feature set meet your needs before adopting it for new projects; consider whether a more actively maintained alternative better suits your timeline.
Install
libnacl on PyPI
Before you install
Low friction install with no Python runtime dependencies; the package requires libsodium to be available on the system but does not compile itself. Last release was in 2023, and the repository remains active with a recent commit in 2026, though the project is aging without frequent updates.
libsodium must be installed and available on your system; libnacl is a ctypes wrapper and does not bundle or compile the underlying C library.
License in practice
Apache-2.0 is a permissive license that allows commercial use, modification, and distribution with minimal restrictions; you may use this package in proprietary projects provided you include a copy of the license.
Quickstart
pip install libnacl
import libnacl
import libnacl.utils
# Generate a keypair for public-key encryption
pk, sk = libnacl.utils.salsa_key()
# Or use high-level classes
from libnacl.public import SecretKey
secret_key = SecretKey()
Verify before relying
- Whether libsodium is typically pre-installed on major OS distributions or requires separate installation steps.
- Current maintenance cadence and whether the aging status reflects intentional stability or lack of active development.
- Performance characteristics compared to other libsodium bindings for Python.
Package facts
| License | Apache-2.0 permissive |
| Python support | Supports the current Python release >=3.4,<4.0 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | None |
| Maintenance | Aging 1,104 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 231,587 / month, #9,083 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: Apache Software LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 2.6Programming Language :: Python :: 2.7Programming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.4Programming Language :: Python :: 3.5Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: Security :: Cryptography |
Evidence: libnacl-2.1.0-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “libsodium python bindings”
- libnaclPython bindings to libsodium's NaCl cryptography library, providing…
- PyNaClPyNaCl provides Python bindings to libsodium for digital signatures,…
- pysodiumPysodium is a Python wrapper around libsodium that provides access to…
Give your agent the search over MCP, or paste the wish link into any chat.
More Cryptography packages
Certifi provides Mozilla's curated collection of root SSL certificates for Python applications to validate TLS hosts and verify certificate trustworthiness.
cryptography provides cryptographic recipes and low-level primitives for symmetric encryption, message digests, key derivation, and other common cryptographic algorithms in Python.
Pure-Python RSA encryption, decryption, signing, and key generation following PKCS#1 v1.5, with command-line and library interfaces.
pyOpenSSL wraps OpenSSL's SSL/TLS functionality for Python, providing high-level connection objects and certificate handling through a Python-friendly interface around OpenSSL's cryptographic operations.
Provides Microsoft Entra ID token-based authentication for Azure SDK clients through a set of TokenCredential implementations that handle OAuth flows and managed identity support.
PyNaCl provides Python bindings to libsodium for digital signatures, secret-key and public-key encryption, hashing, message authentication, and password-based key derivation.
See also pysodium · pure25519 · securesystemslib · endesive · fernet · gmssl · PGPy13 · libthumbor