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

Decryption of Encrypted Fields with Django Project hosted on Heroku #47

Closed anatolzak closed 3 years ago

anatolzak commented 3 years ago

Hi there!

I am new to django-cryptography and have read the documentation and was wondering about the following question:

Before I migrate my data, I want to make sure everything would work as expected. I am hosting my project on Heroku. I know that Heroku rotates the servers and rotates the server on every rebuild as well. I don't know enough about how this library works behind the scenes to understand whether the following could happen or not so I am sorry for my uninformed question. Will the new servers that Heroku attaches to my project still be able to decrypt the encrypted fields?

I have noticed that when I access my data through the Django admin site but not on the same machine I migrated dummy data to be encrypted, that it says <memory at 0x0x0x0x0x0x>. Just from curiosity and intrest, would you encrypt large amounts of data with this library or would that be not the ideal case?

Thanks so much in advance!

artieeez commented 3 years ago

It uses the SECRET_KEY Django's settings variable. So, as long as you don't change it things should keep working. Considering it was set using a environment variable, you can find it in your app's dashboard > Settings > Config Vars.