Skip to content

Encryption not being applied #1278

@Connect-and-Exchange

Description

@Connect-and-Exchange

.net 9 MAUI Windows; When creating a new database with sqlite-net-cipher with a password the database is no encrypted. When opening the database file the content can be readed in plain text which should not be the case.

For opening the database the following is being used:

`
using SQLite;

Helpers.DsvCrypto crypto = new();
var pw = crypto.GetDatabaseKey().Result;

            databaseConnectionString = new(
                databasePath: dbFileFolderPath,
                openFlags: SQLiteOpenFlags.ReadWrite | SQLite.SQLiteOpenFlags.Create | SQLiteOpenFlags.SharedCache,
                storeDateTimeAsTicks: true,
                key: pw,
                preKeyAction: db => db.Execute("PRAGMA cipher_default_use_hmac = OFF;"),
                postKeyAction: db => db.Execute("PRAGMA kdf_iter = 128000;");

            var result = BackupDb();
            database = new SQLiteAsyncConnection(databaseConnectionString);`

What is unknown is if this is using the cipher version of the sqlite_net... when checking all the packages it shows:

sqlite-net-sqlcipher 1.9.172
sqlitepclraw.leb.e_sqlite3 2.1.11

What am i missing? or is this a bug?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions