Skip to main content

django-kms-field

Build Status

KMS encrypted database field for Django.

The KMSEncryptedCharField uses your KMS key to encrypt your data before it is stored in the database and it decrypts it again when you read from the database.

It was designed with stored credentials and other critical private data in mind. I would strongly recommend thinking about which models use this field with as it has not been optomized for high volume access and boto api calls during query time may impact performance. Splitting secure fields into separate models can improve performance significantly as opposed to putting encrypted fields in frequently read and saved models.

Example

from django.db import models
from django_kms.fields import KMSEncryptedCharField


class StoredCredential(models.Model):
    description = models.CharField(max_length=50)
    username = models.CharField(max_length=50)
    password = KMSEncryptedCharField(key_id="alias/my_key")

Django settings

KMS_FIELD_KEY = 'alias/<my-key>'
KMS_FIELD_REGION = 'us-west-2'
KMS_FIELD_CACHE_SIZE = 500  # Number of decrypted plaintext values to hold in memory

Release files for django-kms-field 0.6

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-kms-field 0.6
File Size Uploaded
django-kms-field-0.6.tar.gz 3.1 kB Details

Release files / django-kms-field-0.6.tar.gz

Download URL django-kms-field-0.6.tar.gz
Size 3.1 kB
Tags Source
SHA-256 checksum
How to use checksums
166632e9d69130df316697f2572e3bac65cecf140ad338cdfe7a35f8070d95ff
BLAKE2b-256 checksum
How to use checksums
9f7a502e3360421bbbafd82a7dc8dd7a366d3fd6ec7b2302879697342dc9e26c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.3.1 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.7.2

Release history Release notifications | RSS feed

This release

0.6 This release

1 release file

0.5

1 release file

0.4

1 release file

0.3

1 release file

0.2

1 release file

0.1

1 release file

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