How to open SQLCipher passwrd protected file in Datagrip

Hi,

how can I open an SQLCipher password protected database file?

Datagrip does not give me an option to use a password.

At the moment I am forced to use SQLite Studio.

 

Thanks for your help.

Arthur

8 comments
Comment actions Permalink

Hello Arthur,

Let's try this:

Please download sqlite-jdbc-3.31.1.jar from https://github.com/Willena/sqlite-jdbc-crypt/releases

Go to DataGrip, File -> New -> Driver,  name it like 'SQLCipher', add to 'Driver files' recently downloaded package, add to 'URL templates' something like

default        jdbc:sqlite:!(:memory:){file::identifier.sqlite}?{password}

(you can see examples in native SQLite driver)

Go to "Options" tab and set Icon and Dialect to 'SQL lite'. Click Apply.

Now you can add Data Source of that type. Probably you will need to play around with parameters in connection URL.

Let me know the results.

 

Best regards,

Yuri

1
Comment actions Permalink

Hi Yuriy

I follow your steps, I still can not open SQLCipher password protected database file.

The error message is "[26] [SQLITE_NOTADB] File opened that is not a database file (file is not a database)."

0
Avatar
Yuriy Vinogradov
Comment actions Permalink

let's try this - open SSH/SSL tab, check 'use SSL'  and try again.

0
Comment actions Permalink

I check "use SSL" but still can not open it.

The error message is "[26] [SQLITE_NOTADB] File opened that is not a database file (file is not a database)."

I don't have CA file, Client certificate file, Client key file. I only have database's password.

BTW, the database file is from my developed App. The App use SQLCipher plugin to protect database file.

0
Comment actions Permalink

Hi Alan, did you find a solution to the problem with the password protected SQLcipher Database connection in Datagrip?

0
Comment actions Permalink

No, I don't find a solution. But I use DB Browser for SQLite to open Database with the password protected.

0
Comment actions Permalink

I got it to work with the sqlite-jdbc-crypt https://github.com/Willena/sqlite-jdbc-crypt driver and the following connection string:

jdbc:sqlite:/path/to/my/encrypted.db?cipher=sqlcipher&key=thepassword

If you click on "Test connection" it should successfully open the database. In case the provided key is wrong it fails with "[26] [SQLITE_NOTADB] File opened that is not a database file (file is not a database)."

Hope this helps.

 

 

1
Comment actions Permalink

Yuriy Vinogradov , Bernhard Caspar thank you, the guide helped.
I use sqlcipher v3 encrypted databases, so I also had to set parameter legacy=3 and cipher=sqlcipher. It can be passed in URL

jdbc:sqlite:/path/to/my/encrypted.db?cipher=sqlcipher&key=thepassword&legacy=3

 or be set in Advanced card

https://github.com/Willena/sqlite-jdbc-crypt#aes-256-bit-cbc---sha1sha256sha512-hmac-sqlcipher

 

1

Please sign in to leave a comment.