How to protect SQLite database with password.
Hi,
I am looking for an option to protect the SQLite database being used by one of my applications. The main idea is to protect the database from unauthorized users. This option is available in DOTNET library but the same is not available here.
Please let me know your comments.
In DOTNET package we have a method like - connectoion.setPassword("yourpassword"); And if we need to access the database, we need to mention the password in the connection string. I am expecting this with Java SQLITE driver also. Is there any such option?
@jayakrishna-v There isn't a corresponding feature in sqlite-jdbc directly. You would need to substitute with a SQLite library that is complied with encryption support. A few options include SEE or SQLCipher, or you could try to build your own. Those would not be directly. compatible with the encryption used in the ADO.NET package unless you extracted that out of the ADO.NET provider and implemented your own compatible codec.
is this solution working ?
Connection connection = DriverManager.getConnection("jdbc:sqlite:db.sqlite", "", "S3cr3T");
Is this still relevant with the latest version? Can we close this?
See https://github.com/xerial/sqlite-jdbc/blob/master/USAGE.md#how-to-use-encrypted-databases