A Django app for using cryptography in Django Models. It support bi-directional cryptography.
Check out the documentation :- Django-CryptographicFields
- Python (3.6+)
- Pycryptodome (3.9+)
- Django (3.0+)
- Timestring (1.6.0+) Mandatory if python < 3.7
Install Django CryptographicFields using PIP:-
pip install Django-CryptographicFields
INSTALLED_APPS = [
...
'CryptographicFields',
]
Set custom Encryption Key in settings.py Make sure that key length is greater than or equal to 50 otherwise it will raise an error
CRYPTOGRAPHIC_KEY="your_key"
from CryptographicFields import fields
from django.db import models
class CryptogaphicModel(models.Model):
name=fields.CharField(max_length=120)
The data will now be automatically encrypted when saved to the database.& decrypted when data is retrieved.
- Supports data retrival
- Supports custom query
- Supports Q() queries
- Supports Ordering data through python functions
- Supports Sorting data through python functions
- Supports 'startswith' lookups for all String Based Fields
- Supports 'date' lookup for Date,DateTime Fields
- Supports 'time' lookup for TimeField
For More Information check out the documentation :- Django-CryptographicFields