I have an encrypted database using "SQLite Cipher". When I try to connect to the database using Connection string the following error message appears:
'SQL logic error Cannot use "Password" connection string property: library was not built with encryption support.'
Imports System.Data.SQLite
Public Class frm_projects
Dim dtset As New SQLiteConnection("Data Source=Setting.db;Password=m;")
Private Sub frm_projects_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Try
If dtset.State = ConnectionState.Closed Then
dtset.Open()
End If
Catch ex As Exception
MsgBox(ex.Message, MsgBoxStyle.Information, "Warning")
End Try
End Sub
End Class
I assume that the actual reason for this error is the the lack of support in "legacy CryptoAPI" since System.Data.SQLite
version ~1.0.113.1.
It was done in the following commit: https://system.data.sqlite.org/index.html/info/1dd56c9fd59a10fd
Manually Use the last NuGet version with CryptoAPI support - 1.0.112.2.
Notice - It must be done manually - either by editing PackageReference
in csproj
or by editing config.packages
.
the reason is that older versions are unlisted (!) from the NuGet feed:
Buy perpetual source code license for SQLite Encryption Extension
(SEE
) which costs one time fee of 2000$ (as of Feb 2021) - purchase link
Use SQLCipher
- SQLCipher is an SQLite extension that provides 256 bit AES encryption of database files - GitHub source (haven't tested it myself!)