Page 1 of 1

How to use ZeosLib to access SQLCipher encrypted database

Posted: 17.11.2021, 15:47
by abc1849
Hello everyone, I have a database encrypted by the commercial version of the SQLCipher library. Before I used the UniDAC component to access this database, there is a CipherLicense attribute in the database connection properties, and the authorization key of the commercial version of the SQLCipher library can be set.

However, the authorization of UniDAC has expired recently, so I want to switch to the database connection component of ZeosLib, but I did not find similar properties that can set the authorization key of the SQLCipher library in the database connection properties.

I want to know if there is a way to access it using ZeosLib The database encrypted by the commercial SQLCipher library.

Re: How to use ZeosLib to access SQLCipher encrypted database

Posted: 17.11.2021, 17:03
by marsupilami
Hello abc1849,

I had a quick look at SQLCiper by Zetetic. But I couldn't find anything API related to an authorization key. So honestly I cannot say, how to do what you want.

Best regards,

Jan

Re: How to use ZeosLib to access SQLCipher encrypted database

Posted: 18.11.2021, 02:28
by abc1849
Hi marsupilami,

Thank you for your attention.

There is a description of the relevant authorization key on the download page of the commercial version of SQLCipher I currently use:

In UniDAC's SQLite provider, there is also the attribute of the commercial version of the SQLCipher library authorization key (https://www.devart.com/unidac/docs/using-sqlite.htm):

I'm not sure whether Zeos can support the commercial SQLCipher library. If not, do you have plans to support it?

PS: If necessary, I can send you a copy of SQLCipher library.

Re: How to use ZeosLib to access SQLCipher encrypted database

Posted: 18.11.2021, 02:33
by abc1849
Sorry, I am not yet familiar with how to add pictures. This is the description of the SQLCipher authorization key:

This is the description of the commercial version of SQLCipher authorization in the UniDAC database connection properties:

Re: How to use ZeosLib to access SQLCipher encrypted database

Posted: 18.11.2021, 11:42
by aehimself
You can try to set Encrypted=True in the connection properties and add the key in the password. I'm not sure it'll work (as it calls sqlite3_key) but maybe.
On the other hand, if it's a simple PRAGMA command it's not hard to implement it.

Re: How to use ZeosLib to access SQLCipher encrypted database

Posted: 18.11.2021, 12:24
by marsupilami
*sigh* - it seems to be a simple pragma - according to the second screenshot. Zeos doesn't support that pragma yet. I wish all those encryption solutions for SQLite would adhere to the same API...

Re: How to use ZeosLib to access SQLCipher encrypted database

Posted: 18.11.2021, 14:14
by abc1849
Hi aehimself,

I tried the method you mentioned, but the result failed. When opening the connection, it prompts: SQL Error: file is not a database.

Thank you aehimself and marsupilami, maybe marsupilami is right, Zeos does not support the commercial version of the sqlcipher library.

If Zeos developers can consider supporting the sqlcipher library, then it must be the best data access component.