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
File details
Details for the file django_cryptography_django5-2.1.tar.gz
.
File metadata
- Download URL: django_cryptography_django5-2.1.tar.gz
- Upload date:
- Size: 28.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.0.0 CPython/3.12.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 671c71323c9f41eb2b958b4b230b8608c85852f459c52a82740c62aed5b60555 |
|
MD5 | d8474a6c283d5e244d4a9a27b033d705 |
|
BLAKE2b-256 | 6da731c17d4710b67eabda8266216575e9e2d3ad036014000edaeb055d86994c |
File details
Details for the file django_cryptography_django5-2.1-py2.py3-none-any.whl
.
File metadata
- Download URL: django_cryptography_django5-2.1-py2.py3-none-any.whl
- Upload date:
- Size: 7.4 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.0.0 CPython/3.12.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 41cc555ab3395445bc7a8705c1c8d9394b050283e266475af75cd5b106848262 |
|
MD5 | b6e030ce309a6a91acf78d6894608ce6 |
|
BLAKE2b-256 | bd7ccd96fed8062f90c87f1264d7f9863bfdc73b8224dacd7daef346c0631adc |