vendredi 22 avril 2016

Sorting of database table by encrypted field

I have a SQLite table which looks like:

CREATE TABLE MyTable
( _id INTEGER PRIMARY KEY AUTOINCREMENT,
  encrypted_field BLOB
);

in fact this BLOB is just AES-256 encrypted JSon of Java class like:

public class MySecretClass {
   private Date date;
   private String message;
}

Since, it's under Android - I have ContentProvider which reads data, decrypts record "on-fly" and feeds appropriate ListView or RecyclerView

I need to somehow provide sorting by Date and String

My first intention was to introduce additional field in my table such that it will reflects records modifications and somehow "emulate" sorting by Date and String, but in the end I stuck and found that it's infeasible.

Any other ideas, workarounds?

Aucun commentaire:

Enregistrer un commentaire