Creating an Order Column for encrypted data
- by SetiSeeker
I am saving encrypted data to a database.
Is there a way I can create a "hashcode" or fingerprint or checksum of the plain text data, that if I sort / order by on the "hashcode" the order would be the same as if I had saved the plain text data and perform the same sort / order by operation on it?
I basically need a SOUNDEX() type function that will give me a value that will maintain the order of the plain text data. I would then save both encrypted data and the "hashcode" and when querying the data order by the "hashcode" field.
I need to perform this in the application and preferably not in the SQL DB if at all possible.
I am using Entity Framework and SQL 2008 and C# 4.0.