Skip to main content

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.

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django_cryptography_django5-2.2.tar.gz (33.4 kB view details)

Uploaded Source

Built Distribution

django_cryptography_django5-2.2-py2.py3-none-any.whl (28.8 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file django_cryptography_django5-2.2.tar.gz.

File metadata

File hashes

Hashes for django_cryptography_django5-2.2.tar.gz
Algorithm Hash digest
SHA256 b149685032cbbaf8b88c1b3ff6d8de7a107bb1b3cff9e84e9b32d0c61ca08346
MD5 cd402609eeae01fe98c56afa6a4811d4
BLAKE2b-256 68e40e412ef4fa219db4e0a5f0042aba832030261eab0d7ceb3c5c91df3b74e2

See more details on using hashes here.

File details

Details for the file django_cryptography_django5-2.2-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for django_cryptography_django5-2.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 73b5d4597d2fd4accca0c971dad7aacfcef24cb7322512f4f94b020cd55b57ff
MD5 ae7baafd86254f5868cdadbc88f3aca0
BLAKE2b-256 800c874f03885f20d70ee116cbffb4ea7434fb4c3325baa4015c7bbeb3b7fa6d

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page