Search code examples
c#.netsqlitesqlcipher

Using SQLCipher Community Edition in .NET


Is there a way to make Community Edition of SQLCipher work in .NET after compiling? From what i was able to gather it seems that it's a C/C++ library.

Or are there any alternatives (free preferred) that can do the same thing? I'm trying to encrypt my SQLite .db file and then be able to decrypt it for use in .NET program.

Thanks.


Solution

  • The sqlite-net-sqlcipher NuGet package provides a free open source implementation that supports reading and writing SQLite files encrypted with SQLCipher.

    var options = new SQLiteConnectionString(databasePath, true,
        key: "password");
    var encryptedDb = new SQLiteAsyncConnection(options);