Willena's sqlite-jdbc-crypt driver for sqlite3 database encryption

32 views Asked by At

I am trying to get a sqlite3 encrypted database by using Willena's driver:

https://github.com/Willena/sqlite-jdbc-crypt

I have added the driver and the rest of required dependencies to my NetBeans project, but even by following strictly the described steps, the resulting file is not encrypted and can be opened with no request password.

The code is as follows:

private File DBFile;
private Connection sqliteConnection = null;

try {

    String fullpath;
    fullpath = DBFile.getPath();
    fullpath = "jdbc:sqlite:" + fullpath;

    sqliteConnection = new SQLiteMCConfig.Builder().setCipher(CipherAlgorithm.SQL_CIPHER).withKey("myKey").build().createConnection(fullpath);
        
    if(sqliteConnection != null){
        DatabaseMetaData metaDBSQLite = sqliteConnection.getMetaData();
    }
    
} catch (SQLException e) {
        
        JOptionPane.showMessageDialog(null, e.getMessage());
        
}

As I mentioned, the database file is created but it is not encrypted.

0

There are 0 answers