Connection with SQLite db encrypted

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Connection with SQLite db encrypted

Luca Scurati
I'm trying to create a program that communicates with a SQLite database
encrypted by a password. If I try with a db without any password it work,
but with a database with password, after connecting, when executing the
query it gives the error "File is not a database"
I've tried both with Microsoft.Data.Sqlite and with System.Data.SQLite.
Do you have any advice?
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Connection with SQLite db encrypted

Simon Slavin-3
On 26 Nov 2019, at 1:37pm, Luca Scurati <[hidden email]> wrote:

> I'm trying to create a program that communicates with a SQLite database encrypted by a password. If I try with a db without any password it work, but with a database with password, after connecting, when executing the query it gives the error "File is not a database" I've tried both with Microsoft.Data.Sqlite and with System.Data.SQLite.

Can it read the database correctly using any tool at all ?  In other words, are you certain that the password is correct ?

Which encryption method is used ?  Is it the Microsoft-only one, or SEE, or something else ?

How are you specifying the password ?  (Make sure you don't paste the real password into your reply !)

System.Data.SQLite uses a Microsoft-only form of encryption.  In other words, if you have a database made with the supported SEE encryption method, it can't open it.
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Connection with SQLite db encrypted

Luca Scurati
I ecnrypt the db through the DB Browser for SQLCipher tool. If I try to
access the database from this application, it works.Do you have any other
method for encrypt a SQLite db?

Il giorno mar 26 nov 2019 alle ore 18:55 Simon Slavin <[hidden email]>
ha scritto:

> On 26 Nov 2019, at 1:37pm, Luca Scurati <[hidden email]> wrote:
>
> > I'm trying to create a program that communicates with a SQLite database
> encrypted by a password. If I try with a db without any password it work,
> but with a database with password, after connecting, when executing the
> query it gives the error "File is not a database" I've tried both with
> Microsoft.Data.Sqlite and with System.Data.SQLite.
>
> Can it read the database correctly using any tool at all ?  In other
> words, are you certain that the password is correct ?
>
> Which encryption method is used ?  Is it the Microsoft-only one, or SEE,
> or something else ?
>
> How are you specifying the password ?  (Make sure you don't paste the real
> password into your reply !)
>
> System.Data.SQLite uses a Microsoft-only form of encryption.  In other
> words, if you have a database made with the supported SEE encryption
> method, it can't open it.
> _______________________________________________
> sqlite-users mailing list
> [hidden email]
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Connection with SQLite db encrypted

Luca Scurati
Anyway I found another library called Mono.Data.Sqlite that recognize the
SetPassworg and ChangePassword method (the two libraries listed above did
not recognize them) but it gives me the following error: Unable to find an
entry point named 'sqlite3_key' in DLL 'sqlite3'

Do you have any idea?

Il giorno mer 27 nov 2019 alle ore 08:22 Luca Scurati <
[hidden email]> ha scritto:

> I ecnrypt the db through the DB Browser for SQLCipher tool. If I try to
> access the database from this application, it works.Do you have any other
> method for encrypt a SQLite db?
>
> Il giorno mar 26 nov 2019 alle ore 18:55 Simon Slavin <
> [hidden email]> ha scritto:
>
>> On 26 Nov 2019, at 1:37pm, Luca Scurati <[hidden email]>
>> wrote:
>>
>> > I'm trying to create a program that communicates with a SQLite database
>> encrypted by a password. If I try with a db without any password it work,
>> but with a database with password, after connecting, when executing the
>> query it gives the error "File is not a database" I've tried both with
>> Microsoft.Data.Sqlite and with System.Data.SQLite.
>>
>> Can it read the database correctly using any tool at all ?  In other
>> words, are you certain that the password is correct ?
>>
>> Which encryption method is used ?  Is it the Microsoft-only one, or SEE,
>> or something else ?
>>
>> How are you specifying the password ?  (Make sure you don't paste the
>> real password into your reply !)
>>
>> System.Data.SQLite uses a Microsoft-only form of encryption.  In other
>> words, if you have a database made with the supported SEE encryption
>> method, it can't open it.
>> _______________________________________________
>> sqlite-users mailing list
>> [hidden email]
>> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>>
>
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Connection with SQLite db encrypted

Simon Slavin-3
In reply to this post by Luca Scurati
On 27 Nov 2019, at 7:22am, Luca Scurati <[hidden email]> wrote:

> I ecnrypt the db through the DB Browser for SQLCipher tool. If I try to access the database from this application, it works.Do you have any other method for encrypt a SQLite db?

SQLite databases can be encrypted in many different ways.

The encryption method used by SQLCipher is not the same as the default encryption used by Microsoft.Data.Sqlite or System.Data.SQLite.  If you want to use it, read the documentation for SQLCipher on how to access your database in your own software.

<https://www.zetetic.net/sqlcipher/documentation/>

I'm sorry but I don't know enough about Windows to advise you further, but perhaps someone else does.
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Connection with SQLite db encrypted

Luca Scurati
Ok, thanks!

Il giorno mer 27 nov 2019 alle ore 08:29 Simon Slavin <[hidden email]>
ha scritto:

> On 27 Nov 2019, at 7:22am, Luca Scurati <[hidden email]> wrote:
>
> > I ecnrypt the db through the DB Browser for SQLCipher tool. If I try to
> access the database from this application, it works.Do you have any other
> method for encrypt a SQLite db?
>
> SQLite databases can be encrypted in many different ways.
>
> The encryption method used by SQLCipher is not the same as the default
> encryption used by Microsoft.Data.Sqlite or System.Data.SQLite.  If you
> want to use it, read the documentation for SQLCipher on how to access your
> database in your own software.
>
> <https://www.zetetic.net/sqlcipher/documentation/>
>
> I'm sorry but I don't know enough about Windows to advise you further, but
> perhaps someone else does.
> _______________________________________________
> sqlite-users mailing list
> [hidden email]
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users