Access encrypted SQLite database

The forum for ZeosLib 7.2 Report problems. Ask for help, post proposals for the new version and Zeoslib 7.2 features here. This is a forum that will be edited once the 7.2.x version goes into RC/stable!!

My personal intention for 7.2 is to speed up the internals as optimal a possible for all IDE's. Hope you can help?! Have fun with testing 7.2
Post Reply
Yogi Yang
Fresh Boarder
Fresh Boarder
Posts: 17
Joined: 15.03.2008, 08:20

Access encrypted SQLite database

Post by Yogi Yang »

Hello,

I have managed to access SQLite database I don't know as to how to access encrypted database. What do we have to do to access it?

TIA
--
Yogi Yang
User avatar
aehimself
Zeos Dev Team
Zeos Dev Team
Posts: 787
Joined: 18.11.2018, 17:37
Location: Hungary

Re: Access encrypted SQLite database

Post by aehimself »

I never attempted to access an encrypted SQLite database but I can see that there is a connection parameter for SQLIte:

// Type: BOOLEAN
// Encrypt connection
ConnProps_Encrypted = 'encrypted';

ZProp_Encrypted: TZProperty = (
Name: ConnProps_Encrypted;
Purpose: 'Use connection encryption?';
ValueType: pvtEnum; LevelTypes: [pltConnection];
Values: cBoolEnum; Default: cBoolFalse; Alias: '';
Providers: (Count: 1; Items: @cSqlite3upProvider);
Protocols: (Count: 1; Items: @cSQLiteProtocol);
);

I'd try to set this on the SQLConnection object (encrypted=true) and use the password property to supply the password.
Delphi 12.1, Zeos 8 from latest GIT snapshot
Using:
- MySQL server 8.0.18; libmariadb.dll 3.3.8
- Oracle server 11.2.0, 12.1.0, 19.0.0; oci.dll 21.13
- MSSQL 2012, 2019; sybdb.dll FreeTDS_2435
- SQLite 3.45.2
marsupilami
Platinum Boarder
Platinum Boarder
Posts: 1939
Joined: 17.01.2011, 14:17

Re: Access encrypted SQLite database

Post by marsupilami »

aehimself wrote: 09.08.2021, 09:48 I'd try to set this on the SQLConnection object (encrypted=true) and use the password property to supply the password.
I seem to remember that thsi is the correct way to use encryption with SQLite. See viewtopic.php?f=28&t=105825#p136873

We (still) do not support wxsqlite3 encryption.
Post Reply