https://github.com/murphyadam/encrypted-json-field
Encrypted JSON Field for Django
https://github.com/murphyadam/encrypted-json-field
database django django-rest-framework encryption-decryption
Last synced: 12 months ago
JSON representation
Encrypted JSON Field for Django
- Host: GitHub
- URL: https://github.com/murphyadam/encrypted-json-field
- Owner: MurphyAdam
- Created: 2023-08-06T15:54:26.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2024-05-08T22:08:44.000Z (about 2 years ago)
- Last Synced: 2025-06-28T01:36:00.204Z (about 1 year ago)
- Topics: database, django, django-rest-framework, encryption-decryption
- Language: Python
- Homepage: https://pypi.org/project/encrypted-json-field/
- Size: 6.84 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Encrypted JSON Field
Encrypted JSON field supports automatic encryption/ decryption of JSON fields with padding to conceal start and end of value.
## Setup
Nothing really to setup, just import the field and get to work.
You could, however, setup an optional variable in your django settings named `ENCRYPTED_JSON_FIELD_SECRET` (It should be 16 chars minimum) which will be used to encrypt/ decrypt
the data of your fields. The default behaviour uses the first 16 characters of `SECRET_KEY` (Block size).
### Example:
```py
from encrypted_json_field import EncryptedJSONField
from django.db import models
class Company(models.Model):
name = models.CharField(max_length=32)
config = EncryptedJSONField(blank=True)
```
### Support
This supports Python >= 3.8 and Django >= 4.2.
If you need to support other versions, please create an issue.