问题很简单
我拥有的是:
我需要的是:
最佳答案
下载并构建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中找到已解密的数据库,您可以将其与任何sqlt浏览器(例如this)一起使用。
更新:2015年9月
http://sqlitebrowser.org现在支持sqlcipher数据库。那很整齐。
关于encryption - 如何在命令行上解密加密的sqlcipher数据库文件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25132477/