I'm using sqlite-net-pcl to develop a xamarin forms application using C#. I want to protect my .db3 with password but no property or function was found that fulfill my requirements. I need to know is there any solution to protect my db3 file? I need a solution using "sqlite-net-pcl" library only. Not "Sqlite-net-sqlcipher" or any other library.
Requirement:
- Protect the .db3 file with password so that no one can see the db3 structure except those who knows the password.
- Ask password when I try to open db3.
I have tried the following:
SQLiteAsyncConnection _database;
var opt = new SQLiteConnectionString(dbPath, Flags, true, "password", postKeyAction: x =>
{
x.Execute("PRAGMA cipher_compatibility = 3");
});
_database = new SQLiteAsyncConnection(opt);
After trying this I got a following result: enter image description here