django-cryptography-5
Easily encrypt data in Django
What it is and what it does
django-cryptography-5 is a fork of the abandoned django-cryptography project, updated to support Django 5. It wraps the cryptography library to add transparent encryption to Django model fields, allowing you to mark sensitive database columns for automatic encryption and decryption without changing application logic.
The package provides an `encrypt()` wrapper that converts any Django model field into an encrypted variant. Data is encrypted before storage and decrypted on retrieval, using symmetric encryption that preserves bi-directional data access. It also offers a drop-in replacement for Django's own cryptographic primitives, using cryptography as the backend. The fork exists because the original project is no longer maintained; this version applies the Django 5 compatibility patch and publishes it to PyPI.
Use it for:
- Encrypt personally identifiable information (PII) like email, phone, or SSN in Django models without application-level changes.
- Protect sensitive business data in database fields while maintaining query functionality.
- Replace Django's default cryptographic backend with the more modern cryptography library for new projects.
- Add field-level encryption to legacy Django applications without restructuring models.
- Ensure compliance with data protection regulations by encrypting sensitive fields at rest.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Provides encrypted model fields and cryptographic utilities for Django, wrapping the cryptography library to enable transparent encryption of sensitive database fields.
Yes, with conditions. The package solves a real problem—transparent field encryption in Django—and is actively maintained as a fork to support current Django versions. However, the original project's abandonment and the fork's dormant status (563 days since release, 17 stars) suggest limited community adoption and ongoing maintenance uncertainty. Install if you need Django 5 compatibility and transparent field encryption; verify that the fork will receive updates if you require long-term support.
Install
django-cryptography-5 on PyPI
pip
pip install django-cryptography-5uv
uv add django-cryptography-5poetry
poetry add django-cryptography-5Installing django-cryptography-5
Before you install
Low install friction with a pure-Python wheel. Marked dormant with last commit on 2025-01-28, but this is a maintained fork addressing Django 5 compatibility after the original project was abandoned. Depends on stable, widely-used packages: Django, cryptography, django-appconf, and typing-extensions.
License in practice
BSD-3-Clause is permissive and poses no restriction on commercial or proprietary use. You may use, modify, and distribute this package with minimal legal friction.
Quickstart
pip install django-cryptography-5
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, 5.0, or 5.1 and Python 3.7 or later; cryptography 2.0+.
Verify before relying
- Whether the fork is actively maintained beyond the initial Django 5 compatibility patch.
- Performance impact of transparent field-level encryption on query operations.
- Whether encrypted fields support Django ORM filtering and lookups.
Package facts
| License | BSD-3-Clause (permissive) |
| Python support | supports the current Python release (>=3.7) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 4 — Django, cryptography, django-appconf, typing-extensions |
| Maintenance | dormant — 563 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 124,198/month — #11,881 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: django_cryptography_5-2.0.3-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
django-cryptography-django5Encrypts and decrypts data in Django models…
permissive · top 15,000 on PyPI
django-encrypted-model-fieldsWraps Django model fields with transparent…
permissive · top 15,000 on PyPI
django-cryptographyWraps Python's cryptography library to add…
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
django-safedeleteProvides soft-delete functionality for Django…
permissive · top 5,000 on PyPI
cryptographycryptography provides cryptographic recipes and…
permissive · top 100 on PyPI
tensealTenSEAL performs homomorphic encryption…
permissive · top 15,000 on PyPI
cryptoProvides command-line tools to encrypt and…
permissive · top 5,000 on PyPI