Using SQLiteCrypt

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for SQLite
Post Reply
imre.dudas
Posts: 18
Joined: Thu 11 Mar 2010 20:36

Using SQLiteCrypt

Post by imre.dudas » Wed 14 Aug 2013 18:32

Hello,

How can I exactly use the SQLiteCrypt with Devart? I mean where should i exchange SQLite3.dll so that it would work properly also in Entity Developer ? Where do i need to write my license code I got to SQLiteCrypt? How is it possible to encode an existing database with it?

I couldn't find any description about these.

Thank you:
Imre

Pinturiccio
Devart Team
Posts: 2420
Joined: Wed 02 Nov 2011 09:44

Re: Using SQLiteCrypt

Post by Pinturiccio » Fri 16 Aug 2013 14:50

dotConnect for SQLite supports only SEE, CEROD and SQLiteCrypt encryption. However our provider requires the corresponding extension itself to work with encrypted database, and it these extensions are not provided with dotConnect for SQLite.
For more information, please refer to http://www.devart.com/dotconnect/sqlite ... nMode.html
imre.dudas wrote:How can I exactly use the SQLiteCrypt with Devart? I mean where should i exchange
SQLite3.dll...
Where do i need to write my license code I got to SQLiteCrypt?
Recently SQLiteCrypt API has changed. We have updated our product; the updates will be included in the next build of dotConnect for SQLite. We will post here when the corresponding build of dotConnect for SQLite is available for download.

In the new build the SQLiteCryptLicenseKey connection string parameter for the SQLiteCrypt license key is added. You need to set the EncryptionMode, Password, SQLiteCryptLicenseKey connection string parameters in order to work with a SQLiteCrypt encrypted database.
imre.dudas wrote:How is it possible to encode an existing database with it?
SQLiteConnection has the ChangePassword method. Set the new password with this method and the database will be encrypted.

ashleysbuss
Posts: 7
Joined: Tue 03 Sep 2013 23:18

Re: Using SQLiteCrypt

Post by ashleysbuss » Tue 03 Sep 2013 23:22

Sirs,

Do you have any idea of when this wonderful extra functionality will be ready for prime time?

Thanks,

Ashley

imre.dudas
Posts: 18
Joined: Thu 11 Mar 2010 20:36

Re: Using SQLiteCrypt

Post by imre.dudas » Wed 04 Sep 2013 00:48

Thank you, great.

Pinturiccio
Devart Team
Posts: 2420
Joined: Wed 02 Nov 2011 09:44

Re: Using SQLiteCrypt

Post by Pinturiccio » Wed 04 Sep 2013 12:10

We are planning to release the next public build of dotConnect for SQLite at the end of this week.

ashleysbuss
Posts: 7
Joined: Tue 03 Sep 2013 23:18

Re: Using SQLiteCrypt

Post by ashleysbuss » Wed 04 Sep 2013 13:28

Support,

Thank you for the reply and I look forward to testing over the weekend.

Take care,

Ashley

Pinturiccio
Devart Team
Posts: 2420
Joined: Wed 02 Nov 2011 09:44

Re: Using SQLiteCrypt

Post by Pinturiccio » Fri 06 Sep 2013 08:27

The new build of dotConnect for SQLite 4.6.322 is available for download now!
It can be downloaded from http://www.devart.com/dotconnect/sqlite/download.html (trial version) or from Registered Users' Area (for users with valid subscription only).
For more information, please refer to http://forums.devart.com/viewtopic.php?t=27872

udayr
Posts: 6
Joined: Wed 11 Sep 2013 18:00

Re: Using SQLiteCrypt

Post by udayr » Wed 11 Sep 2013 18:06

Hi Devart Team,

Thanks for the new release (We have most recent version). We recently bought the dotConnect for SQLite Professional version and and are trying to encrypt the database with SQLiteCrypt.

We also bought the SQLiteCrypt license and are trying to encrypt a SQLite database with the same.But the database does not encrypt.

below is the connectionstring I am using..

metadata=res://*/SessionDBModel.csdl|res://*/SessionDBModel.ssdl|res://*/SessionDBModel.msl;provider=Devart.Data.SQLite;provider connection string='Data Source=filenamehere;FailIfMissing=False;Password=passwordhere;Encryption=SQLiteCrypt;SQLiteCrypt License Key=00000-000-0000000-00000'

I am able to create any new database with the above connection string but can not get the encryption to work.

Any help /suggestions on what I might be missing here?


Thank You,
Uday

Pinturiccio
Devart Team
Posts: 2420
Joined: Wed 02 Nov 2011 09:44

Re: Using SQLiteCrypt

