mercredi 14 janvier 2015

How to encrypt an SQLite Database

I am using SQLite Database for my Java application. One of the main limitation is that I can't apply password protection to it, and if i try any plugin or stuff, it will make it hard to deploy.


So the logic in my mind is



  1. Encrypting the .sqlite DB file inside a Zip File having a password.

  2. Password will be stored inside the application.

  3. When user runs the application, the application will open the Zip file using the password and store unzipped database file into memory (so user cant access it while its open and make changes to database), which is accessible to the application.

  4. After work is done when I close the application, updated database is zipped again.


The above is logic which i think should work, however I am not sure.


Will above logic work? If yes can someone help me with a snippet or example code for it?


Ps- I know user can decode the application for password but i assume the user don't know anything about programming. Basically I want to store hardwareids in the database.


Aucun commentaire:

Enregistrer un commentaire