resilar / sqleet

SQLite3 encryption that sucks less
The Unlicense
375 stars 55 forks source link

Is there some database management tools that support for sqleet decrypting? #7

Closed chliang closed 6 years ago

chliang commented 6 years ago

Is there some database management tools that support for sqleet decrypting?

resilar commented 6 years ago

sqleet is only 2 weeks old so there is not currently specialized support for it. However, tools and libraries that are built on top of the SQLite3 command-line interface should work out of the box (the key/rekey PRAGMAs are the de facto standard way to manage encryption keys via the CLI). It seems, though, that most of the popular database management tools link against SQLite3 and use the C API directly instead of the CLI.

Fortunately, at least sqlitebrowser was straightforward to get to work with sqleet on Linux. The idea is to compile sqlitebrowser with its built-in SQLCipher support and load sqleet as a shared library using the LD_PRELOAD trick:

$ git clone https://github.com/resilar/sqleet/ ~/sqleet
$ curl -sL https://github.com/sqlitebrowser/sqlitebrowser/archive/v3.10.1.tar.gz | tar xzf -
$ cd sqlitebrowser-3.10.1/
$ qmake DEFINES+=ENABLE_SQLCIPHER && make
$ gcc -fPIC -shared ~/sqleet/sqleet.c -o libsqleet.so -lpthread -ldl
$ LD_PRELOAD=$PWD/libsqleet.so ./src/sqlitebrowser

If the sqlitebrowser build fails in src/sqlite.h:10 due to missing #include <sqlcipher/sqlite3.h>, try removing the sqlcipher/ folder from the path, i.e., sed -i 's/sqlcipher\///' src/sqlite.h. See BUILDING.md in the root of the sqlitebrowser source tree for thorough build instructions.

... and you can obviously always decrypt sqleet databases and then use any existing SQLite3 DB management tools.

chliang commented 6 years ago

@resilar thank you for your clearly explanation.