Skip to main content

Django Cryptography 5

Note: This is a fork of the official django-cryptography project, which appears to be abandoned. The only change made in this fork that the patch that fixes Django 5 compatibility has been applied and pushed to pypi as a new project.

You can install the forked version from pypi with the following command:

pip install django-cryptography-5

The rest of this README is the original README from the official project.

Django Cryptography

A set of primitives for easily encrypting data in Django, wrapping the Python Cryptography library. Also provided is a drop in replacement for Django’s own cryptographic primitives, using Cryptography as the backend provider.

Do not forget to read the documentation.

GitHub Workflow Status (branch) Codecov branch

Cryptography by example

Using symmetrical encryption to store sensitive data in the database. Wrap the desired model field with encrypt to easily protect its contents.

from django.db import models

from django_cryptography.fields import encrypt


class MyModel(models.Model):
    name = models.CharField(max_length=50)
    sensitive_data = encrypt(models.CharField(max_length=50))

The data will now be automatically encrypted when saved to the database. encrypt uses an encryption that allows for bi-directional data retrieval.

Requirements

Installation

pip install django-cryptography

Metadata

Release files for django-cryptography-5 2.0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-cryptography-5 2.0.3
File Size Uploaded
django_cryptography_5-2.0.3.tar.gz 34.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for django-cryptography-5 2.0.3
File Interpreter ABI Platform
django_cryptography_5-2.0.3-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size: 47.3 kB

Release files / django_cryptography_5-2.0.3.tar.gz

Download URL django_cryptography_5-2.0.3.tar.gz
Size 34.0 kB
Tags Source
SHA-256 checksum
How to use checksums
f4e140a9339e14785fd6c2cbb836c370dcd00099279181fb98b002728dbdd63e
BLAKE2b-256 checksum
How to use checksums
ae8b214ea0d3726eeb99654213aae57463f38b2b82b3e10a746df35bd8361656
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.5.2

Release files / django_cryptography_5-2.0.3-py2.py3-none-any.whl

Download URL django_cryptography_5-2.0.3-py2.py3-none-any.whl
Size 13.3 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
0f53a688e111c1b015475a80c54d74d5c84b62ffbaba50577cb767dd2fc9c1c3
BLAKE2b-256 checksum
How to use checksums
f3a65dd7c0fc1e4af6db2df1fb779e271059d7a942039bf82670924c08d37dfb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.5.2

Release history Release notifications | RSS feed

This release

2.0.3 This release

2 release files

2.0.2

2 release files

2.0.1

2 release files

2.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page