Table of Contents

Class SqliteKey

Namespace
Qavren.Edge.Sqlite
Assembly
Qavren.Edge.Sqlite.dll

An encryption key for a SQLCipher database, in the form Microsoft.Data.Sqlite can carry.

public sealed class SqliteKey
Inheritance
SqliteKey
Inherited Members

Remarks

Raw keys are delivered as the literal string x'<64 hex>' in SqliteConnectionStringBuilder.Password. Microsoft.Data.Sqlite escapes that with SQLite's own quote() and emits PRAGMA key = 'x''<64 hex>''';; SQLCipher's pragma handler dequotes it back to x'<64 hex>', which its blob_format test accepts as a raw key and skips PBKDF2. This is why connection pooling can stay enabled and why no per-physical-open interceptor is needed.

Properties

IsRaw

true when the key bypasses SQLCipher's KDF.

Methods

FromPassphrase(string)

A passphrase. SQLCipher derives the key with PBKDF2, which is slow by design.

FromRawBytes(ReadOnlySpan<byte>)

A raw 256-bit key. The recommended mobile path: store the bytes in platform secure storage.

ToConnectionStringPassword()

The value to assign to SqliteConnectionStringBuilder.Password.