2đź‘Ť
What are you protecting against? If attacker would get access to your DB/filesystem, he would find how you decrypt data & keys. Hiding your encription key is not an easy task (and rarely implemented in “usual” applications).
I would spend more time on protecting the server and fixing all general security issues.
5đź‘Ť
You can also check django-pgcrypto: https://github.com/dcwatson/django-pgcrypto
- [Django]-How to pass a variable from settings.py to a view?
- [Django]-Celery – Tasks that need to run in priority
- [Django]-">", "<", ">=" and "<=" don't work with "filter()" in Django
5đź‘Ť
I agree that first you need to consider your overall security model and what threat avenues might be the most risk, a la this article:
but also take a look at these for encrypted fields in Django:
encrypted fields: https://github.com/svetlyak40wt/django-fields
more encrypted fields:
https://github.com/defrex/django-encrypted-fields,
https://github.com/django-extensions/django-extensions
- [Django]-Django.db.migrations.exceptions.NodeNotFoundError
- [Django]-Concurrency control in Django model
- [Django]-Django multiprocessing and database connections
1đź‘Ť
If you decide to do the encryption in your web app side and you are using Django for your app, you can take a look django-extensions, especially EncryptedCharField and EncryptedTextField. -> https://github.com/django-extensions/django-extensions/blob/master/docs/field_extensions.rst
- [Django]-SQLAlchemy and django, is it production ready?
- [Django]-Django Left Outer Join
- [Django]-Represent Ordering in a Relational Database