skillfed

django-cryptography-5

Easily encrypt data in Django

django-cryptography-5 v2.0.3 124.2K downloads/30d#11,881 on PyPI17
Permissive license BSD-3-Clause DORMANT released

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-5

uv

uv add django-cryptography-5

poetry

poetry add django-cryptography-5

Installing 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

Development Status :: 2 - Pre-AlphaEnvironment :: Web EnvironmentFramework :: DjangoFramework :: Django :: 2.2Framework :: Django :: 3.2Framework :: Django :: 4.0Framework :: Django :: 4.1Framework :: Django :: 4.2Framework :: Django :: 5.0Framework :: Django :: 5.1Intended Audience :: DevelopersLicense :: OSI Approved :: BSD LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: Internet :: WWW/HTTPTopic :: Security :: Cryptography

Tags

django encrypted fieldsdatabase field encryption djangosymmetric encryption django modelsdjango cryptography wrapperencrypt django databasedjango sensitive data protectioncryptography django integration
django-ormfield-encryptiondata-protection

More WWW/HTTP packages