ODBC Driver for SQLite

Database Encryption - ODBC Driver for SQLite

What constitutes Database Encryption

The SQLite architecture provides the functionality for work with encrypted databases. This means that encoding/decoding is applied to a database file at the moment of execution of the file read/write operations. This is a low-level encryption "on the fly", it is implemented at the level of the SQLite client library and is completely transparent to the applications working with the database.

But the fact is that in the client libraries available at the official SQLite website the database file encryption algorithms are not implemented. Therefore, usually, to work with encrypted databases, one has to either use a custom-built client library with encryption support, or create his own library from the source code, available on the SQLite website.

Devart ODBC Driver for SQLite functionality for Database Encryption

Devart ODBC Driver for SQLite provides built-in capabilities for database encryption, that becomes available when working in Direct Mode.


To enable the Direct mode when creating and configuring a user DSN for the driver, select the Direct check box.

Or, when using the SQLDriverConnect API function, set Direct=True in the connection string. For example:

DSN=Devart ODBC SQLite;Database=c:\sample_database.db3;Direct=True

Database encryption built in Devart ODBC Driver for SQLite allows to:

To encrypt/decrypt the database file, one of the following encryption algorithms can be used:

Important note:
There are no strict standardized requirements for implementation of database encryption in SQLite. Therefore, implementation of database encryption in Devart ODBC Driver for SQLite is incompatible with other implementations, except for such Devart products as SQLite Data Access Components and Universal Data Access Components. When using Devart ODBC Driver for SQLite, it is possible to work only with encrypted databases, created with the use of Devart ODBC Driver for SQLite, LiteDAC or UniDAC.

Usage of Database Encryption in Devart ODBC Driver for SQLite

PRAGMA Encryption

Database connection

For connection to an encrypted database, the following mechanisms are used in Devart ODBC Driver for SQLite:


Below are sample scenarios for typical operations with database encryption.

Encrypt a previously unencrypted database

Connect to an encrypted database

Change the encryption key for an encrypted database

Decrypt an encrypted database

© 2015-2020 Devart. All Rights Reserved. Request Support ODBC Forum Provide Feedback