[Ssc-dev] SQLCipher and SSC/Obscura
Nathan of Guardian
nathan at guardianproject.info
Mon May 9 10:21:07 EDT 2011
Hans and I have been working on SQLCipher (http://sqlcipher.net) for
Android, and I'm happy to say we have a build of it now that seems to
work pretty well. We have an SDK packaged up with all the JAR and .SO
files needed, so I thought I would try integrating it with Obscura/SSC.
I am happy to say it works! I modified SSCMetadataHandler to use our new
SQLiteDatabase class:
import info.guardianproject.database.sqlcipher.*;
and then instead of loading the .db file from assets, I just create a
new one from scratch on the device, and added the necessary. (I am not
sure why we were preloading the .db file in the first place - preloading
it with data?)
The only real change to a developer is that somewhere in the main
activity, you have to call. SQLiteDatabase.loadLibs(context) one time,
and then whenever you need to get a db, just use a password:
db = getWritableDatabase(SQLCIPHER_TEMP_PASSWORD);
db = getReadbleDatabase(SQLCIPHER_TEMP_PASSWORD);
Right now I am using a static password string, but the real solution
would be to prompt the user with a password or PIN keypad entry screen,
and then have those credentials cache themselves for some period of time.
All in all, it seems like just a few hours work to implement this, which
is a very exciting prospect.
+n8fr8
More information about the Ssc-dev
mailing list