Encrypted SQLite, Cipher

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
AlexGray
Posts: 2
Joined: Fri 08 May 2020 12:45

Encrypted SQLite, Cipher

Post by AlexGray » Fri 08 May 2020 12:51

Hi,
I am trying to connect to an SQLite database that is encrypted with SQLCipher 4 with its default settings trough UniDac 8.1.3. But I am not able to open the database, so is there any step-by-step guide to accomplish that or can you please provide some guidelines?
BTW. The password Is correct and the database is valid, I’m able to work with it from e.g. “DB Browser for SQLite”

Thanks!

MaximG
Devart Team
Posts: 1822
Joined: Mon 06 Jul 2015 11:34

Re: Encrypted SQLite, Cipher

Post by MaximG » Tue 26 May 2020 07:00

We have tested UniDAC SQLCipher 3. In order to use encryption implemented in a third-party client library (including SQLCipher), you should specify the encryption key value in the EncryptionKey property and set the EncryptionAlgorithm property to leDefault, for example:

Code: Select all

UniConnection.Database := '<your SQLite DB file>';
UniConnection.SpecificOptions.Values['ClientLibrary'] := '<your client library with encryption support>';
UniConnection.SpecificOptions.Values['EncryptionAlgorithm'] := 'leDefault';
UniConnection.SpecificOptions.Values['EncryptionKey'] := '<your EncryptionKey value>';
UniConnection.Connect;
If you use a client library that supports SQLCipher 3.4.2 or older, you should specify your license key in the CipherLicense property:

Code: Select all

UniConnection.SpecificOptions.Values['CipherLicense'] := '<your Cipher License>';

We will test our components with SQLCipher 4 and let you know the results.

AlexGray
Posts: 2
Joined: Fri 08 May 2020 12:45

Re: Encrypted SQLite, Cipher

Post by AlexGray » Wed 17 Jun 2020 07:44

MaximG,

I just want to confirm that it works.
Thank you!

Post Reply