Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I protect sqlite db in android from being stolen

I am making a app with 28MB size of sq-lite file which is initially in assets folder of android. When it installs in user it copy's to system folder. As this db is most important for me. If anyone can get this file then he can steal my information.

As you unzip the APK file you will easily get the sq-lite file. Is there any way to protect it or hide it or encrypt it so a programmer or hacker can't get the db easily by extracting APK file.

like image 883
Ekram Avatar asked Dec 30 '13 15:12

Ekram


2 Answers

You cannot complete protect your SQLlite DB as someone can reverse engineer your code and read the content of your protection mechanism.

You can take an alternate paths:

1) Make the DB online, i.e. don't put it with your app, have your product contact your DB and query it

2) Encrypt the data in the SQL Lite, and decrypt it on the fly inside your code - this will make it harder to just steal your SQL Lite, it is not prefect, but it is better than nothing

like image 59
Noam Rathaus Avatar answered Oct 01 '22 14:10

Noam Rathaus


Maybe SQLCypher is your friend. see here. It provides 256 bit AES encryption

like image 35
Phantômaxx Avatar answered Oct 01 '22 12:10

Phantômaxx