These parameters are set up using graphycal interface of DBBrowser (SQLCipher) under Win with a specific password, and the resulting DB will be used in Raspberry let say.
I’m developing a C++ app to open the DB and query it. The result is that: file is not a database.
Went back to my Ubuntu vm and I’ve installed sqlcipher from apt. I also installed sqlitebrowser.
From the first executing pragmas and opening the db file gives the same error, from sqlitebrowser setting custom params on GUI, I’m able to open it.
What’s wrong with my steps? So what are correct steps to set custom config at command line to query the DB?
I think that this will help a lot for my C++ app too.
I’ve done another test from shell:
Use “.open FILENAME” to reopen on a persistent database.
sqlite> attach database ‘2388v0_enc.sqlite’ as db key ‘p69-4Rm^U9DRUz8?4Vr5Tg2ZkQMMJae=’
…> ;
sqlite> PRAGMA db.cipher_page_size = 1024;
sqlite> pragma db.kdf_iter=16000;
sqlite> .tables
Error: out of memory
sqlite> pragma db.cipher_hmac_algorithm = ‘HMAC_SHA512’
…> ;
sqlite> pragma db.HMAC_SHA512 = ‘PBKDF2_HMAC_SHA512’
…> ;
sqlite> .tables
Error: out of memory
How does your application apply the settings in relation to when you open and when you query it? Those settings will need to be executed both after you open the connection and key the database, but before you attempt to read anything from the database (including your call to .tables in the CLI).
Please note the above is invalid, see a working example below:
Are you using a Commercial edition of SQLCipher, or did you build the library yourself? Can you post a fragment of your code where you open and key the database?