Post by Pinturiccio » Fri 13 Sep 2013 08:26

udayr wrote:I am able to create any new database with the above connection string but can not get the encryption to work.

Any help /suggestions on what I might be missing here?
There can be several possible reasons of such issue:
1. Please make sure that your application uses the sqlite3.dll library built with SQLiteCrypt. When installing dotConnect for SQLite, the sqlite3.dll in the System32 folder is overwritten.

2. The Open method of SQLiteConnection does not encrypt the database. It allows to open a database, and if it is encrypted, The 'Password', 'Encryption' and 'SQLiteCrypt License Key' connection string parameters are used to open the encrypted database. To encrypt the database, you need to use the ChangePassword method. For more information, please refer to http://www.devart.com/dotconnect/sqlite ... sword.html

Here is the example that encrypts the database and allows you to check that the database was encrypted.

Code: Select all

SQLiteConnection conn = new SQLiteConnection("Data Source=C:\\Temp\\database8.db;Encryption=SQLiteCrypt;FailIfMissing=false;pooling=false");
conn.Open();
conn.ChangePassword("test");
conn.Close();

conn = new SQLiteConnection("Data Source=C:\\Temp\\database8.db;Encryption=SQLiteCrypt;FailIfMissing=false;Password=test;pooling=false");
conn.Open();
conn.Close();

conn = new SQLiteConnection("Data Source=C:\\Temp\\database8.db;Encryption=SQLiteCrypt;FailIfMissing=false;Password=wrongpsw;pooling=false");
conn.Open();
conn.Close();
If SQLiteCrypt works correctly, this code raises the "File opened that is not a database file. file is encrypted or is not a database" exception when calling Open method the third time.

udayr
Posts: 6
Joined: Wed 11 Sep 2013 18:00

Re: Using SQLiteCrypt

Post by udayr » Mon 16 Sep 2013 20:16

Pinturiccio wrote: 1. Please make sure that your application uses the sqlite3.dll library built with SQLiteCrypt. When installing dotConnect for SQLite, the sqlite3.dll in the System32 folder is overwritten.
I made sure that the my application is using the Sqlite3.dll the added to system32 folder on installing the dotConnect for SQlite
Pinturiccio wrote: 2. The Open method of SQLiteConnection does not encrypt the database. It allows to open a database, and if it is encrypted, The 'Password', 'Encryption' and 'SQLiteCrypt License Key' connection string parameters are used to open the encrypted database. To encrypt the database, you need to use the ChangePassword method. For more information, please refer to http://www.devart.com/dotconnect/sqlite ... sword.html
I following your example and it DID NOT work. Below is the code I am using with slight modification connection strings (add SQLiteCrypt License Key Parameter)

Code: Select all

 SQLiteConnection conn = new SQLiteConnection("Data Source=C:\\Temp\\NewSessionDB;Encryption=SQLiteCrypt;SQLiteCrypt License Key=00000-000-0000000-00000;FailIfMissing=false;pooling=false");
conn.Open();
conn.ChangePassword("test");
conn.Close();

conn = new SQLiteConnection("Data Source=C:\\Temp\\NewSessionDB;Encryption=SQLiteCrypt;SQLiteCrypt License Key=00000-000-0000000-00000;FailIfMissing=false;Password=test;pooling=false");
conn.Open();
conn.Close();

conn = new SQLiteConnection("Data Source=C:\\Temp\\NewSessionDB;Encryption=SQLiteCrypt;SQLiteCrypt License Key=00000-000-0000000-00000;FailIfMissing=false;Password=wrongpsw;pooling=false");
conn.Open();
conn.Close();
The code is executed with no errors and the database is not encrypted.

I am not sure what I am missing here. Encryption with the SQLiteCrypt is the sole reason we purchase dotConnect for SQLite and we are struck here not able decide if should move forward using dotConnect.

Please advice.

Thank You

udayr
Posts: 6
Joined: Wed 11 Sep 2013 18:00

Re: Using SQLiteCrypt

Post by udayr » Mon 16 Sep 2013 22:29

We also tested the sample App with an 'Invalid SQLiteCrypt License Key' and it yielded the same result as with a 'Valid SQLiteCrypt License Key'.

Here is the Invalid Key we used : 00000-000-0000000-00000

How is the SQLiteCrypt key validated? We purchased a key from SQLiteCrypt (http://sqlite-crypt.com/) and using the key they provided.

Please help.

Pinturiccio
Devart Team
Posts: 2420
Joined: Wed 02 Nov 2011 09:44

Re: Using SQLiteCrypt

Post by Pinturiccio » Wed 18 Sep 2013 14:52

We have answered you via e-mail.

Post Reply