sqlite-net icon indicating copy to clipboard operation
sqlite-net copied to clipboard

SQLite encryption/password protected

Open ferpega opened this issue 11 years ago • 19 comments

Nowadays, with praeclarum/sqlite-net, are there any way to encrypt an unencrypted database-file and/or open/connect to an already encrypted database-file ?

If it is not ready yet, will be very complex to implement it ?

Thanks.

ferpega avatar Jul 21 '15 07:07 ferpega

+1 on this please. Any information would be great.

benbristow avatar Aug 02 '15 19:08 benbristow

+1

adamfisher avatar Aug 27 '15 14:08 adamfisher

+1

penderi avatar Aug 27 '15 14:08 penderi

Same here

Maverick2805 avatar Aug 27 '15 15:08 Maverick2805

+1

mittt avatar Oct 16 '15 08:10 mittt

1

cabanel avatar Oct 19 '15 16:10 cabanel

+1

albireo avatar Feb 24 '16 16:02 albireo

+1 Goes without saying, the System.Data.Sqlite implementation uses it (https://system.data.sqlite.org/) - which i use for Desktop apps. And i'd LOVE to see it cross over into yours, which i use for mobile development. It definitely helps as an extra layer of security.

DamianSuess avatar Apr 04 '16 14:04 DamianSuess

+1, I would definitely love that too

silversens avatar Apr 23 '16 15:04 silversens

+1

yarmenteros avatar Nov 20 '16 18:11 yarmenteros

I have to admit I'm pretty ignorant of the encryption options out there for sqlite.

I've seen on other bugs (#476) that SQLCipher is brought up and that there would be some benefit to supporting them as a driver.

Would this be sufficient, or are there better approaches you would like to see implemented?

praeclarum avatar Nov 23 '16 17:11 praeclarum

It's worth it as a start.

DamianSuess avatar Nov 27 '16 19:11 DamianSuess

This is being worked on in #597

praeclarum avatar Aug 11 '17 22:08 praeclarum

I could use some help testing this out. Would you mind grabbing sqlite-net-sqlcipher 1.5.176-beta from nuget and testing with the new SetKey methods on the connection? Thanks!

praeclarum avatar Aug 13 '17 03:08 praeclarum

Just a heads up when I tested the new nuget out, I use SQliteExtensions which has a dependency on Sqlite-Net-PCL so it couldnt cope with conflicting dlls.

I therefore had to revert to the old way of doing it outlined here: https://github.com/praeclarum/sqlite-net/issues/508#issuecomment-301905452

Don't think its anything you can do in your library to fix that but its possibly worth noting

JKennedy24 avatar Jan 08 '18 13:01 JKennedy24

Since 1.5, the https://www.nuget.org/packages/sqlite-net-sqlcipher package is available. The API is changing a bit in 1.6.

Happy encrypting!

praeclarum avatar Jan 24 '19 02:01 praeclarum

Hi, I am trying to use -> sqlite-net-sqlcipher 1.6.292 in my winforms c# application for storing some client-side sensitive information, which I do not intend to save on our server.

When I try to open my sqlite db which is encrypted (password protected) - using SQLCipher 4 defaults method, I am able to open the same database using the DB Browser (SQLCipher) GUI...

While I try it using C# with following code

var databasePath = Path.Combine(Application.StartupPath, "profile.db"); var options = new SQLiteConnectionString(databasePath, true, key: "[email protected]"); conn = new SQLiteAsyncConnection(options);

I get following error: SQLiteException: file is not a database

Can you please suggest, whats best way to get through this,.?

nbaua avatar Jan 14 '20 06:01 nbaua

using SQLCipher 4 defaults

This is an issue I assume, I used SQLCipher 3 defaults and the problem is solved. Why not support the better cipher methods as well?

nbaua avatar Jan 14 '20 07:01 nbaua

@nbaua , you can check out my test repo as it may give you some assistance. The repo demos SQLite-Net and SQLite-Net-SQLCipher features using unit tests. https://github.com/DamianSuess/Test.SQLite.

DamianSuess avatar Jan 30 '20 00:01 DamianSuess