Is it possible to work with an encrypted SQLite database directly in Qt? Or, do I have to read it entirely into memory, decrypt in memory, do work, encrypt in memory, write to disk?
Asked
Active
Viewed 6,966 times
1
-
I guess that would depend on if YOU are encrypting the file and THEN giving it to SQLite, **OR** if you let SQLite do the encryption... assuming SQLite has encryption abilities (not sure about that one). – FrustratedWithFormsDesigner Jun 01 '10 at 20:44
-
https://stackoverflow.com/questions/5669905/sqlite-with-encryption-password-protection/5877130#5877130 – OliJG May 04 '11 at 00:02
1 Answers
1
Take a look at the SQLite Encryption Extension (SEE).

Doug Currie
- 40,708
- 1
- 95
- 119
-
Can this be used with Qt without recompiling any part of Qt, though? – Jake Petroules Jun 01 '10 at 21:52
-
I would think so. If you read the doc. pointed to by Doug : "If you already have your application working with public-domain SQLite, then you should be able to drop in SEE in place of SQLite, recompile, and your application will continue to work identically. SEE will not start encrypting databases until you enable the encryption feature using one of the interfaces outlined aboved." – Symbiosoft Jun 01 '10 at 22:44
-
1In Qt5, SQLITE support is via a plugin, so this 'answer' is a bit misleading. Caveat emptor. I suspect one would have to make a Qt5 plugin to enable this support. – guitarpicva Nov 29 '20 at 15:20
-
1If you use SEE, you will need to use raw SQLite functions: sqlite3_open, sqlite3_exec, sqlite3_prepare_v2, etc. You can't use QSqlDatabase. – Pierre Jan 24 '21 at 22:51