cryptography
cryptography is a package which provides cryptographic recipes and primitives to Python developers.
Decision gist · record as of 2026-08-14
Yes. cryptography is a foundational, actively maintained library with no known vulnerabilities, permissive licensing, and broad platform support. Install friction is moderate but manageable via pre-built wheels. Use it whenever you need to add encryption, hashing, or key management to a Python application—it is the de facto standard for cryptographic operations in Python.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.9+ (excluding 3.9.0 and 3.9.1); compiled dependency cffi must be available or installable on your platform.
- Medium install friction due to compiled dependencies (cffi), but wheels are widely available across platforms and architectures.
- Active maintenance with recent releases; last commit 2026-08-13 and 14 days since latest release indicate steady development.
License · maintenance · safety
Apache-2.0 OR BSD-3-Clause (permissive) — Dual-licensed under Apache-2.0 OR BSD-3-Clause (permissive). Either license permits commercial and private use with minimal restrictions, making the package safe for most projects.
last release 2026-07-31 (14 days) · last repo commit 2026-08-13 · 7,699 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 1,479,413,072 downloads/mo, #11 on PyPI
Alternatives
Verify before relying
pip install cryptography
from cryptography.fernet import Fernet
key = Fernet.generate_key()
f = Fernet(key)
token = f.encrypt(b"secret message")
f.decrypt(token)- Performance characteristics and speed relative to other cryptographic libraries
- Specific cryptographic algorithms and protocols supported beyond the high-level Fernet example
- Hardware acceleration support (e.g., AES-NI) and whether it is automatically detected
What it is and what it does
cryptography is a mature, widely-used Python library that brings cryptographic algorithms and recipes to application developers. It sits between raw OpenSSL bindings and application code, offering both high-level convenience functions (like Fernet for symmetric encryption) and low-level access to algorithms like AES, SHA, PBKDF2, and key exchange primitives. The library wraps compiled cryptographic code via cffi, which means installation requires a working C compiler or pre-built wheels for your platform—wheels are available for most common architectures (x86_64, ARM, PowerPC, Windows, macOS, Linux variants).
The package is designed to be a cryptographic standard library for Python: it handles the complexity of safe key generation, encryption, decryption, and authentication so developers don't have to roll their own. It supports Python 3.9+ and PyPy3, and is actively maintained by the Python Cryptographic Authority (pyca). With no known vulnerabilities and permissive dual licensing, it is production-ready and widely trusted in the ecosystem.
Use it for
- Encrypt and decrypt sensitive data at rest using high-level Fernet symmetric encryption
- Generate and manage cryptographic keys securely for authentication and encryption workflows
- Compute message digests and HMACs for data integrity verification and password hashing
- Implement TLS/SSL certificate handling and key derivation for secure communications
- Build authentication systems that require secure token generation and validation
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
cryptography is a foundational, actively maintained library with no known vulnerabilities, permissive licensing, and broad platform support. Install friction is moderate but manageable via pre-built wheels. Use it whenever you need to add encryption, hashing, or key management to a Python application—it is the de facto standard for cryptographic operations in Python.
Install
cryptography on PyPI
Before you install
Medium install friction due to compiled dependencies (cffi), but wheels are widely available across platforms and architectures. Active maintenance with recent releases; last commit 2026-08-13 and 14 days since latest release indicate steady development.
Requires Python 3.9+ (excluding 3.9.0 and 3.9.1); compiled dependency cffi must be available or installable on your platform.
License in practice
Dual-licensed under Apache-2.0 OR BSD-3-Clause (permissive). Either license permits commercial and private use with minimal restrictions, making the package safe for most projects.
Quickstart
pip install cryptography
from cryptography.fernet import Fernet
key = Fernet.generate_key()
f = Fernet(key)
token = f.encrypt(b"secret message")
f.decrypt(token)
Verify before relying
- Performance characteristics and speed relative to other cryptographic libraries
- Specific cryptographic algorithms and protocols supported beyond the high-level Fernet example
- Hardware acceleration support (e.g., AES-NI) and whether it is automatically detected
Package facts
| License | Apache-2.0 OR BSD-3-Clause permissive |
| Python support | Supports the current Python release !=3.9.0,!=3.9.1,>=3.9 |
| Install friction | Medium. Platform-specific wheel |
| Runtime dependencies | 2 packagescffityping-extensions |
| Maintenance | Actively maintained 14 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 1,479,413,072 / month, #11 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 :: DevelopersNatural Language :: EnglishOperating System :: MacOS :: MacOS XOperating System :: Microsoft :: WindowsOperating System :: POSIXOperating System :: POSIX :: BSDOperating System :: POSIX :: LinuxProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.9Programming Language :: Python :: Free Threading :: 3 - StableProgramming Language :: Python :: Implementation :: CPythonProgramming Language :: Python :: Implementation :: PyPyTopic :: Security :: Cryptography |
Evidence: cryptography-50.0.0-cp311-abi3-macosx_11_0_arm64.whl; cryptography-50.0.0-cp311-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl; cryptography-50.0.0-cp311-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl; cryptography-50.0.0-cp311-abi3-manylinux_2_28_aarch64.whl; cryptography-50.0.0-cp311-abi3-manylinux_2_28_ppc64le.whl; cryptography-50.0.0-cp311-abi3-manylinux_2_28_x86_64.whl; cryptography-50.0.0-cp311-abi3-manylinux_2_31_armv7l.whl; cryptography-50.0.0-cp311-abi3-manylinux_2_34_aarch64.whl; cryptography-50.0.0-cp311-abi3-manylinux_2_34_ppc64le.whl; cryptography-50.0.0-cp311-abi3-manylinux_2_34_x86_64.whl; cryptography-50.0.0-cp311-abi3-musllinux_1_2_aarch64.whl; cryptography-50.0.0-cp311-abi3-musllinux_1_2_x86_64.whl; cryptography-50.0.0-cp311-abi3-win_amd64.whl; cryptography-50.0.0-cp314-cp314t-macosx_11_0_arm64.whl; cryptography-50.0.0-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.whl; cryptography-50.0.0-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.whl; cryptography-50.0.0-cp314-cp314t-manylinux_2_28_aarch64.whl; cryptography-50.0.0-cp314-cp314t-manylinux_2_28_ppc64le.whl; cryptography-50.0.0-cp314-cp314t-manylinux_2_28_x86_64.whl; cryptography-50.0.0-cp314-cp314t-manylinux_2_31_armv7l.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 › “cryptographic primitives python”
- cryptographycryptography provides cryptographic recipes and low-level primitives…
- pycryptodomexPyCryptodomex provides low-level cryptographic primitives including…
- pytoniq-core-forkProvides TON Blockchain SDK primitives for Python 3.7–3.14, including…
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.
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.
Keyring provides safe password and credential storage by interfacing with the system's native credential manager (macOS Keychain, Windows Credential Locker, Freedesktop Secret Service, or KDE KWallet).
Install it if your application needs to store or retrieve passwords securely without managing encryption yourself.
See also django-cryptography-django5 · fernet · tink · django-cryptography · pycryptodomex · django-fernet-fields-v2 · aws-cryptographic-material-providers · django-cryptography-5 · unicrypto · python-olm