Willena / sqlite-jdbc-crypt

SQLite JDBC Driver with encryption support
Apache License 2.0
172 stars 33 forks source link

file is not a database #44

Closed xinhuangi closed 3 years ago

xinhuangi commented 3 years ago

I want to use SQLite-JDBC-crypt to decrypt SQLite instead of sqlcipher. I have encountered some problems. I am not sure how to solve them

sqlite> PRAGMA cipher_default_kdf_iter = 4000; sqlite> PRAGMA key = '64846df'; ok sqlite> PRAGMA cipher_use_hmac = OFF; sqlite> PRAGMA cipher_page_size = 1024; sqlite> PRAGMA cipher_compatibility = 1; sqlite> select * from rcontact;

        Connection connection = null;
        // create a database connection
         connection = DriverManager.getConnection("jdbc:sqlite:/Users/apple/Downloads/EnMicroMsg.db? 
                                 cipher=sqlcipher&hmac_use=0&legacy=1&kdf_iter=4000
                                &legacy_page_size=1024&key=64846df&compatibility=1");
         Statement statement = connection.createStatement();
        statement.setQueryTimeout(30);  // set timeout to 30 sec.
         ResultSet rs = statement.executeQuery("select * from rcontact");

1.The use of sqlcipher is normal, and SQLite JDBC crypt decryption appears [SQLITE_ NOTADB] File opened that is not a database file (file is not a database) I'm not sure how to solve this problem. I hope you can help me

zyxnice commented 1 year ago

@xinhuangi 你好,这个问题是解决了吗? 我现在连一个加密的sqllite文件也提示 [SQLITE_NOTADB] File opened that is not a database file (file is not a database)