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")
asked Oct 13, 2020 at 17:57

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';
answered Oct 13, 2020 at 18:51

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.