Skip to main content

Middleware for encrypting and decrypting requests and responses in Django Rest Framework

Project description

c9lab-security

This package provides middleware for encrypting and decrypting requests and responses in Django Rest Framework.

Installation

pip install c9lab-security



MIDDLEWARE = [
    ...,
    'c9lab_security.middleware.DecryptRequestMiddleware',
    'c9lab_security.middleware.EncryptResponseMiddleware',
]

# Set the encryption key
from c9lab_security.encryption_utility import EncryptionUtility
EncryptionUtility.set_key(b'your-16-byte-key')  # Use a 16, 24, or 32 byte key




Ensure your requests and responses use the application/json content type and include the encrypted data under the statistics field.

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

c9lab-security-0.1.tar.gz (2.5 kB view details)

Uploaded Source

Built Distribution

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

c9lab_security-0.1-py3-none-any.whl (3.1 kB view details)

Uploaded Python 3

File details

Details for the file c9lab-security-0.1.tar.gz.

File metadata

  • Download URL: c9lab-security-0.1.tar.gz
  • Upload date:
  • Size: 2.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.12

File hashes

Hashes for c9lab-security-0.1.tar.gz
Algorithm Hash digest
SHA256 a69d6bde2882300677473a3becde4514d2778a4a5030ae7f4cc58748c9ecdaa3
MD5 c6ef4ac0193dab156f017c67d6d98b94
BLAKE2b-256 2f7a0bfdd06adb5ac9d7cbe15c123d23fc42091496dd5ae6aae5fde969a2a3e1

See more details on using hashes here.

File details

Details for the file c9lab_security-0.1-py3-none-any.whl.

File metadata

  • Download URL: c9lab_security-0.1-py3-none-any.whl
  • Upload date:
  • Size: 3.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.12

File hashes

Hashes for c9lab_security-0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6e4fd50446025b3ee8fbaa3c223c6e618638afdda1e82add80b5a0e1894aadbd
MD5 5260b4ce3bbd622e32fe86b3c0da3a59
BLAKE2b-256 398bf884753bfc0b21949964535966b9afe74985ca3f2564002b0d2c23145419

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