pysqlite and SQLCipher

415 views
Skip to first unread message

ggray

unread,
May 28, 2010, 5:01:55 PM5/28/10
to SQLCipher Users
I'm Curious, anyone has modified the Python Wrapper to SQLite
(pysqlite) to make it work with the SQLCipher.dll ??, if not Sthepen
can you point me in the right direction to make a python wrapper?,
specially how y trigger the encription

Thank you

Stephen Lombardo

unread,
Jun 8, 2010, 3:34:07 PM6/8/10
to sqlc...@googlegroups.com
Hello,

I've never modified the Python Wrapper to SQLite. However, if it's anything like the Ruby wrapper, than you may be in luck. Basically, it depends on whether the python wrapper is using a statically linked sqlite, or if its loading a shared library (i.e. sqlite3.so or sqlite3.dll)

If it is using a If this is the case and you are on Linux or Mac, then using SQLCipher is as simple as building SQLCipher, installing it somewhere, and then changing the LD_LIBRARY_PATH environmental variable to reference the location of the sqlcipher .so library, i.e.

export LD_LIBRARY_PATH=/path/to/sqlcipher/lib:$LD_LIBRARY_PATH

On Windows, you'd need to build the sqlcipher dll target and then drop the new sqlite3.dll and the libeay32.dll into your path, or otherwise replace the versions used by Python.

As far as setting the key, you can just run something like this as a standard SQL statement as the first operation after opening the database:

PRAGMA key='secret';

I've used this technique pretty extensively with ruby for testing, and from some chatter on a Perl mailing list I believe the same works for with the Perl DBD Driver. Let me know if you end up getting it to work with Python too, it would be great to add to the docs.

Cheers,
Stephen

sam

unread,
Jul 28, 2010, 5:33:53 AM7/28/10
to SQLCipher Users
BTW I just posted something about this in the main group a few minutes
ago.

-Sam
Reply all
Reply to author
Forward
0 new messages