You can always encrypt/decrypt the DB file each time you end/start the application. But if the app dies suddenly the file is left unencrypted.
You could compile your own version of SqlCipher (I've done it twice for other platforms -- not exactly rocket science, but it is jet engine science). You are faced with the problem of finding a suitable crypto implementation (ideally OpenSSL). Easy to just download and compile a separate copy for yourself if this is for personal use, but you're apt to run afoul of import/export rules if you try to sell your app (especially if you ship it from the US). If you could access the in-built encryption support that would be ideal (avoids the import/ export problem), but I'm not sure there's a way to get at it. You can encrypt/decrypt individual rows in the DB as you read/write. This is inefficient and awkward -- you basically have to put all the data into one long string, and any search keys must be left in clear text. It's also relatively easy to crack. For small amounts of data it's probably better to put the data into XML or JSON and read/write the entire file, decrypting/encrypting as you do the file I/O. On Apr 26, 7:41 am, DanielSchH <[email protected]> wrote: > Hello, > > I´m looking for a way to secure a SQLite database in Android. I have > read some stuff about sqlcipher but it seems to be quite complicated > to integrate the lib into a Android project and to write a java > wrapper. > > So my idea is to create an normal SQLite database and encrypt the > file. Has anybody tried it already or is it not possible. > > Thanks a lot, > Daniel -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

