I have developed application using SQLCipher in android. It is secure way to protect your Database file into application. It is working fine for encryption, but i want decrypt the encrypted DB file and want to look into SQLite Browser.
Actually I have lots of table and its data available. Now if i want to look into the encrypted DB data, there is no way to look into it (Only Logs available to view data).But Using SQLite Browser i can't see it.
I am using "info.guardianproject.database.sqlcipher.SQLiteDatabase"
I have tried many ways to decrypt it and look into SQLite Browser but it is giving error "An Error Occured : file is not a sqlite3 database".
can any one help me out for decryption of the encrypted DB file.
OR should i copy the encrypt the DB file and decrypt it using "info.guardianproject.database.sqlcipher.SQLiteDatabase" and use it to view all of the tables.
Thanks,
Mishal Shah
SQLCipher is an open source library that provides transparent, secure 256-bit AES encryption of SQLite database files.
To decrypt a file:In the Specify Solution Options dialog box, select Remove Database Encryption. For Encryption Password, enter the current encryption password for the database files. FileMaker Pro only: For FileMaker Account, click Specify.
Using SQLCipher, an application uses the standard SQLite API to manipulate tables using SQL. Behind the scenes the library silently manages the security aspects, making sure that data pages are encrypted and decrypted as they are written to and read from storage.
The The SQLite Encryption Extension provides an easy way to create, read and write encrypted database files. It may be used with the SQLite Android bindings to add encrypted database capability to any application.
You need to use a SQLite utility that has the SQLCipher extensions as part of it. You can download and build the SQLCipher code on Linux, which should give you a sqlite3
utility that you can use to access the database (with the appropriate PRAGMA
statements for specifying the passphrase, etc.).
I resolved this by using pulling the database from the device and decrypting it. The script below will generata a decrypted database file. This file can be opened with a SQLite-viewer.
#!/bin/bash
# Bashscript to decrypt databases
echo "pull db from device.."
adb pull /data/data/com.example/databases/database.db
echo "removing previous decrypted db, if existent.."
rm -r decrypted_database.db
echo "decrypting database.db into decrypted_database.db"
sqlcipher -line database.db 'PRAGMA key = "encryption_key";ATTACH DATABASE "decrypted_database.db" AS decrypted_database KEY "";SELECT sqlcipher_export("decrypted_database");DETACH DATABASE decrypted_database;'
Should be in your PATH:
Replace in script:
Note: Device should be rooted
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With