简体   繁体   English

使用sqlite3.exe从加密的sqlite数据库获取数据

[英]Get data from encrypted sqlite database using sqlite3.exe

I have a password protected database which I have created using System.Data.Sqlite.dll in .net windows application. 我有一个密码保护的数据库,该数据库是使用.net Windows应用程序中的System.Data.Sqlite.dll创建的。

Now I want to write a script to fetch data from this database using sqlite3.exe. 现在,我想编写一个脚本以使用sqlite3.exe.从此数据库中获取数据sqlite3.exe. How to provide password using sqlite3.exe and get the data from this database? 如何使用sqlite3.exe提供密码并从该数据库获取数据? If I directly use the select command, it throws error: "Error: file is encrypted or is not a database" 如果我直接使用select命令,则会引发错误: "Error: file is encrypted or is not a database"

After opening the database via sqlite.exe, use PRAGMA KEY before issuing any additional SELECT/etc. 通过sqlite.exe打开数据库后,在发出任何其他SELECT / etc之前使用PRAGMA KEY。 statements: 声明:

PRAGMA KEY="MyPassword";

EDIT : It looks like System.Data.Sqlite.dll does not use the semi-standard encryption code found in many SQLite binaries. 编辑 :看起来System.Data.Sqlite.dll不使用在许多SQLite二进制文件中找到的半标准加密代码。 Instead, it uses the Windows Crypto APIs. 而是使用Windows Crypto API。 The above answer will not work. 上面的答案不起作用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM