foundertherapy / django-cryptographic-fields

A set of fields that wrap standard Django fields with encryption provided by the python cryptography library.
MIT License
29 stars 34 forks source link

Random key rotation #6

Closed earthastronaut closed 9 years ago

earthastronaut commented 9 years ago

The method encrypt on cryptography.fernet.MultiFernet uses only the first key to encrypt with. Noooot really key rotation. This pull requests uses random.choice to randomly select from your keys.

We could do an actual rotation with next and loop through the keys, but I think random is better. Thoughts?