django-cryptography-django5
Easily encrypt data in Django - Fork for Django 5 support
What it is and what it does
Django Cryptography wraps the Python cryptography library to add transparent encryption to Django model fields. It lets you mark a field with the encrypt() wrapper, and data is automatically encrypted when saved to the database and decrypted on retrieval—no manual key management in your application code. The package also offers a drop-in replacement for Django's built-in cryptographic primitives, delegating to cryptography as the backend.
The package supports Django 3.2 through 5.0 and Python 3.8–3.12. It depends on Django, cryptography, and django-appconf for configuration. The implementation uses symmetric encryption for bi-directional data access, meaning you can encrypt and decrypt the same field value. However, the project is dormant as of June 2024 with no recent commits, though it remains unarchived and has no known security vulnerabilities.
Use it for:
- Store personally identifiable information (PII) like email addresses or phone numbers encrypted at rest in a Django database.
- Protect sensitive business data such as API keys or payment tokens in model fields without application-level encryption logic.
- Replace Django's default cryptographic backend with cryptography library's implementation for stronger or more modern algorithms.
- Encrypt user-submitted form data before persisting it to the database in a Django application.
- Comply with data protection regulations by encrypting regulated fields automatically on save.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Encrypts and decrypts data in Django models using the cryptography library, providing a drop-in replacement for Django's own cryptographic primitives with symmetric encryption for database fields.
Yes, with caution. The package is straightforward to install and use, has no known vulnerabilities, and solves a real problem—transparent field-level encryption in Django. However, its Pre-Alpha status and dormant maintenance (no commits since June 2024) mean you should verify it works with your exact Django and Python versions before committing to production. It is suitable for new projects or low-risk deployments where you can tolerate a lack of active support.
Install
django-cryptography-django5 on PyPI
pip
pip install django-cryptography-django5uv
uv add django-cryptography-django5poetry
poetry add django-cryptography-django5Installing django-cryptography-django5
Before you install
Low install friction with a pure-Python wheel. Maintenance is dormant—last release was 2024-06-04 with no commits since then—but the package is not archived and carries no known vulnerabilities.
License in practice
BSD-3-Clause is permissive; you may use, modify, and distribute this package freely in commercial or private projects provided you include the license text and do not claim authorship.
Quickstart
pip install django-cryptography-django5
from django.db import models
from django_cryptography.fields import encrypt
class MyModel(models.Model):
sensitive_data = encrypt(models.CharField(max_length=50))
Requires Django 3.2, 4.1, 4.2, or 5.0 and cryptography 2.0 or later; Python 3.8 or higher.
Verify before relying
- Whether the package's Pre-Alpha status reflects active development or abandoned state.
- Whether bi-directional encryption supports queryable lookups or only full-field retrieval.
- Performance characteristics when encrypting large text fields or many records.
Package facts
| License | BSD-3-Clause (permissive) |
| Python support | supports the current Python release (>=3.8) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 3 — Django, cryptography, django-appconf |
| Maintenance | dormant — 801 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 500,289/month — #6,322 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: django_cryptography_django5-2.2-py2.py3-none-any.whl
Tags
More WWW/HTTP packages
urllib3 is an HTTP client library that provides…
permissive · top 100 on PyPI
requestsRequests is a Python HTTP library that…
permissive · top 100 on PyPI
h11h11 is a pure-Python HTTP/1.1 protocol…
permissive · top 100 on PyPI
httpxHTTPX is a fully featured HTTP client library…
permissive · top 100 on PyPI
httpcoreA minimal low-level HTTP client library that…
permissive · top 100 on PyPI
aiohttpaiohttp is an async HTTP client and server…
permissive · top 100 on PyPI
cryptographycryptography provides cryptographic recipes and…
permissive · top 100 on PyPI
django-cryptographyWraps Python's cryptography library to add…
permissive · top 15,000 on PyPI
django-cryptography-5Provides encrypted model fields and…
permissive · top 15,000 on PyPI
django-encrypted-model-fieldsWraps Django model fields with transparent…
permissive · top 15,000 on PyPI
django-fernet-fields-v2Provides Fernet symmetric encryption for Django…
permissive · top 5,000 on PyPI
django-fernet-encrypted-fieldsProvides Django model fields that encrypt data…
unclear · top 15,000 on PyPI
djfernetProvides Fernet symmetric encryption for Django…
permissive · top 15,000 on PyPI
dynamodb-encryption-sdkEncrypts and decrypts DynamoDB items…
permissive · top 15,000 on PyPI
fernetA pure Python implementation of the Fernet…
permissive · top 15,000 on PyPI
http-eceImplements encrypted content encoding for HTTP…
permissive · top 5,000 on PyPI