Easily encrypt data in Django - Fork for Django 5 support
Project description
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.
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
Python (3.7, 3.8, 3.9, 3.10, 3.11, 3.12)
Cryptography (2.0+)
Django (3.2, 4.1, 4.2, 5.0)
Installation
pip install django-cryptography
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for django_cryptography_django5-2.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | b149685032cbbaf8b88c1b3ff6d8de7a107bb1b3cff9e84e9b32d0c61ca08346 |
|
MD5 | cd402609eeae01fe98c56afa6a4811d4 |
|
BLAKE2b-256 | 68e40e412ef4fa219db4e0a5f0042aba832030261eab0d7ceb3c5c91df3b74e2 |
Hashes for django_cryptography_django5-2.2-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 73b5d4597d2fd4accca0c971dad7aacfcef24cb7322512f4f94b020cd55b57ff |
|
MD5 | ae7baafd86254f5868cdadbc88f3aca0 |
|
BLAKE2b-256 | 800c874f03885f20d70ee116cbffb4ea7434fb4c3325baa4015c7bbeb3b7fa6d |