-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
File is encrypted or is not a database #84
Comments
Hi @jchristof What is the result code of performing your
will always fail as it will return a result set or 0 to N rows, so it can not be cast to a single string scalar value. You might try executing the following instead:
|
If I comment out everything but the following code the execute scalar succeeds when performed against the unencrypted db file:
Picture of the first bytes of the encrypted file: |
Also, if I just skip the file copy operations once the db has been encrypted and address the file without changing it's name the same problems are there:
|
Hello @jchristof Are you starting off with a plain text SQLite database to begin with? Are you able to query any data from the database before you attempt to migrate the database to an encrypted SQLCipher database? |
Yes, the db is plain text - here's a hex of the file prior to being encrypted: Also, yes I can query this file successfully as described in the prior post:
|
@jchristof A couple more questions:
|
Sorry for the urgency I'm getting down to the wire - any luck with the information? @sjlombardo I forwarded these files to you're email. Thanks. |
Hello @jchristof The links to your attached files are invalid, could you try resubmitting your plain-text database? |
I think the uploader accepts images only - I did attach and send them to Stephen and I can do the same for you if I can get you email. |
Also just tried this against the newly downloaded unencrypted db file:
No errors and no plaintext.db created. |
Hello @jchristof I believe the issue you are seeing is due to your
|
Code now:
The very next time a connection is opened with the new key - fails at Prepare() - 'file is encrypted or is not a database' Confirmed the first unencrypted file is present and confirmed the result encrypted file - all the files are being produced and the original is deleted as expected. Is there confirmation of another Windows 8 Phone project where this is confirmed working? |
Hello @jchristof We were able to open both your plain text database file as well as the encrypted database file with the SQLCipher command line tool. We were also able to open the plain text database file, attach, export and then open the encrypted database file, properly querying the count of the
|
I changed the variables to better document their values. Error thrown again at var scalar = db2.ExecuteScalar("select count(*) from sqlite_master;");
|
Hello @jchristof Could you submit a small sample application that only represents this particular issue you are seeing. |
Wow, the function worked in your demo - so I copied the contents of SQLite.cs from yours into ours - I find this in the diff:
One of our guys was unable to compile against rekey (he might still have the issue when grabs tomorrow he wouldn't have done this otherwise and probably accidentally checked this in) and removed the reference. Works now. |
Hi @jchristof Thanks for getting back to us, we are glad to hear your issue is resolved. |
This appeared to be working last week, but queries no longer work against the newly encrypted database.
produces the error in the title. The file does exist and is encrypted.
The text was updated successfully, but these errors were encountered: