Closed sayyoudongdong closed 4 years ago
this is my code: public static void createTable(){ try { con=getCon(); Statement stat=con.createStatement(); stat.execute("pragma key='key'"); int b = stat.executeUpdate("create table tbl_smu_alarm_event(" + "id integer primary key autoincrement," + "alarm_in_code character varying(32) not null" ");");
The issue is a bit unclear. Can you clarify ?
I used the jdbc to encrypt a database test.db,then I use sqlcipher client to decrytion test.db(pragma key='key'),but it throws file is not a database.
This is my encrypt code public static void createTable(){ try { con=getCon(); Statement stat=con.createStatement(); stat.execute("pragma key='key'"); int b = stat.executeUpdate("create table tbl_smu_alarm_event(" + "id integer primary key autoincrement," + "alarm_in_code character varying(32) not null" ");");
You should have a look at the specific parameters that are applied by default on both sides (in the jdbc connector and in the sqlcipher client)
The page that gives all available parameters for the jdbc connector is here https://github.com/Willena/sqlite-jdbc-crypt#aes-256-bit-cbc---sha1sha256sha512-hmac-sqlcipher
Do not forget to select the cipher type you want to use in the jdbc connector ! See https://github.com/Willena/sqlite-jdbc-crypt#introduction-1 See https://github.com/Willena/sqlite-jdbc-crypt#configure-using-uri
You will need to change the java code to add the different parameters, if everything is the same on both side then both tool will be able to open the file.
Closing issue due to inactivity. Feel free to reopen if necessary.
I use sqlite-jdbc to encrypt a database,then I use sqlcipher which I compile to decrytion the database.But failed,please help me,thank you very much.