Hi All,
I am working on Xamarin.Forms app within that I have integrated Sql Cipher on platform dependent . Now I want to secure my prefilled db . using following code
public void EncrptSqliteDb(string source, string destination, string password)
{
SqliteConnection connection = new SqliteConnection (string.Format("Data Source={0}", source));
connection.Open();
using (var cmd = connection.CreateCommand())
{
cmd.CommandText = string.Format("ATTACH DATABASE '{0}' AS encrypted KEY '{1}'", destination, password);
cmd.CommandText = "SELECT sqlcipher_export('encrypted')";
cmd.CommandText = "DETACH DATABASE encrypted";
}
connection.Close ();
}