My Python program uses the standard Python SQLite database (import sqlite3). All works, I want to cypher the database. I opened it with DB Browser (sqlitebrowser.org) that uses SQLCipher 3/4 and I ciphered it using a key (SQLCipher version 3). Which library must I use to reuse the most part of it?
I understand I need to import the new standard library (SQLCipher) and use code to connect with the database with a key. I don't want to rewrite my code if it's possible. How to do that?
CodePudding user response:
To manage encrypted SQLite databases in Python :
Download and install free DB Browser SQLite and encrypt your database with SQLCipher4 key.
Install the Python package to bind with SQLCipher4 database using
pip install sqlcipher3
. If this fails build and intall the package yourself:Copy "sqlite3.c" and "sqlite.h" from SQLCipher folder to SQLCipher3 folder.
Follow these steps to build SQLCipher3 package.
Install the package using
pip install path/to/sqlcipher3
.