Home > database >  How to make it so that the user cannot modify the sqlite3 database when distributing
How to make it so that the user cannot modify the sqlite3 database when distributing

Time:05-14

I have created a python script that uses a database, which I have to pass in the file when compiling the .exe to a file. I would like to know if it is possible that the user to whom I give the file cannot edit the database (in a simple way)

enter image description here

I would like the file to be uneditable

CodePudding user response:

It would be possible to encrypt the file using a module like cryptography. But a determined attacker will always manage to find the encryption key in the executable (and this would probably cause some problems in the code)

To my knowledge, it is not possible to make a local file completely uneditable

CodePudding user response:

SQLite provides encryption functionality by itself. But it need some extra licence.

You can check the wiki: https://www.sqlite.org/see/doc/release/www/readme.wiki If you can protect the encryption key, you will be able to protect the db file. In the past, I've ever use the SEE integrated with sqlite. It's helpful in device application when shipping the app with data.

If you want to customize the encryption yourself, yes, you can check some opensource cryptography library to integrate it.

  • Related