georgemarshall / django-cryptography

Easily encrypt data in Django
https://django-cryptography.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
371 stars 70 forks source link

Encryption using client-specific keys #40

Closed alexp0205 closed 4 years ago

alexp0205 commented 4 years ago

Hi. I am looking for a way to encrypt a particular field in a model using different keys. The model has data owned by multiple clients and each client has their own keys. Has the library been used for a similar use case before? Do you have any thoughts on how this could be done?

In a clone branch, I was thinking of changing _encryption_key in FernetBytes.__init__ method to get the key from a different method instead of from settings. Will this work?