Skip to content
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

Doesn't open SQLCİpherV4 db files #54

Open
aliyildiz1980 opened this issue Oct 26, 2021 · 6 comments
Open

Doesn't open SQLCİpherV4 db files #54

aliyildiz1980 opened this issue Oct 26, 2021 · 6 comments

Comments

@aliyildiz1980
Copy link

DB files encrypted with SqlCipher V3 can be opened successfully. However, V4 encrpyted files can not be opened. The following error is produced: File opened that is not a database file (file is not a database)

SQLiteMCSqlCipherConfig.getV3Defaults().withKey(Constants.DB_CIPHER).createConnection(url) opens V3 db files.
SQLiteMCSqlCipherConfig.getV4Defaults().withKey(Constants.DB_CIPHER).createConnection(url) doesn't open V4 db files.

@aliyildiz1980
Copy link
Author

DB files are created with SQLite DB Browser compiled with SqlCipher support.

@Chris-SP365
Copy link

Which version did you use?
In march a bug was fixed regarding V4 defaults.
Maybe you used an older version?

@aliyildiz1980
Copy link
Author

aliyildiz1980 commented Oct 27, 2021

I used both the latest version in maven, which 3.35.5.3 and latest release in github, which 3.36.0.

@Willena
Copy link
Owner

Willena commented Oct 27, 2021

I'll be assuming version is 3.36.0 or 3.35.5.3

Last year, I reported an issue to the maintainer of SQLiteMc for something related to sqli cipher v4. We discovered that the configuration was not applied correctly and that the legacy parameters was important and must be the first.
I looked into ou code and it seams that we might have the wrong order of parameters.
But as it should all be defaults this shouldn't have any effect...

For testing purposes, you can try to open the database using parameters in the URL: file://mydbfile.db?cipher=sqlcipher&legacy=4&key=myKey

@aliyildiz1980
Copy link
Author

Unfortunately, it doesn't work. Further, I tried with all versions down to v3.33.0. Only v3.33.0 opened the db. Even v3.33.0.1 didn't open. Hwoever, problem with v3.33.0 is that it is not possible to attach another unencrypted db file with the following sql command: <<ATTACH DATABASE user.db AS user KEY ''>>

@aliyildiz1980
Copy link
Author

This sql command works with SQLCipher Android driver provided the developer company. So I assumed the same would work. Is this a bug or is sql command to attach unencrypted dbs wrong?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants