打开AC#SQLITE-NET-SQLCYPHER数据库,反之亦然
情况:Windows 11-最新更新; .NET 6控制台应用 - 最新更新; sqlite-net-sqlcypher nuget软件包(1.8.116) - 最新版本; Visual Studio(2019和2022)和Rider-所有最新版本)
我创建了一个少量测试应用程序(请参见下文)
var options = new SQLiteConnectionString(databasePath, true, "testpassword");
var db = new SQLiteConnection(options);
db.CreateTable<AttributionRecord>();
db.InsertOrReplace(new AttributionRecord(-1, "Test01", "Me", "Test Attribution 01"));
string queryString = "select * from AttributionRecord";
List<AttributionRecord> list = db.Query<AttributionRecord>(queryString);
foreach (AttributionRecord attributionRecord in list)
{
Console.WriteLine($"{attributionRecord.Id} - For Who : {attributionRecord.AttributionForWho} - For What : {attributionRecord.AttributionForWhat} - Attribution : {attributionRecord.Attribution}");
}
,所有功能都可以正常工作,而我(最终)具有加密的SQLITE数据库。但是,当我尝试在DB浏览器(旧版本(3.10.1)和较新版本(3.12.1))中,甚至在购买的应用程序中打开我新创建的数据库之一时:
相反的情况也是正确的,当我尝试打开一个用SQLCypher保护并通过管理者创建的数据库时,我无法在C#(SQLite Exception-文件不是数据库)中打开它。
这不是关于Stackoverflow的其他问题的重复,我尝试了所有内容。对于较旧的DB浏览器,我将4096用作页面大小,因为该页面是SQLCypher数据库的默认页面大小。
Situation : Windows 11 - Latest updates; .NET 6 console app - latest updates; sqlite-net-sqlcypher nuget package (1.8.116) - also latest version; Both Visual Studio (2019 and 2022) and Rider - All latest versions)
I have created a little test application (see below)
var options = new SQLiteConnectionString(databasePath, true, "testpassword");
var db = new SQLiteConnection(options);
db.CreateTable<AttributionRecord>();
db.InsertOrReplace(new AttributionRecord(-1, "Test01", "Me", "Test Attribution 01"));
string queryString = "select * from AttributionRecord";
List<AttributionRecord> list = db.Query<AttributionRecord>(queryString);
foreach (AttributionRecord attributionRecord in list)
{
Console.WriteLine(quot;{attributionRecord.Id} - For Who : {attributionRecord.AttributionForWho} - For What : {attributionRecord.AttributionForWhat} - Attribution : {attributionRecord.Attribution}");
}
That all works fine and I (finally) have an encrypted SQLite database. But when I try to open one of my newly created databases in either DB Browser (older versions (3.10.1) and newer versions (3.12.1)) and even in a bought app : SQLiteManager (Version 4.8.3) (from SQLabs : https://www.sqlabs.com/sqlitemanager.php
indicated that they support sqlcypher encrypted databases), I just cannot seem to open the database.
The reverse is also true, when I try to open a database protected with sqlcypher and created via the managers, I cannot open it in c# (sqlite exception - file is not a database).
This is not a duplicate of some other question on stackoverflow and I have tried all what was to find on it. For the older DB Browser, I used 4096 as the page size as that was advertised as the default page size for sqlcypher databases.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用 sqlitestudio (版本3.3.3),我可以打开并编辑加密的数据库和表。
我有些失望的是,像SqliteManager这样的商业产品无法做免费产品。
老实说,我以前从未听说过Sqlitestudio,但这是一个不错的开源项目,可以完成这项工作。
With SQLiteStudio (version 3.3.3) I can open and edit my encrypted databases and tables.
I'm just a little disappointed that a commercial product like SQLiteManager is unable to do what a free product can.
To be honest, I had never heard from SQLiteStudio before, but it is a nice open source project that does the job.