SQLite Database Encryption in Delphi OLEDB

How to use encryption for SQLite DB in Delphi if I use SQLite ODBC Driver .
I have to use ADO components to access data.

+4
source share
1 answer

As I can see from the ODBC driver source, one of two options:

  • Compile the ODBC driver with WITH_SQLITE_DLLS , so it will use sqlite3.dll. Then we provide sqlite3.dll compiled with SQLITE_HAS_CODEC .
  • Compile the ODBC driver and SQLite engine with SQLITE_HAS_CODEC . Then bind the SQLite engine statically with the ODBC driver.

SQLITE_HAS_CODEC means that the SQLite engine is compiled with a built-in codec. By default, SQLite does not have a codec. You can use SQLCipher instead of standard SQLite. Or get SQLite with an encryption extension .

Then, to connect to an encrypted database using ODBC, you need to specify PWD=xxx in the connection string.

+6
source

Source: https://habr.com/ru/post/1391378/


All Articles