SQLCipher entering passphrase and encoded raw key not working
Details for the issue
What did you do?
Hi, I was trying out the SQLCipher functionality of sqlitebrowser and had some weird behaviour. I created a Test.db (attached with .env, default SQLCipher 4 values) with a raw key (0x61) and tried to open it using the - hexdecoded - passphrase (a).
I also tried to insert 0x00 before and after raw key until 64 characters, because from Pragma Key Documentation I was not sure if the application is responsible of passing exactly 64 characters.
What did you expect to see?
As far as I understood it should be possible to either enter the rawkey or the password with sqlitebrowser(SQLCipher). Did I miss something?
What did you see instead?
Could not access Database.
Useful extra information
The info below often helps, please fill it out if you're able to. :)
What operating system are you using?
- [x] Windows: ( version: Windows 10 64bit )
- [ ] Linux: ( distro: 11.2.1 )
- [x] macOS: ( version: ___ )
- [ ] Other: ___
What is your DB4S version?
- [x] 3.12.2
- [ ] 3.12.1
- [ ] 3.12.0
- [ ] 3.11.x
- [ ] Other: ___
Did you also
- [] Try out the latest nightly version: https://github.com/sqlitebrowser/sqlitebrowser#nightly-builds
- [x] Search for an existing similar issue: https://github.com/sqlitebrowser/sqlitebrowser/issues?utf8=%E2%9C%93&q=is%3Aissue%20
When setting the encryption (or entering the key) did you set the dropdown to 'raw key' ?

Note when you do this, the textbox expects '0x' as a prefix, so enter this first.
Yes, selection for passphrase/raw key was was definitely correct. I tried GUI and .env file. Both same result.
And prefix 0x was also correct (not possible to miss that cause GUI requires it before entering raw key).
It is really easy to test.
- Just create sample DB and encrypt using default. SQLCipher 4 settings.
- Use some a simple passphrase (e.g. a)
- Opening DB with raw key and enter encoded password (e.g. 0x61 in case of using "a" as passphrase).
I might be talking out of my bottom, so excuse me (I don't use sqlCipher much) but doing cursory searches, the raw key would be a 64-character hex string, not just a representation of the passphrase.
Again, this post would indicate you have to rekey if you wish to switch from passphrase to raw key.
https://discuss.zetetic.net/t/moving-from-passphrase-to-raw-key-format/4047
I don't think you can simply 'intermingle', but again, I have no idea what I'm talking about, so may have misread.
I am also facing this issue using 3.12.2
in my situation this sql file was exported from an unencrypted .sqlite file which is a record of brave browser history, unable to view its contents with db browser for sqlite because i have no idea what is the passphrase/raw key since i didnt create any when i exported it
i tried opening the same .sql file with visual studio code and it displayed the contents normally without asking for encryption key, but vscode doesnt display contents in tables and columns like dbbrowserforsqlite so it's very intuitive to view;
so i guess there must be a default encryption key of this bd browser for sqlite, i just dont know what it is
You're mentioning two different types of files. a .sqlite file is different from a .sql file.
Can you attach a screenshot of part of the file you can see in VSCode? Blur any contents you don't want public, or crop, but I just want to ascertain what sort of file you're looking at.
Generally, DB4S will try and open the database without any key. If it fails or doesn't see the file as a database (which a .sql file isn't) then it'll assume its encrypted and display the 'enter a passphrase' dialog.
Also, where is the database you're trying to open? I've installed Brave to have a look myself, but there are many databases.