Forum > General

How Do I Add A Password to a SQLite Database File?

(1/5) > >>

PasCoder:
Dear Friends,
I hope you're all fine and doing well. I'm creating an App using SQlite Database File but I don't want the user to open the database files since they may misuse the data therein. How can I achieve my goal? I want only my App to be able to open the database files. It seems the sqlite3.dll does not allow using passwords!!!

Thanks

tt:

--- Quote from: PasCoder on December 06, 2022, 10:26:02 am ---I want only my App to be able to open the database files.

--- End quote ---

You could encrypt/decrypt the db file from inside your application, but this does not prevent your users to open the file while application is running, unless you do not make the temporarily un-encripted file not accessible by means of operating system file access features.

To be onest? SQLite is not intended to support this user/password features, so maybe is not the right tool for your needs. Perhaps your should consider using a DBMS that has this feature built in.

PasCoder:
Thank you for your quick response but still I don't like to use big RDMS like SqlServer, MySQL, etc. Is there any other file-based database like SQLite that I can use for my purpose while supporting password protection?

Thanks

Zvoni:
There are two ways to get something like that in SQLite:
1) You have to compile SQLite yourself incl. the "authentication"-module
2) You have to compile (or get it from somewhere) SQLite incl. encryption. Look for SQLite with SEE

"Off-the-Shelf"-SQLite provides neither of those two

EDIT: Why would you need "authentication" for a filebased Database?

PierceNg:

--- Quote from: tt on December 06, 2022, 10:50:13 am ---
--- Quote from: PasCoder on December 06, 2022, 10:26:02 am ---I want only my App to be able to open the database files.

--- End quote ---

You could encrypt/decrypt the db file from inside your application, but this does not prevent your users to open the file while application is running, unless you do not make the temporarily un-encripted file not accessible by means of operating system file access features.

--- End quote ---

With SQLite transparent encryption, there is no need to decrypt the entire database file.

How it works: As data is read into the application, it is decrypted. Whatever data not read by the application remains encrypted on disk. As data is written, it is transparently encrypted.

Navigation

[0] Message Index

[#] Next page

Go to full version