Vin*_*hwa 16 encryption terminal sqlcipher
问题很简单
我有的是:
我需要的是:
Vin*_*hwa 35
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
Run Code Online (Sandbox Code Playgroud)
$ 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;
Run Code Online (Sandbox Code Playgroud)
在〜/ plaintext.db找到解密的数据库,您可以在任何sqlite浏览器中使用这个数据库.
http://sqlitebrowser.org现在支持sqlcipher数据库.那很整齐.
小智 10
此shell脚本将解密名为mydb.db的SQLCipher数据库并创建一个名为mydb-decrypt.db的数据库.参数是$ 1 =密钥,$ 2,读写路径.
#!/bin/bash
echo "Decrypting $2 using key $1"
echo "PRAGMA key='$1';select count(*) from sqlite_master;ATTACH DATABASE '$2/mydb-decrypt.db' AS plaintext KEY '';SELECT sqlcipher_export('plaintext');DETACH DATABASE plaintext;" | sqlcipher $2/mydb.db
echo "Done."
Run Code Online (Sandbox Code Playgroud)
如果你想在一个命令行中执行此操作,那么它的内容是:
echo "PRAGMA key='$1';select count(*) from sqlite_master;ATTACH DATABASE '$2/mydb-decrypt.db' AS plaintext KEY '';SELECT sqlcipher_export('plaintext');DETACH DATABASE plaintext;" | sqlcipher $2/mydb.db
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
49218 次 |
| 最近记录: |