skillfed

django-cryptography-django5

Easily encrypt data in Django - Fork for Django 5 support

django-cryptography-django5 v2.2 500.3K downloads/30d#6,322 on PyPI15
Permissive license BSD-3-Clause DORMANT released

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

uv

uv add django-cryptography-django5

poetry

poetry add django-cryptography-django5

Installing 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

Development Status :: 2 - Pre-AlphaEnvironment :: Web EnvironmentFramework :: DjangoFramework :: Django :: 3.2Framework :: Django :: 4.0Framework :: Django :: 5.0Intended 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.8Programming Language :: Python :: 3.9Topic :: Internet :: WWW/HTTPTopic :: Security :: Cryptography

Tags

django field encryptionencrypt django model fieldssymmetric encryption djangodjango database encryptioncryptography django wrapperdjango sensitive data protectionencrypted django charfield
django-ormfield-encryptiondata-protection

More WWW/HTTP packages