georgemarshall / django-cryptography

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

Raising Exception: Bad Signature, When i am trying to get the data from encrypted field. #8

Closed AnandMoorthy closed 6 years ago

AnandMoorthy commented 6 years ago

Hello all,

Encryption part in models going good, but when i start filtering data by a non-encrypted field i am geting bad signature exception. What am i missing here.

My Modal

class MyModal(models.Model):
    name = encrypt(models.CharField(max_length=50))
    area = models.CharField(max_length=50)

My Code:

from models import MyModal

def myFunc():
    data_list = MyModal.objects.filter(area='myarea')
    for data in data_list:
        print data.id
    return data.id

Is there anything i am missing?

AnandMoorthy commented 6 years ago

If there any progress, please let me know.

georgemarshall commented 6 years ago

I am currently unable to reproduce the issue. Could you please provide me with the message from the BadSignature exception?

Any other information that I should know about to reproduce this bug?

georgemarshall commented 6 years ago

@AnandMoorthy I am closing this issue as I have been unable to reproduce the issue and lack sufficient information to do so. If further information is supplied I will come back to this issue and attempt to reproduce again.

thismatters commented 6 years ago

I think I was getting this as well because I had unencrypted data in a table that I later applied encryption to. When I started with a fresh database the error went away. I had hoped that the migration would trigger existing data to be encrypted, but that was not the case.

veerendrapolepalli commented 6 years ago

yes i agree with @thismatters , i need to remove all the data from the database and encrypt it then it started working with any out bad signature exception