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

Twitter query: PRAGMA support with SQLCipher? #264

Closed
justinclift opened this issue Apr 17, 2015 · 12 comments
Closed

Twitter query: PRAGMA support with SQLCipher? #264

justinclift opened this issue Apr 17, 2015 · 12 comments

Comments

@justinclift
Copy link
Member

Query from Twitter:

    https://twitter.com/niall111/status/589078702132166656

Tried app with cipher support here … but we use a pragma key and want to browse DB with it, possible?

and:

    https://twitter.com/niall111/status/589119373006213120

We use a pre-generated hex pragma key to encrypt the DB in Unity, and want to be able to view it without requiring Unity.

Any ideas? @MKleusberg ? 😄

@niall111
Copy link

To perhaps clarify a bit more outside of the twitter character limit! We have a SQLite DB in our Unity project, and a requirement was encryption. sqlcipher wasn't supported by the SQLite Unity plugin we used (https://www.assetstore.unity3d.com/en/#!/content/4334), so we had to use their "PRAGMA key = X" to encrypt the DB on devices. We would love a way to then use sqlitebrowser to decrypt the contents of this DB after pulling it off a device and entering our key. I grabbed the latest nightly build of sqlitebrowser as well as the cipher-enabled version, but neither of them will decrypt our DB. (though i'm unsure if changing the "page size" value in sqlcipher version would help, I have no idea what value I'd use there)

The format of key we're using is: 0x5c516e4e21a65b8fee841db84b462367

(some digits changed to protect the innocent, but length remains the same as what we're using)

@hukacode
Copy link

hukacode commented Sep 4, 2015

Will you develop Cipher for Windows?

@justinclift
Copy link
Member Author

It would be good to have, but we're low on developer time at the moment. If you have the skill to get it working, your assistance would be welcome. 😄

@hukacode
Copy link

hukacode commented Sep 9, 2015

I wish I can, but my skill is not good. Exactly I don't have experience. :)

@Z4us
Copy link

Z4us commented Sep 9, 2015

Simple suggestion (perhaps too simple to be a true solution)
First decrypt with your key;
Then encrypt with cipher embedded in DB4S

@oliverw
Copy link

oliverw commented Jan 17, 2017

@justinclift Has been made any progress on this?

@MKleusberg
Copy link
Member

From what I understand this is an issue with the key formats we support. SQLCipher allows text key (like 'my passphrase') as well as raw keys (like '0xabcdef0123456789'). Since we only support the text key format all databases encrypted using the raw key format can't be opened. At least that's how I understand the issue, and either way: this definitely needs to be fixed 😃

I've just added some code for this, so the next nightly build will have support for the raw key format. So please give that new version a test 😃 Chances are that it's working when changing the format to 'Raw key' in the cipher dialog and then enter the key in the '0x...' format.

However, I can't guarantee that it's working for databases created with that Unity plugin because I couldn't find much information about the encryption used in that plugin. If they don't rely on SQLCipher internally my fix won't work. But as I said, it's definitely worth a try!

@justinclift
Copy link
Member Author

I've just emailed the contact point (orangetree@) for the Unity plugin developers, pointing them at this issue + asking if they're using SQLCipher for the encryption layer.

Hopefully we get a response back, and they use SQLCipher. If they do, this might all be workable. 😉

@justinclift
Copy link
Member Author

Hmmm, looking at discussions about that Unity plugin... it seems like it's not actively developed any more. 😦

@MKleusberg
Copy link
Member

Oh 😦 But well, the hex input is definitely an improvement in DB4S anyway 😉

@justinclift
Copy link
Member Author

Good point. 😄

In the meantime I've added the response requested label, so we come back to this issue in a few days time if I don't get a response to the email first.

@justinclift
Copy link
Member Author

No response from the Unity plugin people. 😦

Closing this issue.

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

No branches or pull requests

6 participants