Integration in System.Data.SQLite (.NET) #45
Replies: 9 comments 2 replies
-
I suppose you refer to System.Data.SQLite. As far as I know its implementation is based on the SQLite amalgamation source code. So the best approach will certainly be to replace the SQLite amalgamation by the SQLite3 Multiple Ciphers amalgamation (which is made available with each release or which can be created with a script from the original sources). However, additionally it will be most likely necessary to adjust the code in To enable the methods/functions to set the encryption key it will be necessary to define the symbol Additionally, it might be useful to make the additional API functions fo SQLite3 Multiple Ciphers available (in the same way as the functions An alternative might be Microsoft.Data.SQLite. There is for example a blog post by Brice Lambson, Encryption in Microsoft.Data.Sqlite. However, I have no idea whether integrating SQLite3 Multiple Ciphers into Microsoft.Data.SQLite is easier to accomplish. |
Beta Was this translation helpful? Give feedback.
-
Based on the latest officially released System.Data.SQLite code (namely version 1.0.113.0) I checked which modifications might be required to integrate SQLite3 Multiple Ciphers in System.Data.SQLite. A few minor adjustments to the code of SQLite3 Multiple Ciphers are required to make it compile with the solution files coming with System.Data.SQLite. These adjustments were applied in commit 5013599. Additionally, the property files as well as the project files of System.Data.SQLite need minor adjustments - adding compile time symbols in the property files, removing several source files which cause conflicts from the project files. As already mentioned mainly the source file |
Beta Was this translation helpful? Give feedback.
-
Thank you for the information (and the changes to your code). I will look into it and see if I can get it to compile. I might consider creating a project out of it on GitHub, as others might also be interested in it. |
Beta Was this translation helpful? Give feedback.
-
Looking at the System.Data.SQLite timeline I get the impression that the release of System.Data.SQLite version 1.0.114.0 will happen in the near future. Most likely integration of SQLite3 Multiple Ciphers into System.Data.SQLite will be easier to accomplish with that new version, because it will be already adapted to the latest SQLite version. So I would recommend to wait a few days (or to use a recent development snapshot). |
Beta Was this translation helpful? Give feedback.
-
I would be very interested in any solution allowing me to use SQLite3 Multiple Ciphers in .NET as I need to implement support for reading databases encrypted by wxsqlite3 (using AES128 CBC) in a .NET application. I had a quick look around and I feel like this might be easier to do with Microsoft.Data.Sqlite as it is using SQLitePCLRaw which is specifically built to use a variety of sqlite libraries. |
Beta Was this translation helpful? Give feedback.
-
Since SQLitePCLRaw seems to use SQLite DLLs, I see no reason why it should not work. The SQLite3 Multiple Ciphers DLLs provided with the releases support the same API as the original SQLite DLL. There are a few additional functions in the SQLite3 Multiple Ciphers interface, but they are not needed to make use of the SQLite3 Multiple Ciphers DLL, because the encryption extension can be configured via SQL pragma statements or via URI parameters (on opening a SQLite database). That is, renaming the DLL coming with SQLite3 Multiple Ciphers releases to sqlite3.dll should allow you to simply replace the DLL used by SQLitePCLRaw. However, in respect to security using SQLite DLLs is not ideal, because an attacker could easily intercept calls into the DLL. |
Beta Was this translation helpful? Give feedback.
-
Hi @MarcelVersteeg, Did you success making your own System.Data.SQlite? @utelle , |
Beta Was this translation helpful? Give feedback.
-
If you unzip the archive |
Beta Was this translation helpful? Give feedback.
-
I will convert this issue into a discussion, because the SQLite3 Multiple Ciphers amalgamation source code can be used as a drop-in replacement for the SQLite3 amalgamation source code used in System.Data.SQLite. As described in my previous post full integration in System.Data.SQLite is then only a matter of adjusting the file |
Beta Was this translation helpful? Give feedback.
-
Can you give a hint on how to use this project in the System.Data.SQLite assemblies/distribution so the ciphers can be used in .NET development?
Beta Was this translation helpful? Give feedback.
All reactions