1

I am creating database with Qtsql.QSqlDatabase using with in python. I want to protect my Database with password. I am using this database for my desktop applications. If it is possible, How to do this. or is there any or other databases way to create database with password protected.

db = QtSql.QSqlDatabase.addDatabase("QSQLITE")#database
db.setDatabaseName("project.db")

1 Answer 1

2

Sqlite doesn't come with encryption built in, however you can enable encryption in sqlite by either purchasing the official paid extension here for $2000. Or you can take a chance on one of the free alternative like this one. I have no idea how well the free versions will work, but I imagine the paid one is quite robust and up to date.

You will also need to build a custom qt sql driver by following the instructions here. And finally you must run this sql immediately after opening the database

PRAGMA key='your-secret-key';

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.