Search code examples
c#sqliteencryptionconnection

How to connect to encrypted database?


Database shopdata.db is encrypted. How to use SQLiteConnection for this?

public SQLiteConnect()
{
    this.con = new SQLiteConnection("Data Source=shopdate.db;Password=123);
    this.cmd = new SQLiteCommand();
    this.cmd.Connection = this.con;
}

I want to get the data in the database.


Solution

  • According to the Microsoft docs, SQLite doesn't support encrypting database files by default. Instead, you need to use a modified version of SQLite like SEE, SQLCipher, SQLiteCrypt, or wxSQLite3.

    Can you confirm what you are using?