加密 – 如何在命令行上解密加密的sqlcipher数据库文件?

问题很简单

我所拥有的是:

>我有一个使用sqlcipher加密的数据库文件.
>我还有用于加密此db文件的密码

我需要的是:

>我需要解密数据库文件/需要一个未加密/非加密/解密的数据库文件.

解决方法

下载并构建sqlcipher – 如果已安装sqlcipher,请执行此操作
从目录中拉出 https://github.com/sqlcipher/sqlcipher中的代码(比如〜/ sqlcipher)
mkdir ~/bld;        #  Build will occur in a sibling directory
cd ~/bld;           #  Change to the build directory
../sqlcipher/configure --enable-tempstore=yes CFLAGS="-DsqlITE_HAS_CODEC" LDFLAGS="-lcrypto"; 
                    #configure sqlcipher 

make install;       #  Install the build products

数据库解密为纯文本数据库

$cd ~/;
$./sqlcipher encrypted.db 
sqlite> PRAGMA key = 'testkey'; 
sqlite> ATTACH DATABASE 'plaintext.db' AS plaintext KEY '';  -- empty key will disable encryption
sqlite> SELECT sqlcipher_export('plaintext'); 
sqlite> DETACH DATABASE plaintext;

在〜/ plaintext.db找到解密的数据库,你可以使用任何sqlite浏览器,如this.

更新:2015年9月

http://sqlitebrowser.org现在支持sqlcipher数据库.那很整齐.

相关文章

SELECT a.*,b.dp_name,c.pa_name,fm_name=(CASE WHEN a.fm_n...
if not exists(select name from syscolumns where name=&am...
select a.*,pano=a.pa_no,b.pa_name,f.dp_name,e.fw_state_n...
要在 SQL Server 2019 中设置定时自动重启,可以使用 Window...
您收到的错误消息表明数据库 'EastRiver' 的...
首先我需要查询出需要使用SQL Server Profiler跟踪的数据库标...