Skip to main content

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

Installation

pip install django-cryptography

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-0.4.tar.gz (31.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

django_cryptography-0.4-py2.py3-none-any.whl (27.5 kB view details)

Uploaded Python 2Python 3

File details

Details for the file django-cryptography-0.4.tar.gz.

File metadata

  • Download URL: django-cryptography-0.4.tar.gz
  • Upload date:
  • Size: 31.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.41.0 CPython/3.8.1

File hashes

Hashes for django-cryptography-0.4.tar.gz
Algorithm Hash digest
SHA256 8736a51a88b7eb25e312ced8f510a1471fbcbff2a49da334a0af15a43fcb776c
MD5 d460c314b9f8841326e69e28c6778bb5
BLAKE2b-256 d5fa77530ac0cb79440e643adae9f32c84c9cb7fb14b5500fc4366b75d676030

See more details on using hashes here.

File details

Details for the file django_cryptography-0.4-py2.py3-none-any.whl.

File metadata

  • Download URL: django_cryptography-0.4-py2.py3-none-any.whl
  • Upload date:
  • Size: 27.5 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.41.0 CPython/3.8.1

File hashes

Hashes for django_cryptography-0.4-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 9e6b0be85e18838e20dfb27a2b68fe5cefbfc689c9416b2ca54f6c0610dcab91
MD5 d228ca625cee6b9a29a12a7684222c60
BLAKE2b-256 1bc704f7154be4992fe1e69bfc6caee437d5e9fb83ed2491d45ddfd689193659

See more details on using hashes here.

Release history Release notifications | RSS feed

1.1

1 file

1.0

2 files

This release

0.4 This release

2 files

0.3

2 files

0.2

2 files

0.1

2 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