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.2.tar.gz (2.9 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.2-py3-none-any.whl (3.4 kB view details)

Uploaded Python 3

File details

Details for the file c9lab_security-0.2.tar.gz.

File metadata

  • Download URL: c9lab_security-0.2.tar.gz
  • Upload date:
  • Size: 2.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.3

File hashes

Hashes for c9lab_security-0.2.tar.gz
Algorithm Hash digest
SHA256 42e887d3e299fd8264480ef4e13eb18281ca87e58e19cb9a14a5f0bc0b9c02c8
MD5 731c1c0196ee31cc848378ac4bc14234
BLAKE2b-256 e83a0091c7e8dabbcd138dde3c8aa799f558d8ea3b22f3629fd85296ff64fd87

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for c9lab_security-0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 ea1e13c2cc6b6599f65977bcd73a41a43ae09dc3f924d1797ab358abf2d911ad
MD5 3e9faeda0365ebc9e9bc5069dc146703
BLAKE2b-256 11fbc3a73a3c6c4d2bc1278aaf7a711a98315ed58f8f95e379b9982e3addc1d3

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