Password Protect a "better-sqlite3" DB file

539 views Asked by At

I have an electron-angular-node project which has few tables. I am using :

  • electron version: 13.1.7
  • Angular CLI: 12.0.2
  • Node: 16.17.0
  • Package Manager: npm 9.2.0
  • OS version: Windows 10
  • better-sqlite3: 7.4.6

I need to protect the DB file in case anybody wants to change data from the db. I wants to lock it using some password and at the same time application should be able to use DB when needed.

My main question is:

Is it possible to password protect a better-sqlite3 DB file. I'm searching for some free open source solution.

1

There are 1 answers

4
Jsperk On

Yes, it is possible to password protect a better-sqlite3 DB file.

However, it is not a built-in feature of the database engine and would require additional code implementation.

One open source solution that could be used is SQLCipher, which is a free, open-source extension for SQLite that provides transparent 256-bit AES encryption of database files. SQLCipher can be integrated with better-sqlite3 to provide password protection for the DB file.

Regards!