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.3.tar.gz (2.6 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.3-py3-none-any.whl (3.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: c9lab_security-0.3.tar.gz
  • Upload date:
  • Size: 2.6 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.3.tar.gz
Algorithm Hash digest
SHA256 db66db42047e93c1ead26ac9fedb3f6b768052384e8bbb0b03af27ae83469bc8
MD5 c621a8c23f762d3409426fd086443829
BLAKE2b-256 8826431cda2c7769d25b2b61307cc3f279db8abeccfd928452e1793104fd9089

See more details on using hashes here.

File details

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

File metadata

  • Download URL: c9lab_security-0.3-py3-none-any.whl
  • Upload date:
  • Size: 3.2 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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 997287b33c13eb3886f43adbf05c260d01a2f8b33e0952f4bc516b70ea08ffd6
MD5 141d28bcd9515123a48278d3041b5a0d
BLAKE2b-256 895650cdc4930dad166d036d7f18476fec52ae3ce10a755ffbf9d8d2e6478893

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