Sql – iPhone – Read password encrypted sqlite database

iphonesqlite

I can open a regular sqlite database on iPhone with

sqlite3_open([filename UTF8String], &database);

But how do I open a password encrypted database?

Best Answer

Sqlite3 does not have builtin support for encryption. There is an extensions (CEROD) that support encryption, but the code is not publicly available, you need to license it. Apple has not, so the included version of sqlite3 does not support CEROD encrypted databases, if you have one you need to pay the licensing fee yourself, build a private copy of sqlite3 that included CEROD and use that.

If you are using CEROD and have built a custom sqlite3 supporting it then you would open the database like thing:

sqlite3_open(":cerod:%s:%s", [password UTF8String], [filename UTF8String], &database);

If you are not talking about CEROD then I have no idea what to tell you since, since any other encryption extensions are completely proprietary.