Skip to main content

Add Amazon KMS encrypted database fields

Project description

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'

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-kms-field-0.3b0.tar.gz (2.7 kB view details)

Uploaded Source

File details

Details for the file django-kms-field-0.3b0.tar.gz.

File metadata

  • Download URL: django-kms-field-0.3b0.tar.gz
  • Upload date:
  • Size: 2.7 kB
  • Tags: Source
  • Uploaded using 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

File hashes

Hashes for django-kms-field-0.3b0.tar.gz
Algorithm Hash digest
SHA256 eb74cb6dded78e7eeaac4682ba77e88191d15e1cd29e0c1043f61e3f6c6b470e
MD5 b95f766144ab4a7ddbb1cfb3f8470fef
BLAKE2b-256 676c539c280556e7328738fb168ec3004314c7d3ff932834faef847759c67bc8

See more details on using hashes here.

Supported by

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