Download and Build sqlcipher
--Skip this if sqlcipher is already installed
Pull the code from
https://github.com/sqlcipher/sqlcipher in a directory (say ~/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
Decrypt the database to a plaintext database
$ 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;
Find the decrypted database at ~/plaintext.db which you can use with any sqlite browser like this.
Update : September 2015
http://sqlitebrowser.org now supports sqlcipher databases. That's neat.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…