I'm just learning to use SQLite and I was curious if such is possible:
Encryption of the database file?
Password protect opening of the database?
PS. I know that there is this "SQLite Encryption Extension (SEE).", but according to the documentation, "The SEE is licensed software...." and "The cost of a perpetual source code license for SEE is US $2000."
The .net library System.Data.SQLite also provides for encryption.
For projects using Javascript, the package written by journeyapps works seamlessly.
https://github.com/journeyapps/node-sqlcipher
It worked on Mac/Windows/Linux for me. It compiles SQLCipher on your platform. There is no need to pay for the licenses from Zetetic.
You can password protect SQLite3 DB. For the first time before doing any operations, set password as follows.
then next time you can access it like
This wont allow any GUI editor to view Your data. Later if you wish to change the password, use
conn.ChangePassword("new_password");
To reset or remove password, useconn.ChangePassword(String.Empty);
You can always encrypt data on the client side. Please note that not all of the data have to be encrypted because it has a performance issue.
You can get
sqlite3.dll
file with encryption support from http://system.data.sqlite.org/.1 - Go to http://system.data.sqlite.org/index.html/doc/trunk/www/downloads.wiki and download one of the packages. .NET version is irrelevant here.
2 - Extract
SQLite.Interop.dll
from package and rename it tosqlite3.dll
. This DLL supports encryption via plaintext passwords or encryption keys.The mentioned file is native and does NOT require .NET framework. It might need Visual C++ Runtime depending on the package you have downloaded.
UPDATE
This is the package that I've downloaded for 32-bit development: http://system.data.sqlite.org/blobs/1.0.94.0/sqlite-netFx40-static-binary-Win32-2010-1.0.94.0.zip
Yes, it's possible. If targeting .Net Standard 4.6.1+ or Core, I think a fairly straightforward to get Sqlite encryption is to use Microsoft.Data.Sqlite per my answer here.