Skip to content
This repository has been archived by the owner on Nov 1, 2018. It is now read-only.

Support encyption #184

Closed
rowanmiller opened this issue Dec 2, 2015 · 10 comments
Closed

Support encyption #184

rowanmiller opened this issue Dec 2, 2015 · 10 comments

Comments

@rowanmiller
Copy link
Contributor

This is to track the high level scenario of encryption. We've speculated that it may already be possible with a custom build of SQLite or using extensions - but we've not actually tested this or provided any guidance.

@bricelam
Copy link
Contributor

bricelam commented Dec 3, 2015

It looks like SQLCipher can be used by replacing sqlite3.dll and issuing PRAGMA statements.

@bricelam
Copy link
Contributor

bricelam commented Dec 3, 2015

The same is true for SEE.

@bricelam
Copy link
Contributor

This works. I've posted Encryption in Microsoft.Data.Sqlite on my blog.

I don't think there's any additional work to do here. We could consider adding SetPassword and ChangePassword methods to SqliteConnection and allowing Password and HexPassword to be specified in the connection string, but these APIs would only work if you've included a copy of the native sqlite3 library that supports them.

@bricelam bricelam removed this from the Backlog milestone Jun 13, 2016
@bricelam
Copy link
Contributor

Also, #148 will improve the overall experience of using encryption.

@rowanmiller
Copy link
Contributor Author

Any thoughts on how possible this is when using EF? Guessing you have to supply your own connection externally?

@bricelam
Copy link
Contributor

@rowanmiller Yes, until we have an OnConnectionOpened hook, that's the easiest way.

@natemcmaster
Copy link
Contributor

an OnConnectionOpened hook

To be added to EF in dotnet/efcore#626? Or do you mean adding a hook in the ADO layer? I assume you mean EF as I don't know of another ADO implementations with this kind of hook.

@bricelam
Copy link
Contributor

An EF hook, yes. ADO.NET already has a connection state changed event.

@rowanmiller
Copy link
Contributor Author

Yeah in dotnet/efcore#5024 we discussed the idea of having some sort of "connection preamble" as there are lots of database provider specific features that would benefit from this (SQLite PRAGMA, SQL Server sharding, etc.).

@rowanmiller
Copy link
Contributor Author

Closing this out, will add a page to the docs that references blog post by @bricelam and shows how to use it with EF.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants