-
-
Notifications
You must be signed in to change notification settings - Fork 82
Incompatible SQLCipher 4 database (SQLite3MultiplerCiphers vs DB Browser for SQLite) #47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
As far as I know Microsoft.Data.Sqlite with SQLitePCLRaw.bundle_e_sqlcipher is based on the original public SQLCipher version, and therefore it will use the default settings of SQLCipher.
DB Browser for SQLite (SQLCipher) is also based on the original public SQLCipher version. There are other SQLite management tools available like SQLiteStudio, using SQLite Multiple Ciphers and allowing to control how the encryption extension should operate.
Looking at the commands you used to open the database file, this is not really surprising. While the original SQLCipher library, and hence DB Browser for SQLite (SQLCipher), operate in what I call legacy mode, the default for SQLite Multiple Ciphers is to operate in non-legacy mode. For details please read the chapter Legacy Cipher Modes in the SQLite3 Multiple Ciphers documentation.
To open a database file created with a legacy version of SQLCipher you need to tell SQLite3 Multiple Ciphers to use the legacy mode: PRAGMA cipher='sqlcipher';
PRAGMA legacy=4;
PRAGMA key='passphrase'; If you want to create a SQLCipher encrypted database file with SQLite3 Multiple Ciphers in such a way that it can be accessed with legacy tools, you have to use |
@utelle |
You are welcome. I assume the issue can now be closed. If not, feel free to re-open it. |
I need some help @utelle , in my application i only use pragma I try those configuration in Password:
Configuration:
I don't know how to set right configuration... |
If your application uses SQLite3MC in default mode (that is, without explicitly setting the cipher scheme), your application will use the default cipher scheme - which is
With SQLiteStudio version 3.3.3 (released in April 2021) you can add the database by executing the menu option "Database/Add Database". In the dialog that opens, you select
And that should be enough.
If you select in SQLiteStudio the database type |
@utelle thank for you help, i get it now. |
I created a database using Microsoft.Data.Sqlite with SQLitePCLRaw.bundle_e_sqlcipher. I'm a newbie to these libraries. I didn't specify any special options. So I believe the database is formatted with the defaults of SQLCipher Version 4.
I could browse the contents with DB Browser for SQLite (SQLCipher). The default options for SQLCipher 4 were applied to open it.
I'm a maintainer of TkSQLite-Cipher. So, I wanted to open the database with SQLite3MultipleCiphers too. But it couldn't decrypt the database.
This is SQL version of what TkSQLite-Cipher does. I used sqlite3mc_shell_x64.exe to run this SQL.
I also checked if the database created by SQLite3MultipleCiphers can be opened with DB Browser.
The database created by SQLite3MultipleCiphers is actually encrypted. It can be opened with sqlite3mc_shell_x64.exe and TkSQLite-Cipher.

I'm not sure which of SQLite3MultipleCiphers or Microsoft.Data.Sqlite is correct in that it follows the standard configuration of SQLCipher 4. I wish you could give me any advice.
The text was updated successfully, but these errors were encountered: