Monday, 13 September 2021

Using Like in Sqlite with android for searching in encrypted data

I have a table (Table1) in SQLite with one column (Col1), this table has 100,000 rows that all values in Col1 are encrypted with special algortith.

I've used select sql ... like command in Android, Like this:

Select Col1
from Table1
where Col1 like 'A%';

I want to return all rows that started with 'A' letter. But actually Cal1 is encrypted!! even if I use this: "Select Col1 from Table1 where Col1 like '"+my_method_encryption("A")+"%';" .. it will be wrong, becuase may the Encrypted values of 'A' letter in Col1 has different value with return value of my_method_encryption("A").

What should I do?

Actually There is another way to solve it, if I select all 100,000 rows and after that I will decrypt all 100,000 rows and then search. But this way will be so slow becuase maybe I will need to use this select ... like more than 10 times. Thanks



from Using Like in Sqlite with android for searching in encrypted data

No comments:

Post a Comment